Пример #1
0
        private void ActivateAllExtensions()
        {
            foreach (var extension in SatisfyImportsExtensions.OrderBy(_ => _.Priority))
            {
                extension.Activate();
            }

            if (!EnsureRequiredImportsAreAvailable())
            {
                return;
            }
            OnSatisfyImportsExtensionsActivated(EventArgs.Empty);

            // Load "Application Extensions" first. We do this to temporarily deal with the situation where specific root menu items
            // need to be created before other plugins are loaded.
            foreach (var extension in Extensions.Where(_ => !_.DeactivationAllowed).OrderBy(_ => _.Priority))
            {
                Activate(extension);
            }

            // Activate remaining extensions
            foreach (var extension in Extensions.Where(_ => _.DeactivationAllowed).OrderBy(_ => _.Priority))
            {
                Activate(extension);
            }
        }
Пример #2
0
        private void ActivateAllExtensions()
        {
            if (Extensions != null && Extensions.Any())
            {
                foreach (ISatisfyImportsExtension extension in SatisfyImportsExtensions.OrderBy(t => t.Priority))
                {
                    extension.Activate();
                }
                if (!EnsureRequiredImportsAreAvailable())
                {
                    return;
                }
                else
                {
                    OnSatisfyImportsExtensionsActivated(EventArgs.Empty);
                }

                // Load "Application Extensions" first. We do this to temporarily deal with the situation where specific root menu items
                // need to be created before other plugins are loaded.
                foreach (IExtension extension in Extensions.Where(t => t.DeactivationAllowed == false))
                {
                    Activate(extension);
                }

                foreach (IExtension extension in Extensions.Where(t => t.DeactivationAllowed))
                {
                    Activate(extension);
                }
            }
        }