Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }