Ejemplo n.º 1
0
        /// <summary>
        /// Creates a shell logger.
        /// </summary>
        /// <param name="shellPackage">The shell package.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="shellPackage"/> is null.</exception>
        public ShellLogger(ShellPackage shellPackage)
        {
            if (shellPackage == null)
                throw new ArgumentNullException("shellPackage");

            this.shellPackage = shellPackage;
        }
Ejemplo n.º 2
0
 public static ShellHolder Initialize(ShellPackage shellPackage, ShellAddInHandler shellAddInHandler)
 {
     DefaultShell shell = ShellAccessor.Instance;
     shell.Initialize(shellPackage, shellAddInHandler);
     return new ShellHolder(shell);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Called when the Shell package has been disposed.
        /// </summary>
        public void PackageDisposed()
        {
            ShellLock.WithWriterLock(() =>
            {
                package = null;

                UpdateShellActivationWithWriterLockHeld();
            });
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Called when the Shell package has been initialized.
        /// </summary>
        /// <param name="package">The shell package</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="package"/> is null.</exception>
        /// <exception cref="InvalidOperationException">Thrown if a different <paramref name="package"/> has already reported being initialized.</exception>
        public void PackageInitialized(ShellPackage package)
        {
            if (package == null)
                throw new ArgumentNullException("package");

            ShellLock.WithWriterLock(() =>
            {
                if (this.package != null)
                {
                    if (this.package == package)
                        return;

                    throw new InvalidOperationException(
                        "Multiple packages appear to be attempting to activate the shell.");
                }

                this.package = package;

                UpdateShellActivationWithWriterLockHeld();
            });
        }