Exemplo n.º 1
0
        public DesignerControler GetNewHost(Type rootComponentType)
        {
            ControlerSurface hostSurface = (ControlerSurface)this.CreateDesignSurface(this.ServiceContainer);
            IDesignerHost    host        = (IDesignerHost)hostSurface.GetService(typeof(IDesignerHost));

            BasicDesignerViewer basicHostLoader = new BasicDesignerViewer(rootComponentType);

            hostSurface.BeginLoad(basicHostLoader);
            hostSurface.Loader = basicHostLoader;
            return(new DesignerControler(hostSurface));
        }
Exemplo n.º 2
0
        public DesignerControler GetNewHost(string fileName)
        {
            if (fileName == null || !File.Exists(fileName))
            {
                MessageBox.Show("FileName is incorrect: " + fileName);
            }
            ControlerSurface hostSurface = (ControlerSurface)this.CreateDesignSurface(this.ServiceContainer);
            IDesignerHost    host        = (IDesignerHost)hostSurface.GetService(typeof(IDesignerHost));

            BasicDesignerViewer basicHostLoader = new BasicDesignerViewer(fileName);

            hostSurface.BeginLoad(basicHostLoader);
            hostSurface.Loader = basicHostLoader;
            hostSurface.Initialize();
            return(new DesignerControler(hostSurface));
        }
Exemplo n.º 3
0
        internal void InitializeHost(ControlerSurface hostSurface)
        {
            try
            {
                if (hostSurface == null)
                {
                    return;
                }

                _hostSurface = hostSurface;

                Control control = _hostSurface.View as Control;

                control.Parent  = this;
                control.Dock    = DockStyle.Fill;
                control.Visible = true;
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex.ToString());
            }
        }
Exemplo n.º 4
0
 public DesignerControler(ControlerSurface hostSurface)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
     InitializeHost(hostSurface);
 }