示例#1
0
        public void StartModule(LayoutFarm.SampleViewport sampleViewport)
        {
            this.viewport = sampleViewport;
            dzBoardModule = new DesignBoardModule();

            menuModule = new MenuBoardModule();
            menuModule.menuItemClick += new EventHandler <MenuItemClickEventArgs>(menuModule_menuItemClick);


            var contentMx = new LayoutFarm.ContentManagers.ImageContentManager();

            contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;
            //app specific here
            documentRootPath = System.Windows.Forms.Application.ExecutablePath;

            this.htmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
                                                                 (s, e) => contentMx.AddRequestImage(e.ImageBinder),
                                                                 contentMx_LoadStyleSheet);

            //1. design board
            dzBoardModule.StartModule(htmlHost, this.viewport);
            ////2. canvas board
            //drawingBoard.StartModule(htmlHost, this.viewport);
            //3. menu
            menuModule.StartModule(htmlHost, this.viewport);

            //------------------------------------------------------
            //context knowledge***
            //------------------------------------------------------
        }
 public override void InvokeRedo(DesignBoardModule dzBoard)
 {
     int j = dzBoxList.Count;
     for (int i = 0; i < j; ++i)
     {
         dzBoxList[i].InvokeRedo(dzBoard);
     }
 }
        public override void InvokeRedo(DesignBoardModule dzBoard)
        {
            int j = dzBoxList.Count;

            for (int i = 0; i < j; ++i)
            {
                dzBoxList[i].InvokeRedo(dzBoard);
            }
        }
示例#4
0
        public void DrawContents(DesignBoardModule dzBoard)
        {
            //write content to the viewport
            var rootdoc = xmldoc.DocumentElement;

            foreach (var childnode in rootdoc.ChildNodes)
            {
                var elemNode = childnode as XmlElement;
                if (elemNode == null)
                {
                    continue;
                }
                //create element
                int left, top, width, height;
                switch (elemNode.Name)
                {
                case "rectbox":
                {
                    //create rect box and add to viewport
                    GetDimensionAttr(elemNode, out left, out top, out width, out height);
                    dzBoard.AddNewBox(left, top, width, height);
                }
                break;

                case "shapebox":
                {
                    GetDimensionAttr(elemNode, out left, out top, out width, out height);
                    dzBoard.AddNewRect(left, top, width, height);
                }
                break;

                case "textbox":
                {
                }
                break;

                default:
                {
                }
                break;
                }
            }
        }
示例#5
0
 public void DrawContents(DesignBoardModule dzBoard)
 {
     //write content to the viewport
     var rootdoc = xmldoc.DocumentElement;
     foreach (var childnode in rootdoc.ChildNodes)
     {
         var elemNode = childnode as XmlElement;
         if (elemNode == null)
         {
             continue;
         }
         //create element
         int left, top, width, height;
         switch (elemNode.Name)
         {
             case "rectbox":
                 {
                     //create rect box and add to viewport
                     GetDimensionAttr(elemNode, out left, out top, out width, out height);
                     dzBoard.AddNewBox(left, top, width, height);
                 }
                 break;
             case "shapebox":
                 {
                     GetDimensionAttr(elemNode, out left, out top, out width, out height);
                     dzBoard.AddNewRect(left, top, width, height);
                 }
                 break;
             case "textbox":
                 {
                 }
                 break;
             default:
                 {
                 }
                 break;
         }
     }
 }
示例#6
0
 public void StartModule(LayoutFarm.SampleViewport sampleViewport)
 {
     this.viewport = sampleViewport;
     dzBoardModule = new DesignBoardModule();
     menuModule = new MenuBoardModule();
     menuModule.menuItemClick += new EventHandler<MenuItemClickEventArgs>(menuModule_menuItemClick);
     var contentMx = new LayoutFarm.ContentManagers.ImageContentManager();
     contentMx.ImageLoadingRequest += contentMx_ImageLoadingRequest;
     //app specific here
     documentRootPath = System.Windows.Forms.Application.ExecutablePath;
     this.htmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
         (s, e) => contentMx.AddRequestImage(e.ImageBinder),
         contentMx_LoadStyleSheet);
     //1. design board
     dzBoardModule.StartModule(htmlHost, this.viewport);
     ////2. canvas board
     //drawingBoard.StartModule(htmlHost, this.viewport);
     //3. menu
     menuModule.StartModule(htmlHost, this.viewport);
     //------------------------------------------------------
     //context knowledge*** 
     //------------------------------------------------------
 }
 public override void InvokeRedo(DesignBoardModule dzBoard)
 {
     this.dzBox.SetBounds(newBounds.Left, newBounds.Top, newBounds.Width, newBounds.Height);
 }
 public override void InvokeUndo(DesignBoardModule dzBoard)
 {
     //move to old point
     this.dzBox.SetBounds(oldBounds.Left, oldBounds.Top, oldBounds.Width, oldBounds.Height);
 }
 public override void InvokeRedo(DesignBoardModule dzBoard)
 {
     //move to new point
     this.dzBox.SetLocation(newPoint.X, newPoint.Y);
 }
示例#10
0
 public override void InvokeUndo(DesignBoardModule dzBoard)
 {
     //move to old point
     this.dzBox.SetLocation(oldPoint.X, oldPoint.Y);
 }
示例#11
0
 public abstract void InvokeRedo(DesignBoardModule dzBoard);
示例#12
0
 public override void InvokeUndo(DesignBoardModule dzBoard)
 {
     //move to old point
     this.dzBox.SetLocation(oldPoint.X, oldPoint.Y);
 }
示例#13
0
 public DzCommandCollection(DesignBoardModule module)
 {
     this.boardModule = module;
 }
示例#14
0
 public override void InvokeRedo(DesignBoardModule dzBoard)
 {
     this.dzBox.SetBounds(newBounds.Left, newBounds.Top, newBounds.Width, newBounds.Height);
 }
示例#15
0
 public override void InvokeUndo(DesignBoardModule dzBoard)
 {
     //move to old point
     this.dzBox.SetBounds(oldBounds.Left, oldBounds.Top, oldBounds.Width, oldBounds.Height);
 }
示例#16
0
 public override void InvokeRedo(DesignBoardModule dzBoard)
 {
     //move to new point
     this.dzBox.SetLocation(newPoint.X, newPoint.Y);
 }
示例#17
0
 public DzCommandCollection(DesignBoardModule module)
 {
     this.boardModule = module;
 }
示例#18
0
 public abstract void InvokeRedo(DesignBoardModule dzBoard);