Exemplo n.º 1
0
        public ChangeSnipPerpertyCommand(DesignPanel tdPanel, SnipRect pastedSnipRect, SnipData newData)
        {
            PastedSnipRect = pastedSnipRect;
            NewSnipData    = newData;
            OldSnipData    = new SnipData(pastedSnipRect.SnipData);

            TDPanel          = tdPanel;
            TDPanel.Modified = true;
            CommandInfo      = "更改页面片属性";
        }
Exemplo n.º 2
0
        /// <summary>
        /// Õ³Ìù×Ô¼ôÌù°å
        /// </summary>
        /// <returns></returns>
        public static SnipData GetFromClipboard()
        {
            SnipData    snipData = null;
            IDataObject dataObj  = Clipboard.GetDataObject();
            string      format   = typeof(SnipData).FullName;

            if (dataObj.GetDataPresent(format))
            {
                snipData = dataObj.GetData(format) as SnipData;
            }
            return(snipData);
        }
Exemplo n.º 3
0
        public PasteSnipDataCommand(DesignPanel tdPanel, List <Rect> pastedSnipRects, SnipData newData, TmpltXmlDocument doc)
        {
            PastedSnipRects = pastedSnipRects;
            Doc             = doc;
            NewSnipData     = newData;
            dPanel          = tdPanel;
            foreach (Rect rect in PastedSnipRects)
            {
                OldSnipDatas[rect] = rect.SnipData;
            }

            CommandInfo = "粘贴页面片数据";
        }
Exemplo n.º 4
0
        /// <summary>
        /// 粘贴菜单执行函数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void pasteSnipData_Click(object sender, EventArgs e)
        {
            foreach (Rect rect in ListRect.GetSelectedRects())
            {
                if (rect.IsLocked || rect.HasSnip)
                {
                    MessageService.Show("${res:tmpltDesign.tmpltDrawPanel.message.hasLockedRect}");
                    return;
                }
            }
            PasteSnipDataCommand pasteCommand = new PasteSnipDataCommand(this.TDPanel,
                                                                         ListRect.GetSelectedRects(),
                                                                         SnipData.GetFromClipboard(), TmpltDoc);

            pasteCommand.Execute();
            this.TDPanel.CommandList.AddCommand(pasteCommand);
        }
Exemplo n.º 5
0
 /// <summary>
 /// 复制页面片数据
 /// </summary>
 internal void CopyToClipboard()
 {
     SnipData.CopyToClipboard();
 }
Exemplo n.º 6
0
 public SnipData(SnipData snipData)
 {
     SnipElementText = snipData.SnipElementText;
 }