mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 05:23:24 -07:00
Moving back to trunk!
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1602 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
ad265b2c54
commit
8d458998a1
332 changed files with 17647 additions and 9466 deletions
51
GreenshotConfluencePlugin/Support/TranslateExtension.cs
Normal file
51
GreenshotConfluencePlugin/Support/TranslateExtension.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace TranslationByMarkupExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// The Translate Markup extension returns a binding to a TranslationData
|
||||
/// that provides a translated resource of the specified key
|
||||
/// </summary>
|
||||
public class TranslateExtension : MarkupExtension
|
||||
{
|
||||
#region Private Members
|
||||
|
||||
private string _key;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Construction
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TranslateExtension"/> class.
|
||||
/// </summary>
|
||||
/// <param name="key">The key.</param>
|
||||
public TranslateExtension(string key)
|
||||
{
|
||||
_key = key;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[ConstructorArgument("key")]
|
||||
public string Key
|
||||
{
|
||||
get { return _key; }
|
||||
set { _key = value;}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// See <see cref="MarkupExtension.ProvideValue" />
|
||||
/// </summary>
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
var binding = new Binding("Value")
|
||||
{
|
||||
Source = new TranslationData(_key)
|
||||
};
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue