Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        public void Unregister()
        {
            foreach (PluginParentItem plugin in _parentPlugins)
            {
                if (String.IsNullOrEmpty(plugin.MatchingName))
                {
                    continue;
                }

                using (HelpRegistrar register = new HelpRegistrar())
                {
                    foreach (PluginChildItem child in plugin)
                    {
                        if (String.IsNullOrEmpty(child.MatchingName))
                        {
                            continue;
                        }

                        OnRegisterOrRemovePlugin(new PluginEventArgs(
                                                     plugin.MatchingName, child.MatchingName, false));
                        register.RemovePlugin(plugin.MatchingName, child.MatchingName);
                    }

                    if (plugin.Merge)
                    {
                        OnNamespaceMerge(new MergingEventArgs(plugin.MatchingName));
                        MergeNamespace.CallMerge(plugin.MatchingName);
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        public void Unregister()
        {
            foreach (NamespaceItem helpNamespace in _helpNamespaces)
            {
                if (String.IsNullOrEmpty(helpNamespace.Name))
                {
                    continue;
                }

                using (HelpRegistrar register = new HelpRegistrar())
                {
                    // remove this Help 2.0 namespace, if it is a plug-in
                    foreach (string connectedNamespace in helpNamespace.ConnectedNamespaces)
                    {
                        OnRegisterOrRemovePlugin(new PluginEventArgs(
                                                     connectedNamespace, helpNamespace.Name, false));
                        register.RemovePlugin(connectedNamespace, helpNamespace.Name);

                        OnNamespaceMerge(new MergingEventArgs(
                                             connectedNamespace));
                        MergeNamespace.CallMerge(connectedNamespace);
                    }

                    // remove this namespace's child plug-ins
                    foreach (PluginChildItem plugin in helpNamespace.Plugins)
                    {
                        OnLogProgress(new LoggingEventArgs(plugin.ToString()));
                        OnRegisterOrRemovePlugin(new PluginEventArgs(
                                                     helpNamespace.Name, plugin.MatchingName, false));
                        register.RemovePlugin(helpNamespace.Name,
                                              plugin.MatchingName);
                    }

                    // remove this namespace's filters
                    foreach (FilterItem filter in helpNamespace.Filters)
                    {
                        OnLogProgress(new LoggingEventArgs(filter.ToString()));
                        OnRegisterOrRemoveFilter(new NamespaceEventArgs(
                                                     filter.Name, false));
                        register.RemoveFilter(helpNamespace.Name, filter.Name);
                    }

                    // remove this namespace's documents
                    foreach (DocumentItem document in helpNamespace.Documents)
                    {
                        OnLogProgress(new LoggingEventArgs(document.ToString()));

                        OnRegisterOrRemoveHelpDocument(new NamespaceEventArgs(
                                                           document.Id, false));

                        register.RemoveHelpFile(helpNamespace.Name,
                                                document.Id, document.LanguageId);
                    }

                    // remove this namespace, ...
                    if (helpNamespace.Remove)
                    {
                        OnRegisterOrRemoveNamespace(new NamespaceEventArgs(
                                                        helpNamespace.Name, false));
                        register.RemoveNamespace(helpNamespace.Name);
                    }
                    // ... or just (re)merge it
                    else
                    {
                        OnNamespaceMerge(new MergingEventArgs(
                                             helpNamespace.Name));
                        MergeNamespace.CallMerge(helpNamespace.Name);
                    }
                }
            }
        }