Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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;
        }
        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);

        }