public override void ApplyResources(string cultureCode) { ResourcesList.Clear(); EditableControlsList.Clear(); foreach (GridColumn col in GridView.Columns) { string captionId = GetKeyForComponent(col, DesignElement.Caption); var resValue = CommonResourcesCache.Get("EidssFields", cultureCode, captionId, GetViewNameForSplittedResources()); string propName = TranslationToolHelper.GetPropertyName(col.Name, TranslationToolHelper.CaptionPropName); if (resValue != null && resValue.Value is string) { if (!ResourcesList.ContainsKey(propName)) { ResourcesList.Add(propName, resValue); } col.Caption = resValue.Value.ToString(); } else { if (!ResourcesList.ContainsKey(propName)) { ResourcesList.Add(propName, new ResourceValue { Value = col.Caption, //RawValue = col.Caption, //SourceFileName = string.Format("EidssFields.{0}.resx", cultureCode), EnglishText = WinClientContext.FieldCaptions.GetString(captionId, null, common.Core.Localizer.lngEn), SourceKey = captionId, ResourceName = CommonResource.EidssFields.ToString() }); } } EditableControlsList.Add(propName, col); } }
public override void ApplyResources(string cultureCode) { ResourcesList.Clear(); foreach (Control ctl in Controls) { var action = ctl.Tag as ActionMetaItem; if (action != null) { string s = action.CaptionId(BusinessObject, Permissions); var resValue = CommonResourcesCache.Get(CommonResource.BvMessages.ToString(), cultureCode, s, GetViewNameForSplittedResources()); var propName = TranslationToolHelper.GetPropertyName(ctl.Name, TranslationToolHelper.TextPropName); if (resValue == null && Messages != null) { resValue = CommonResourcesCache.Get(Messages.GetType().Name, cultureCode, s, GetViewNameForSplittedResources()); } if (resValue != null) { ResourcesList.Add(propName, resValue); ctl.Text = resValue.Value.ToString(); if (!EditableControlsList.ContainsKey(propName)) { EditableControlsList.Add(propName, ctl); } } } else if (BasePanel != null && !(ctl is TranslationButton)) { TranslationToolHelperWinClient.ApplyResources(ctl, BasePanel as ITranslationView, cultureCode); } } }
/// <summary> /// LoadResources method override /// </summary> public override void LoadResources() { ResourcesList.Add(ResourcesLocaleKind.SamplesHtml, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Samples.Resources.CSHtml")); ResourcesList.Add(ResourcesLocaleKind.SamplesErrors, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Samples.Resources.CSErrors")); ResourcesList.Add(ResourcesLocaleKind.SamplesMail, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Samples.Resources.CSMail")); ResourcesList.Add(ResourcesLocaleKind.SMSHtml, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.Multifactor.Samples.Resources.SHtml")); ResourcesList.Add(ResourcesLocaleKind.SMSAzure, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.Multifactor.Samples.Resources.SAzure")); }
/// <summary> /// LoadResources method override /// </summary> public override void LoadResources() { ResourcesList.Add(ResourcesLocaleKind.UIHtml, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Resources.SHtml")); ResourcesList.Add(ResourcesLocaleKind.UIErrors, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Resources.SErrors")); ResourcesList.Add(ResourcesLocaleKind.UIInformations, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Resources.SInfos")); ResourcesList.Add(ResourcesLocaleKind.UITitles, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Resources.STitle")); ResourcesList.Add(ResourcesLocaleKind.UIValidation, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Resources.SCheck")); }
private void FindElementsForCurrentMap(string selectedMap) { int map = int.Parse(selectedMap); List <Resource> query = (from r in DataManager.MapData.Resources where r.MapID == map select r).ToList(); Lista.ItemsSource = ResourcesList; ResourcesList.Clear(); ResourcesOnMap.Clear(); CanvasMap.Children.Clear(); foreach (Resource resource in query) { if (resource.OnMap) // Resource is on the map { ResourcesOnMap.Add(resource); AddIconToMap(resource); } ResourcesList.Add(resource); } }
public Form1() { InitializeComponent(); //ConnectionString = ConfigurationManager.ConnectionStrings[@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\CivilizationDB.mdf;Integrated Security=True"].ConnectionString; //Civ Basics CivilizationEthnicity.Items.Add("African"); CivilizationEthnicity.Items.Add("Asian"); CivilizationEthnicity.Items.Add("European"); CivilizationEthnicity.Items.Add("Mediterranean"); CivilizationEthnicity.Items.Add("South American"); //Civilizations CivilizationsList.Add("America"); CivilizationsList.Add("Arabia"); CivilizationsList.Add("Australia"); CivilizationsList.Add("Aztec"); CivilizationsList.Add("Brazil"); CivilizationsList.Add("Canada"); CivilizationsList.Add("China"); CivilizationsList.Add("Cree"); CivilizationsList.Add("Egypt"); CivilizationsList.Add("England"); CivilizationsList.Add("France"); CivilizationsList.Add("Georgia"); CivilizationsList.Add("Germany"); CivilizationsList.Add("Greece"); CivilizationsList.Add("Hungary"); CivilizationsList.Add("Inca"); CivilizationsList.Add("India"); CivilizationsList.Add("Indonesia"); CivilizationsList.Add("Japan"); CivilizationsList.Add("Khmer"); CivilizationsList.Add("Kongo"); CivilizationsList.Add("Korea"); CivilizationsList.Add("Macedon"); CivilizationsList.Add("Mali"); CivilizationsList.Add("Maori"); CivilizationsList.Add("Mapuche"); CivilizationsList.Add("Mongolia"); CivilizationsList.Add("Netherlands"); CivilizationsList.Add("Norway"); CivilizationsList.Add("Nubia"); CivilizationsList.Add("Ottoman"); CivilizationsList.Add("Persia"); CivilizationsList.Add("Phoenicia"); CivilizationsList.Add("Poland"); CivilizationsList.Add("Rome"); CivilizationsList.Add("Russia"); CivilizationsList.Add("Scotland"); CivilizationsList.Add("Scythia"); CivilizationsList.Add("Spain"); CivilizationsList.Add("Sumeria"); CivilizationsList.Add("Sweden"); CivilizationsList.Add("Zulu"); Civilizations = CivilizationsList.ToArray(); LeaderCivilization2.Items.Add(""); LeaderCivilization2.Enabled = false; LeaderCivilization3.Items.Add(""); LeaderCivilization3.Enabled = false; foreach (var civ in Civilizations) { LeaderCivilization1.Items.Add(civ); LeaderCivilization2.Items.Add(civ); LeaderCivilization3.Items.Add(civ); } //Civ Start Biases CivilizationStartBiasMinor.Enabled = false; CivilizationStartBiasMain.Items.Add("Feature"); CivilizationStartBiasMain.Items.Add("Resource"); CivilizationStartBiasMain.Items.Add("Rivers"); CivilizationStartBiasMain.Items.Add("Terrain"); FeaturesList.Add("Floodplains"); FeaturesList.Add("Floddplains Grassland"); FeaturesList.Add("Floddplains Plains"); FeaturesList.Add("Forest"); FeaturesList.Add("Geothermal Fissure"); FeaturesList.Add("Jungle"); FeaturesList.Add("Marsh"); FeaturesList.Add("Oasis"); FeaturesList.Add("Volcano"); Features = FeaturesList.ToArray(); ResourcesList.Add("Bananas"); ResourcesList.Add("Cattle"); ResourcesList.Add("Copper"); ResourcesList.Add("Deer"); ResourcesList.Add("Rice"); ResourcesList.Add("Sheep"); ResourcesList.Add("Stone"); ResourcesList.Add("Wheat"); ResourcesList.Add("Citrus"); ResourcesList.Add("Cocoa"); ResourcesList.Add("Coffee"); ResourcesList.Add("Cotton"); ResourcesList.Add("Diamonds"); ResourcesList.Add("Dyes"); ResourcesList.Add("Furs"); ResourcesList.Add("Gypsum"); ResourcesList.Add("Incense"); ResourcesList.Add("Ivory"); ResourcesList.Add("Jade"); ResourcesList.Add("Marble"); ResourcesList.Add("Mercury"); ResourcesList.Add("Pearls"); ResourcesList.Add("Salt"); ResourcesList.Add("Silk"); ResourcesList.Add("Silver"); ResourcesList.Add("Spices"); ResourcesList.Add("Sugar"); ResourcesList.Add("Tea"); ResourcesList.Add("Tobacco"); ResourcesList.Add("Truffles"); ResourcesList.Add("Whales"); ResourcesList.Add("Wine"); ResourcesList.Add("Aluminum"); ResourcesList.Add("Coal"); ResourcesList.Add("Horses"); ResourcesList.Add("Iron"); ResourcesList.Add("Niter"); ResourcesList.Add("Oil"); ResourcesList.Add("Uranium"); ResourcesList.Add("Amber"); ResourcesList.Add("Olives"); Resources = ResourcesList.ToArray(); TerrainsList.Add("Grass"); TerrainsList.Add("Grass Hills"); TerrainsList.Add("Grass Mountain"); TerrainsList.Add("Plains"); TerrainsList.Add("Plains Hills"); TerrainsList.Add("Plains Mountain"); TerrainsList.Add("Desert"); TerrainsList.Add("Desert Hills"); TerrainsList.Add("Desert Mountain"); TerrainsList.Add("Tundra"); TerrainsList.Add("Tundra Hills"); TerrainsList.Add("Tundra Mountain"); TerrainsList.Add("Snow"); TerrainsList.Add("Snow Hills"); TerrainsList.Add("Snow Mountain"); TerrainsList.Add("Coast"); TerrainsList.Add("Ocean"); Terrains = TerrainsList.ToArray(); }
private static Sprite LoadSprite(XmlNode root) { if (root.Name != "Sprite") { return(null); } Sprite sp = new Sprite(); PropertyInfo[] pinfo = sp.GetType().GetProperties(); Dictionary <string, PropertyInfo> pMap = new Dictionary <string, PropertyInfo>(); foreach (PropertyInfo p in pinfo) { pMap.Add(p.Name, p); } foreach (XmlNode node in root.ChildNodes) { string name = node.Name; if (name == "Variables") { foreach (XmlNode eNode in node.ChildNodes) { Variable v = LoadVariable(eNode); sp.Variables.Add(v); } } else if (name == "Expressions") { foreach (XmlNode eNode in node.ChildNodes) { Expression exp = LoadExpression(eNode); sp.Expressions.Add(exp); Point pt = new Point(); if (eNode.Attributes["x"] != null && eNode.Attributes["y"] != null) { pt = new Point(double.Parse(eNode.Attributes["x"].Value), double.Parse(eNode.Attributes["y"].Value)); } sp.Positions.Add(exp, pt); } } else if (name == "BlockStatements") { foreach (XmlNode bnode in node.ChildNodes) { BlockStatement bs = LoadBlockStatement(bnode); sp.BlockStatements.Add(bs); Point pt = new Point(); if (bnode.Attributes["x"] != null && bnode.Attributes["y"] != null) { pt = new Point(double.Parse(bnode.Attributes["x"].Value), double.Parse(bnode.Attributes["y"].Value)); } sp.Positions.Add(bs, pt); } } else if (name == "Handlers") { foreach (XmlNode bnode in node.ChildNodes) { Function func = LoadFunction(bnode); sp.Handlers.Add(func as EventHandler); Point pt = new Point(); if (bnode.Attributes["x"] != null && bnode.Attributes["y"] != null) { pt = new Point(double.Parse(bnode.Attributes["x"].Value), double.Parse(bnode.Attributes["y"].Value)); } sp.Positions.Add(func, pt); } } else if (name == "Functions") { foreach (XmlNode bnode in node.ChildNodes) { Function func = LoadFunction(bnode); sp.Functions.Add(func); Point pt = new Point(); if (bnode.Attributes["x"] != null && bnode.Attributes["y"] != null) { pt = new Point(double.Parse(bnode.Attributes["x"].Value), double.Parse(bnode.Attributes["y"].Value)); } sp.Positions.Add(func, pt); } } else if (name == "Positions") { } else { PropertyInfo property = pMap[name]; Type pType = property.PropertyType; if (pType.IsAssignableFrom(typeof(List <string>))) { List <string> list = new List <string>(); foreach (XmlNode snode in node.ChildNodes) { list.Add(snode.Attributes["value"].Value); } property.SetValue(sp, list); } else if (pType.IsAssignableFrom(typeof(ResourcesList))) { ResourcesList list = new ResourcesList(); foreach (XmlNode snode in node.ChildNodes) { list.Add(LoadResource(snode)); } property.SetValue(sp, list); } else { string value = node.Attributes["value"].Value; object obj = ConvertTo(value, pType); if (obj != null) { property.SetValue(sp, obj); } } } } return(sp); }
/// <summary> /// LoadResources method override /// </summary> public override void LoadResources() { ResourcesList.Add(ResourcesLocaleKind.CommonHtml, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Common.Resources.CSHtml")); ResourcesList.Add(ResourcesLocaleKind.CommonErrors, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Common.Resources.CSErrors")); ResourcesList.Add(ResourcesLocaleKind.CommonMail, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.Common.Resources.CSMail")); }
/// <summary> /// LoadResources method override /// </summary> public override void LoadResources() { ResourcesList.Add(ResourcesLocaleKind.FIDOHtml, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.WebAuthN.Resources.CSHtml")); }
/// <summary> /// LoadResources method override /// </summary> public override void LoadResources() { ResourcesList.Add(ResourcesLocaleKind.AzureHtml, GetResourceManager(typeof(ResourcesLocale).Assembly, "Neos.IdentityServer.MultiFactor.SAS.Resources.SSAS")); }