Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VSPackage"/> class.
 /// </summary>
 public VSPackage()
 {
     // Inside this method you can place any initialization code that does not require
     // any Visual Studio service because at this point the package object is created but
     // not sited yet inside Visual Studio environment. The place to do all the other
     // initialization is the Initialize method.
     Instance = this;
 }
        private void ConnectToIdle()
        {
            if (!this._connectedToIdle)
            {
                this._connectedToIdle = true;
                this._idleConnectTime = DateTime.Now;

                // make sure our package is loaded so we can use its
                // OnIdle event
                var        nodePackage = new Guid(Guids.NodejsPackageString);
                IVsPackage package;
                var        shell = (IVsShell)VSPackage.GetGlobalService(typeof(SVsShell));
                shell.LoadPackage(ref nodePackage, out package);

                VSPackage.Instance.OnIdle += this.OnIdle;
            }
        }