Ejemplo n.º 1
0
        internal RuntimeHostControl(RuntimeHostSurface hostSurface)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
            InitializeHost(hostSurface);

            messageFilter = new RTDesignerMessageFilter((DesignerActionUIService)hostSurface.GetService(typeof(DesignerActionUIService)),
                                                        (ISelectionService)(hostSurface.GetService(typeof(ISelectionService))));
            Application.AddMessageFilter(messageFilter);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ResetMenuItem_Click(object sender, EventArgs e)
        {
            IDesignerHost       host        = (IDesignerHost)surface.GetService(typeof(IDesignerHost));
            DesignerTransaction transaction = host.CreateTransaction("Reset Menu Item Clicked");

            propertyGrid.ResetSelectedProperty();

            transaction.Commit();
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="orgString"></param>
        /// <returns></returns>
        internal static String GetTranslatedString(RuntimeHostSurface runtimeHostSurface, String orgString)
        {
            String     retString = orgString;
            ITranslate host      = (ITranslate)runtimeHostSurface.GetService(typeof(ITranslate));

            if (host != null)
            {
                retString = host.GetTranslateString(orgString);
            }

            return(retString);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets a new HostSurface and loads it with the appropriate type of
        /// root component. Uses the appropriate Loader to load the HostSurface.
        /// </summary>
        internal RuntimeHostControl GetNewHost(Form form, CreateAllOwnerDrawControlsDelegate createAllOwnerDrawControls,
                                               GetControlDesignerInfoDelegate getControlDesignerInfo, bool adminMode, ITranslate translate)
        {
            this.translate = translate;
            RuntimeHostSurface hostSurface     = (RuntimeHostSurface)this.CreateDesignSurface(this.ServiceContainer);
            IDesignerHost      host            = (IDesignerHost)hostSurface.GetService(typeof(IDesignerHost));
            RuntimeHostLoader  basicHostLoader = new RuntimeHostLoader(typeof(Form), form, createAllOwnerDrawControls, getControlDesignerInfo,
                                                                       hostSurface);

            hostSurface.AdminMode = adminMode;
            hostSurface.BeginLoad(basicHostLoader);
            hostSurface.Loader = basicHostLoader;
            hostSurface.Initialize();
            this.ActiveDesignSurface = hostSurface;
            return(new RuntimeHostControl(hostSurface));
        }