public void SetStructProperty(DesignerStructPropertyInfo structProperty, object obj) { Debug.Check(structProperty != null); _structProperty = structProperty; setObject(obj); buildPropertyGrid(); }
public void SetStructProperty(DesignerStructPropertyInfo structProperty, object obj) { Debug.Check(structProperty != null); _structProperty = structProperty; _object = obj; _node = _object as Nodes.Node; buildPropertyGrid(); }
void createParamEditor(DesignerStructPropertyInfo structParam, Nodes.Action action) { MethodDef method = action.Method; if (method != null) { List <MethodDef.Param> parameters = method.GetParams(structParam); if (parameters != null && parameters.Count > 0) { foreach (MethodDef.Param p in parameters) { Type editorType = null; if (structParam.ElmentIndexInArray != -1) { object member = p.Value; editorType = p.Attribute.GetEditorType(member); } else { editorType = typeof(DesignerParameterComboEnumEditor); } string arugmentsName = " " + p.DisplayName; Label label = propertyGrid.AddProperty(arugmentsName, editorType, p.Attribute != null ? p.Attribute.HasFlags(DesignerProperty.DesignerFlags.ReadOnly) : false); label.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); label.MouseEnter += label_MouseEnter; DesignerPropertyEditor editor = (DesignerPropertyEditor)label.Tag; editor.Enabled = true; //editor.SetRootNode(this._node); editor.SetParameter(p, action, false); editor.MouseEnter += new EventHandler(editor_MouseEnter); editor.ValueWasAssigned(); editor.ValueWasChanged += editor_ValueWasChanged; } { propertyGrid.UpdateSizes(); propertyGrid.PropertiesVisible(true, true); } } } }
public List<Param> GetParams(DesignerStructPropertyInfo structParam) { if (_structParams.ContainsKey(structParam.Name)) { List<Param> ps = _structParams[structParam.Name].GetParams(structParam.ElmentIndexInArray); if (ps != null) { return ps; } } else { if (structParam.ElmentIndexInArray == -1) { _structParams[structParam.Name] = new StructParam_t(); } else { _structParams[structParam.Name] = new StructArrayParam_t(); } } IList<DesignerPropertyInfo> properties = DesignerProperty.GetDesignerProperties(structParam.Type, DesignerProperty.SortByDisplayOrder); foreach (DesignerPropertyInfo property in properties) { Param v = new Param(property, structParam.Owner); _structParams[structParam.Name].AddParam(structParam.ElmentIndexInArray, v); } return _structParams[structParam.Name].GetParams(structParam.ElmentIndexInArray); }
public override void SetStructProperty(DesignerStructPropertyInfo structProperty, object obj) { base.SetStructProperty(structProperty, obj); update(); }
public virtual void SetStructProperty(DesignerStructPropertyInfo structProperty, object obj) { _structProperty = structProperty; _object = obj; }
void createParamEditor(DesignerStructPropertyInfo structParam, Nodes.Action action) { MethodDef method = action.Method; List<MethodDef.Param> parameters = method.GetParams(structParam); foreach(MethodDef.Param p in parameters) { Type editorType = null; if (structParam.ElmentIndexInArray != -1) { object member = p.Value; editorType = p.Attribute.GetEditorType(member); } else { editorType = typeof(DesignerParameterComboEnumEditor); } string arugmentsName = " " + p.DisplayName; Label label = propertyGrid.AddProperty(arugmentsName, editorType, p.Attribute != null ? p.Attribute.HasFlags(DesignerProperty.DesignerFlags.ReadOnly) : false); label.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); label.MouseEnter += label_MouseEnter; DesignerPropertyEditor editor = (DesignerPropertyEditor)label.Tag; editor.Enabled = true; //editor.SetRootNode(this._node); editor.SetParameter(p, action, false); editor.MouseEnter += new EventHandler(editor_MouseEnter); editor.ValueWasAssigned(); editor.ValueWasChanged += editor_ValueWasChanged; } if (parameters.Count > 0) { propertyGrid.UpdateSizes(); propertyGrid.PropertiesVisible(true, true); } }