public static void CopyCtrl2ClipBoard(Control ctrl) { CBFormCtrl cbCtrl = new CBFormCtrl(ctrl); IDataObject ido = new DataObject(); ido.SetData(CBFormCtrl.Format.Name, true, cbCtrl); Clipboard.SetDataObject(ido, false); }
public static Control CloneCtrl(Control ctrl) { CBFormCtrl cbCtrl = new CBFormCtrl(ctrl); Control newCtrl = ControlFactory.CreateControl(cbCtrl.CtrlName, cbCtrl.PartialName); ControlFactory.SetControlProperties(newCtrl, cbCtrl.PropertyList); return(newCtrl); }
public static Control GetCtrlFromClipBoard(SampleDesignerHost host) { Control ctrl = new Control(); IDataObject ido = Clipboard.GetDataObject(); if (ido.GetDataPresent(CBFormCtrl.Format.Name)) { CBFormCtrl cbCtrl = ido.GetData("CF_DESIGNERCOMPONENTS_V2") as CBFormCtrl; ctrl = (Control)host.CreateComponent(cbCtrl.GetType(), cbCtrl.PartialName); ControlFactory.SetControlProperties(ctrl, cbCtrl.PropertyList); } //host.CreateComponent(ctrl.GetType, ctrl.Name ); return(ctrl); }
public static Control CloneCtrl(Control ctrl) { CBFormCtrl cbCtrl = new CBFormCtrl(ctrl); Control newCtrl = ControlFactory.CreateControl(cbCtrl.CtrlName, cbCtrl.PartialName); ControlFactory.SetControlProperties(newCtrl, cbCtrl.PropertyList); return newCtrl; }