Skip to content

Commit

Permalink
Merge pull request #234 from XAMLMarkupExtensions/development
Browse files Browse the repository at this point in the history
Release 3.6.1
  • Loading branch information
konne authored May 11, 2020
2 parents 3cf26a1 + a71761c commit bee4e9d
Show file tree
Hide file tree
Showing 52 changed files with 221 additions and 235 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: .NET

on: [push, pull_request]
on:
push:
branches: [ master, development ]
paths-ignore:
- '*.md'
- 'docs/**'

pull_request:
branches: [ master, development ]
paths-ignore:
- '*.md'
- 'docs/**'

jobs:
build:
Expand Down Expand Up @@ -36,4 +47,4 @@ jobs:
# - name: Build with dotnet
# run: |
# cd src
# dotnet build --disable-parallel --configuration Release
# dotnet build --disable-parallel --configuration Release
6 changes: 3 additions & 3 deletions src/Engine/EnumComboBox.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="EnumComboBox.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Uwe Mayer</author>
#endregion
Expand Down Expand Up @@ -109,7 +109,7 @@ public string Prefix

private bool _shouldSerializeTemplate;

#pragma warning disable 1591
/// <inheritdoc/>
protected override void OnItemTemplateChanged(DataTemplate oldItemTemplate, DataTemplate newItemTemplate)
{
if (oldItemTemplate != null)
Expand All @@ -118,14 +118,14 @@ protected override void OnItemTemplateChanged(DataTemplate oldItemTemplate, Data
base.OnItemTemplateChanged(oldItemTemplate, newItemTemplate);
}

/// <inheritdoc/>
protected override bool ShouldSerializeProperty(DependencyProperty dp)
{
if (dp == ItemTemplateProperty && !_shouldSerializeTemplate)
return false;

return base.ShouldSerializeProperty(dp);
}
#pragma warning restore 1591
#endregion

private void SetType(Type type)
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/EnumRun.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="EnumRun.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Uwe Mayer</author>
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/GapTextControl.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="GapTextControl.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Peter Wendorff</author>
// <author>Uwe Mayer</author>
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/IDictionaryEventListener.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="IDictionaryEventListener.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Uwe Mayer</author>
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/LocBinding.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="LocBinding.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Uwe Mayer</author>
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/LocProxy.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="LocBinding.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Uwe Mayer</author>
#endregion
Expand Down
18 changes: 5 additions & 13 deletions src/Engine/LocalizeDictionary.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
#region Copyright information
// <copyright file="LocalizeDictionary.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Bernhard Millauer</author>
// <author>Uwe Mayer</author>
#endregion

#region AssemblyAttributes
// TODO: check for move to Assembly.cs,..
using System.Windows.Markup;
// Register this namespace one with prefix
[assembly: XmlnsDefinition("http://wpflocalizeextension.codeplex.com", "WPFLocalizeExtension.Engine")]
[assembly: XmlnsDefinition("http://wpflocalizeextension.codeplex.com", "WPFLocalizeExtension.Extensions")]
[assembly: XmlnsDefinition("http://wpflocalizeextension.codeplex.com", "WPFLocalizeExtension.Providers")]
[assembly: XmlnsDefinition("http://wpflocalizeextension.codeplex.com", "WPFLocalizeExtension.TypeConverters")]
// Assign a default namespace prefix for the schema
[assembly: XmlnsPrefix("http://wpflocalizeextension.codeplex.com", "lex")]
#endregion

namespace WPFLocalizeExtension.Engine
{
#region Usings
Expand Down Expand Up @@ -270,6 +258,7 @@ public static ILocalizationProvider GetProvider(DependencyObject obj)
return obj.GetValueSync<ILocalizationProvider>(ProviderProperty);
}

#pragma warning disable IDE0060
/// <summary>
/// Getter of <see cref="DependencyProperty"/> DefaultProvider.
/// </summary>
Expand Down Expand Up @@ -319,6 +308,7 @@ public static bool GetOutputMissingKeys(DependencyObject target)
{
return Instance.OutputMissingKeys;
}
#pragma warning restore IDE0060

/// <summary>
/// Getter of <see cref="DependencyProperty"/> DesignCulture.
Expand Down Expand Up @@ -348,6 +338,7 @@ public static void SetProvider(DependencyObject obj, ILocalizationProvider value
obj.SetValueSync(ProviderProperty, value);
}

#pragma warning disable IDE0060
/// <summary>
/// Setter of <see cref="DependencyProperty"/> DefaultProvider.
/// </summary>
Expand Down Expand Up @@ -397,6 +388,7 @@ public static void SetOutputMissingKeys(DependencyObject obj, bool value)
{
Instance.OutputMissingKeys = value;
}
#pragma warning restore IDE0060

/// <summary>
/// Setter of <see cref="DependencyProperty"/> DesignCulture.
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/MissingKeyEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="MissingKeyEventArgs.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Uwe Mayer</author>
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/ObjectDependencyManager.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="ObjectDependencyManager.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Bernhard Millauer</author>
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/ParentNotifiers.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="ParentChangedNotifierHelper.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Bernhard Millauer</author>
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/SafeTargetInfo.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="SafeTargetInfo.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Uwe Mayer</author>
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/WeakReference.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="ParentChangedNotifierHelper.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Bernhard Millauer</author>
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/BLoc.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="BLoc.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Bernhard Millauer</author>
// <author>Uwe Mayer</author>
Expand Down
38 changes: 33 additions & 5 deletions src/Extensions/Compatibility.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="Compatibility.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Bernhard Millauer</author>
// <author>Uwe Mayer</author>
Expand All @@ -16,46 +16,64 @@ namespace WPFLocalizeExtension.Extensions
using XAMLMarkupExtensions.Base;
#endregion

#pragma warning disable 1591

/// <inheritdoc/>
[MarkupExtensionReturnType(typeof(System.Windows.Media.Brush))]
public class LocBrushExtension : LocExtension
{
/// <inheritdoc/>
public LocBrushExtension()
{ }

/// <inheritdoc/>
public LocBrushExtension(string key) : base(key) { }
}

/// <inheritdoc/>
[MarkupExtensionReturnType(typeof(double))]
public class LocDoubleExtension : LocExtension
{
/// <inheritdoc/>
public LocDoubleExtension()
{ }

/// <inheritdoc/>
public LocDoubleExtension(string key) : base(key) { }
}

/// <inheritdoc/>
[MarkupExtensionReturnType(typeof(System.Windows.FlowDirection))]
public class LocFlowDirectionExtension : LocExtension
{
/// <inheritdoc/>
public LocFlowDirectionExtension()
{ }

/// <inheritdoc/>
public LocFlowDirectionExtension(string key) : base(key) { }
}

/// <inheritdoc/>
[MarkupExtensionReturnType(typeof(System.Windows.Media.Imaging.BitmapSource))]
public class LocImageExtension : LocExtension
{
/// <inheritdoc/>
public LocImageExtension()
{ }

/// <inheritdoc/>
public LocImageExtension(string key) : base(key) { }
}

/// <inheritdoc/>
[MarkupExtensionReturnType(typeof(string))]
public class LocTextExtension : LocExtension
{
#region Constructors
/// <inheritdoc/>
public LocTextExtension()
{ }

/// <inheritdoc/>
public LocTextExtension(string key) : base(key) { }
#endregion

Expand Down Expand Up @@ -254,12 +272,16 @@ public override object FormatOutput(TargetInfo endPoint, TargetInfo info)
#endregion
}

/// <inheritdoc/>
[MarkupExtensionReturnType(typeof(string))]
public class LocTextLowerExtension : LocTextExtension
{
#region Constructors
/// <inheritdoc/>
public LocTextLowerExtension()
{ }

/// <inheritdoc/>
public LocTextLowerExtension(string key) : base(key) { }
#endregion

Expand All @@ -279,12 +301,16 @@ protected override string FormatText(string target)
#endregion
}

/// <inheritdoc/>
[MarkupExtensionReturnType(typeof(string))]
public class LocTextUpperExtension : LocTextExtension
{
#region Constructors
/// <inheritdoc/>
public LocTextUpperExtension()
{ }

/// <inheritdoc/>
public LocTextUpperExtension(string key) : base(key) { }
#endregion

Expand All @@ -304,13 +330,15 @@ protected override string FormatText(string target)
#endregion
}

/// <inheritdoc/>
[MarkupExtensionReturnType(typeof(System.Windows.Thickness))]
public class LocThicknessExtension : LocExtension
{
/// <inheritdoc/>
public LocThicknessExtension()
{ }

/// <inheritdoc/>
public LocThicknessExtension(string key) : base(key) { }
}

#pragma warning restore 1591
}
18 changes: 1 addition & 17 deletions src/Extensions/FELoc.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region Copyright information
// <copyright file="FELoc.cs">
// Licensed under Microsoft Public License (Ms-PL)
// http://wpflocalizeextension.codeplex.com/license
// https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension/blob/master/LICENSE
// </copyright>
// <author>Bernhard Millauer</author>
// <author>Uwe Mayer</author>
Expand Down Expand Up @@ -230,22 +230,6 @@ private static void DependencyPropertyChanged(DependencyObject obj, DependencyPr
}

#region Parent changed event
private IList<DependencyProperty> GetAttachedProperties(DependencyObject obj)
{
var attached = new List<DependencyProperty>();

foreach (PropertyDescriptor pd in TypeDescriptor.GetProperties(obj,
new Attribute[] { new PropertyFilterAttribute(PropertyFilterOptions.All) }))
{
var dpd = DependencyPropertyDescriptor.FromProperty(pd);

if (dpd != null && dpd.IsAttached)
attached.Add(dpd.DependencyProperty);
}

return attached;
}

/// <summary>
/// Based on http://social.msdn.microsoft.com/Forums/en/wpf/thread/580234cb-e870-4af1-9a91-3e3ba118c89c
/// </summary>
Expand Down
Loading

0 comments on commit bee4e9d

Please sign in to comment.