Exemple #1
0
 public void SetNoteList()
 {
     ObjectListUI.SetActive(false);
     InformationDisplay.SetActive(false);
     KeyListUI.SetActive(false);
     NoteListUI.SetActive(true);
 }
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (((context != null) && (context.Instance != null)) && (provider != null))
     {
         IWindowsFormsEditorService edSvc = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
         if (edSvc == null)
         {
             return value;
         }
         foreach (Attribute attribute in context.PropertyDescriptor.Attributes)
         {
             if (attribute is ListAttribute)
             {
                 ListAttribute attribute2 = (ListAttribute) attribute;
                 IList checkedObjs = (IList) value;
                 ObjectListUI control = new ObjectListUI(this);
                 control.Start(edSvc, attribute2.DataSource, checkedObjs);
                 edSvc.DropDownControl(control);
                 bool flag = false;
                 if (checkedObjs == null)
                 {
                     checkedObjs = new ArrayList();
                 }
                 else if (checkedObjs.Count > 0)
                 {
                     checkedObjs.Clear();
                     flag = true;
                 }
                 IList list2 = control.Value;
                 if (!(flag || (list2.Count <= 0)))
                 {
                     flag = true;
                 }
                 foreach (object obj2 in list2)
                 {
                     checkedObjs.Add(obj2);
                 }
                 if (flag)
                 {
                     LoggingService.Debug("选择的列表已改变...");
                     PropertyGridEditPanel.Instance.PropertyChanged(context.Instance, null);
                 }
                 value = checkedObjs;
                 control.End();
             }
         }
     }
     return value;
 }