/Main/src/Xbap/DynamicDataDisplay.Xbap.Samples/Internals/ResourceExtensions.cs
C# | 52 lines | 0 code | 6 blank | 46 comment | 0 complexity | 9d8c001809af96b63d202c80d673c9ec MD5 | raw file
Possible License(s): CC-BY-SA-3.0
1//using System; 2//using System.Collections.Generic; 3//using System.Linq; 4//using System.Text; 5//using System.Windows.Markup; 6 7//namespace Microsoft.Research.DynamicDataDisplay.Samples.Internals 8//{ 9// /// <summary> 10// /// Represents a markup extension, which allows to get an access to application resource files. 11// /// </summary> 12// [MarkupExtensionReturnType(typeof(string))] 13// public class ResourceExtension : MarkupExtension 14// { 15// /// <summary> 16// /// Initializes a new instance of the <see cref="ResourceExtension"/> class. 17// /// </summary> 18// public ResourceExtension() { } 19 20// private string resourceKey; 21// [ConstructorArgument("resourceKey")] 22// public string ResourceKey 23// { 24// get { return resourceKey; } 25// set 26// { 27// if (resourceKey == null) 28// throw new ArgumentNullException("resourceKey"); 29 30// resourceKey = value; 31// } 32// } 33 34// /// <summary> 35// /// Initializes a new instance of the <see cref="ResourceExtension"/> class. 36// /// </summary> 37// /// <param name="resourceKey">The resource key.</param> 38// public ResourceExtension(object resourceKey) 39// { 40// string resourceKeyString = resourceKey as string; 41// if (resourceKeyString == null) 42// throw new ArgumentNullException("resourceKey"); 43 44// this.resourceKey = resourceKeyString; 45// } 46 47// public override object ProvideValue(IServiceProvider serviceProvider) 48// { 49// return Strings.UIResources.ResourceManager.GetString(resourceKey); 50// } 51// } 52//}