Пример #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);
        }
Пример #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);
        }
Пример #3
0
        public static Control GetCtrlFromClipBoard()
        {
            Control ctrl = new Control();

            IDataObject ido = Clipboard.GetDataObject();

            if (ido.GetDataPresent(CBFormCtrl.Format.Name))
            {
                CBFormCtrl cbCtrl = ido.GetData(CBFormCtrl.Format.Name) as CBFormCtrl;

                ctrl = ControlFactory.CreateControl(cbCtrl.CtrlName, cbCtrl.PartialName);
                ControlFactory.SetControlProperties(ctrl, cbCtrl.PropertyList);
            }
            return(ctrl);
        }