static void CreateControl(object sender, EventArgs e) { TreeView t = (TreeView)sender; Derma.New(t.SelectedNode.Text.ToString()); Derma.Repaint(); }
private void Form1_DragDrop(object sender, DragEventArgs e) { string pName = (string)e.Data.GetData(typeof(string)); Point newPos = Derma.GetRelativeMousePos(e.X, e.Y); Derma.New(pName, newPos.X, newPos.Y); Derma.Repaint(); }
public static Panel PanelFromPanelInfo(DPanelInfo ifo) { string type = ifo.GetString("___type"); if (type == null) { return(null); } string ParentIndex = ifo.GetString("___parent"); Panel p = Derma.New(type); FieldInfo[] fields = GetSaveableFields(p); PropertyInfo[] properties = GetSaveableProperties(p); foreach (FieldInfo FInfo in fields) { Type CastType = FInfo.FieldType; object SavedProp = ifo.GetObject(FInfo.Name, CastType); if (SavedProp == null) { continue; } FInfo.SetValue(p, SavedProp); } foreach (PropertyInfo FInfo in properties) { Type CastType = FInfo.PropertyType; object SavedProp = ifo.GetObject(FInfo.Name, CastType); if (SavedProp == null) { continue; } FInfo.SetValue(p, SavedProp, null); } if (ParentIndex != null) { p.parentIdentifier = ParentIndex; } return(p); }