示例#1
1
 // Constructors
 public ResourceItem()
 {
     this.itemName = "Generic Item";
     this.imageResource = null;
     this.itemType = 0;
 }
示例#2
0
        public void TestResourceConstructor01()
        {
            Properties.Resources resource = new Properties.Resources();

            //Post Check
            Assert.IsNotNull(resource);
        }
示例#3
0
        public void ThereShouldBeNoErrors()
        {
            var culture = Properties.Resources.Culture;
            Properties.Resources.Culture = culture;

            var resources = new Properties.Resources();
            Assert.IsNotNullOrEmpty(Properties.Resources.InvalidVersionId);
        }
示例#4
0
        public void ThereShouldBeNoErrors()
        {
            var culture = Properties.Resources.Culture;

            Properties.Resources.Culture = culture;

            var resources = new Properties.Resources();

            Assert.IsNotNullOrEmpty(Properties.Resources.InvalidVersionId);
        }
示例#5
0
        private IDictionary <string, string> getAllCurrenciesShortcuts()
        {
            IDictionary <string, string> returnedCurrencies = new Dictionary <string, string>();

            Properties.Resources resources = new Properties.Resources();
            Type resourcesType             = resources.GetType();
            var  props = resourcesType.GetProperties();

            foreach (var prop in props)
            {
                if (prop.Name.ToLower().Contains("currencyshortcut") && prop.Name.Length > "currencyshortcut".Length + 1)
                {
                    returnedCurrencies.Add(prop.Name, prop.GetValue(resources).ToString());
                }
            }
            return(returnedCurrencies);
        }
        public string Translate(string source)
        {
            if (source == null)
            {
                return(null);
            }
            Properties.Resources resources = new Properties.Resources();
            Type resourcesType             = resources.GetType();
            var  props = resourcesType.GetProperties();

            foreach (var prop in props)
            {
                if (prop.Name.ToLower() == source.ToLower())
                {
                    return(prop.GetValue(resources).ToString());
                }
            }
            return(null);
        }
示例#7
0
 public void setItemImageResouce(Properties.Resources res)
 {
     this.imageResource = res;
 }
示例#8
0
 public ResourceItem(String name, Properties.Resources resource, int type)
 {
     this.itemName = name;
     this.imageResource = resource;
     this.itemType = type;
 }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     Properties.Resources res = new Properties.Resources();
     MainMenuBackground.Source = TypesConverter.BitmapToWPFBitmapSource(Properties.Resources.rails);
     PermissionManager.CheckPermission(this);
 }