Пример #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);
     }
 }