Пример #1
0
        /// <summary>
        /// Method CreateAddInActivatorProcess.
        /// </summary>
        private void CreateAddInActivatorProcess()
        {
            this._canRestart = true;

            this._addInActivatorProcess               = new AddInActivatorProcess(this.FriendlyName, this.RedirectOutput, this.AddInDomainSetupInfo);
            this._addInActivatorProcess.Attached     += this.OnProcessAttached;
            this._addInActivatorProcess.Detached     += this.OnProcessDetached;
            this._addInActivatorProcess.DataReceived += this.OnDataReceived;
        }
Пример #2
0
        public void Unload()
        {
            this._canRestart = false;

            if (Interlocked.CompareExchange(ref this._unloaded, 1, 0) == 1)
            {
                return;
            }

            if (this._addInActivatorProcess != null)
            {
                this._addInActivatorProcess.Attached     -= this.OnProcessAttached;
                this._addInActivatorProcess.Detached     -= this.OnProcessDetached;
                this._addInActivatorProcess.DataReceived -= this.OnDataReceived;
                this._addInActivatorProcess.Dispose();
                this._addInActivatorProcess = null;
            }
        }