private void CustomInitialize() { //on pourra choisir sur quelle forme ajouter en modifiant avec un textbox _hostSurfaceManager = new Host.HostSurfaceManager(); _hostSurfaceManager.AddService(typeof(IToolboxService), Home.m_toolbox.toolbox1); _hostSurfaceManager.AddService(typeof(PropertyGrid), Home.m_propertyWindow.propertyGrid); //MenuCommandService = new Host.MenuCommandServiceImpl(_hostSurfaceManager); //HostC.DesignerHost.AddService(typeof(System.ComponentModel.Design.MenuCommandService), MenuCommandService); // _hostSurfaceManager.AddService(typeof(System.ComponentModel.Design.UndoEngine), undoEngine); }
public void Open_Host(string filepath) { try { // Create Form _hostSurfaceManager = new Host.HostSurfaceManager(); HostC = _hostSurfaceManager.GetNewHost(filepath); //Toolbox.DesignerHost = hc.DesignerHost; metroFichierXml.Text = Home.fileName; // metroButton2.Visible = false; HostC.Parent = _Panel1; HostC.Dock = DockStyle.Fill; _hostSurfaceManager.AddService(typeof(IToolboxService), Home.m_toolbox.toolbox1); _hostSurfaceManager.AddService(typeof(PropertyGrid), Home.m_propertyWindow.propertyGrid); } catch { MessageBox.Show("Error in opening new host", "OSMaker IUG Conceptor", MessageBoxButtons.OK, MessageBoxIcon.Error); } }