Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
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;
        }
Exemplo n.º 5
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);

        }