Exemple #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));
        }
Exemple #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));
        }
Exemple #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());
            }
        }
Exemple #4
0
 public DesignerControler(ControlerSurface hostSurface)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
     InitializeHost(hostSurface);
 }