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 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; } } }
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); }
public override void InvokeUndo(DesignBoardModule dzBoard) { //move to old point this.dzBox.SetLocation(oldPoint.X, oldPoint.Y); }
public abstract void InvokeRedo(DesignBoardModule dzBoard);
public DzCommandCollection(DesignBoardModule module) { this.boardModule = module; }