Exemple #1
0
 /// <summary>
 /// Enabels or disables the value editor for a Parser Target
 /// </summary>
 private void ToggleValueEditor(Type memberType, String name, Func <Object> getter, Action <Object> setter, Boolean active)
 {
     if (ValueEditors.ContainsKey(getter()) && ValueEditors[getter()].IsOpen)
     {
         if (active)
         {
             ValueEditors[getter()].Show();
         }
         else
         {
             ValueEditors[getter()].Hide();
         }
     }
     else if (Children.ContainsKey(getter()))
     {
         if (active)
         {
             Children[getter()].Open();
         }
         else
         {
             Children.Remove(getter());
         }
     }
     else
     {
         Type editorType = GetValueEditor(memberType);
         if (editorType != null)
         {
             ValueEditor editor = CreateValueEditor(editorType, name, getter, setter);
             editor.Open();
             ValueEditors.Add(getter(), editor);
         }
     }
 }
 /// <summary>
 /// Enabels or disables the value editor for a Parser Target
 /// </summary>
 private void ToggleValueEditor(ParserTarget target, MemberInfo member, Boolean active)
 {
     if (ValueEditors.ContainsKey(target.FieldName) && ValueEditors[target.FieldName].IsOpen)
     {
         if (active)
         {
             ValueEditors[target.FieldName].Show();
         }
         else
         {
             ValueEditors[target.FieldName].Hide();
         }
     }
     else if (ValueEditors.ContainsKey(target.FieldName))
     {
         if (active)
         {
             ValueEditors[target.FieldName].Open();
         }
         else
         {
             ValueEditors.Remove(target.FieldName);
         }
     }
     else
     {
         Type editorType = GetValueEditor(Tools.MemberType(member));
         if (editorType != null)
         {
             ValueEditor editor = CreateValueEditor(editorType, target, member);
             editor.Open();
             ValueEditors.Add(target.FieldName, editor);
         }
     }
 }