Exemplo n.º 1
0
        public override void ChangeLanguage()
        {
            base.ChangeLanguage();

            CreateChildObjectColumns();

            for (int i = 0; i < mListChildObjects.Count; i++)
            {
                ChildObjectItem item         = mListChildObjects[i];
                ConfigObject    configObject = item.ConfigObject;
                if (configObject != null)
                {
                    item.Name        = configObject.Name;
                    item.Description = configObject.Description;
                }
            }
        }
Exemplo n.º 2
0
 private void LoadChildObjects()
 {
     try
     {
         mListChildObjects.Clear();
         if (ListConfigObjects == null)
         {
             return;
         }
         if (ObjectItem == null)
         {
             return;
         }
         ConfigGroup configGroup = ObjectItem.Data as ConfigGroup;
         if (configGroup == null)
         {
             return;
         }
         ConfigObject = configGroup.ConfigObject;
         if (ConfigObject == null)
         {
             return;
         }
         int  childType = configGroup.ChildType;
         long parentID  = 0;
         if (ListResourceTypeParams != null)
         {
             ResourceTypeParam typeParam = ListResourceTypeParams.FirstOrDefault(t => t.TypeID == childType);
             if (typeParam != null)
             {
                 if (typeParam.ParentID > 0)
                 {
                     parentID = ConfigObject.ObjectID;
                 }
             }
         }
         List <ConfigObject> listChildObjects;
         if (parentID != 0)
         {
             listChildObjects =
                 ListConfigObjects.Where(o => o.ObjectType == configGroup.ChildType && o.ParentID == parentID)
                 .ToList();
         }
         else
         {
             listChildObjects =
                 ListConfigObjects.Where(o => o.ObjectType == configGroup.ChildType)
                 .ToList();
         }
         for (int i = 0; i < listChildObjects.Count; i++)
         {
             ConfigObject    child = listChildObjects[i];
             ChildObjectItem item  = new ChildObjectItem();
             item.ObjID        = child.ObjectID;
             item.Key          = child.ID;
             item.Name         = child.Name;
             item.Description  = child.Description;
             item.Icon         = string.Format("Images/{0}", child.Icon);
             item.ConfigObject = child;
             if ((i % 2) == 1)
             {
                 item.Background = Brushes.LightGray;
             }
             mListChildObjects.Add(item);
         }
     }
     catch (Exception ex)
     {
         App.ShowExceptionMessage(ex.Message);
     }
 }