コード例 #1
0
            /// <summary>
            ///     We override VsWindowPane's version of this so we can hand our site
            ///     back to the designer host.  This is necessary so we can get the
            ///     right service routing.
            /// </summary>
            protected override void OnServicesAvailable()
            {
                // get our site
                object site = null;
                Guid   g    = typeof(NativeMethods.IOleServiceProvider).GUID;

                site = this.GetSite(ref g);
                if (site != null)
                {
                    NativeMethods.IObjectWithSite ows = (NativeMethods.IObjectWithSite)host.GetService(typeof(NativeMethods.IObjectWithSite));
                    if (ows != null)
                    {
                        ows.SetSite(site);
                    }
                }
                else
                {
                    Debug.Fail("Failed to get site for DesignerHost");
                }

                // Signal our perf driver that this event is complete.  This signals that the
                // designer has been created and shown.
                //
                DesignerPackage.SignalPerformanceEvent();
            }
コード例 #2
0
        // so we can control recreates, etc
        internal Control GetOuterWindow()
        {
            if (holderWindow == null)
            {
                holderWindow = new HolderWindow(this, GetWindow());

                Font       font  = null;
                IUIService uisvc = (IUIService)GetService(typeof(IUIService));
                if (uisvc != null)
                {
                    font = (Font)uisvc.Styles["DialogFont"];
                }
                else
                {
                    IUIHostLocale locale = (IUIHostLocale)GetService(typeof(IUIHostLocale));
                    if (locale != null)
                    {
                        font = DesignerPackage.GetFontFromShell(locale);
                    }
                }
                holderWindow.Font = (font == null ? Control.DefaultFont : font);
            }
            return(holderWindow);
        }
コード例 #3
0
  public ProjectManager(DesignerPackage package)
     : base()
 {
     this.package = package;
 }
コード例 #4
0
 public Factory(DesignerPackage package)
     : base()
 {
     this.package = package;
 }