/*
         * 不同的屏幕跳转到不同的页面
         */
        private void DifferentScreenDifferentLinkTo(DControl ctl, int turnPictureImagesId)
        {
            //不同屏幕,跳转到不同的页面
            List <DControlEvent> list = dControlEventBll.getByTurnPictureImagesId(turnPictureImagesId);

            foreach (DControlEvent de in list)
            {
                DControl newDControl = DControlUtil.createFrom(ctl);
                newDControl.linkToPageId        = de.linkToPageId;
                newDControl.isTransparentDialog = de.isTransparentDialog;
                newDControl.showInWhichCFrame   = de.showInWhichCFrame;
                newDControl.isDialogLink        = de.isDialogLink;

                PageTemplate AppPageTemplate = this.getScreen(de.screenCfgId);
                if (newDControl.linkToPageId > 0 && newDControl.isDialogLink)
                {
                    AppPageTemplate.insertToPage.insertFrameDialog(newDControl);
                    //insertFrameDialog(ctl);
                }
                else if (newDControl.linkToPageId > 0)
                {
                    AppPageTemplate.insertToPage.linkToPageWithPageSwitchType(newDControl);
                    //  linkToPageWithPageSwitchType(ctl);
                }
            }
        }
Пример #2
0
        /*
         * 15 粘贴复制的控件
         */
        public void pastControlClick(object sender, RoutedEventArgs e)
        {
            if (App.localStorage.currCopiedEle != null)
            {
                DControl dControl    = (DControl)App.localStorage.currCopiedEle.Tag;
                DControl newDControl = DControlUtil.createFrom(dControl);
                newDControl.pageId   = pageTemplate.dPage.id;
                newDControl.left     = (int)rightClickLocation.X;
                newDControl.top      = (int)rightClickLocation.Y;
                newDControl.parentId = 0;

                if (dControl.type == "CFrame")
                {
                    Boolean result = dControlBll.isNestedOfCurrPageId(dControl.linkToPageId, pageTemplate.dPage.id);
                    if (result)
                    {
                        MessageBox.Show("此控件,嵌套了当前页面,不可粘贴");
                        return;
                    }
                }



                dControlBll.pasteDControl(dControl, newDControl, pageTemplate.dPage);

                //4、插入页面
                insertOneControl(newDControl);
            }
        }
        /*
         * 复制当前页面下的所有控件到新页面
         *
         * @param dPage 当前页
         *
         * @param  newDPage 新页面
         */
        public void copyToPage(DPage dPage, DPage newDPage)
        {
            List <DControl> list = getByPageId(dPage.id);

            foreach (DControl dControl in list)
            {
                //dControl.pageId = newDPage.id;
                //Int32 fromDControlId = dControl.id;
                //DControl newDControl = this.insert(dControl);
                //if (dControl.type == "TurnPicture")
                //{
                //    turnPictureImagesBll.copyFromDControlId(fromDControlId, newDControl.id);
                //}

                DControl newDControl = DControlUtil.createFrom(dControl);
                newDControl.pageId = newDPage.id;
                pasteDControl(dControl, newDControl, dPage);
            }
        }