public SEDesignSurface NewDesignSurface() { SEDesignSurface designSurface = (SEDesignSurface)this.CreateDesignSurface(this.ServiceContainer); this.ActiveDesignSurface = designSurface; return(designSurface); }
public FormDesignSurfaceHosting(WindowEntity windowEntity, SEDesignSurface designSurface, FormHostingContainer hostingContainer) { InitializeComponent(); if (DesignMode) { return; } this._windowEntity = windowEntity; this.Icon = DrawingTool.ImageToIcon(IconsLibrary.Form); this.SetTabText(); this.HideOnClose = false; this._undoEngine = new SEUndoEngineFormDesigner(this); this._designSurface = designSurface; this.HostingContainer = hostingContainer; this.TabPageContextMenuStrip = HostingTabPageContextMenuStrip.Instance.MenuStrip; //初始化DesignSurface //在此初始化,保证FormHostingContainer中的dockPanel_ActiveDocumentChanged执行时 //能拿到DesignSurface中的服务 this._designSurface = InitialseDesignSurface(); }