예제 #1
0
        /// <summary>
        /// Adds all pipeline plugins to the given list, in display order if possible.
        /// </summary>
        /// <param name="plugins">List where to add plugins</param>
        /// <param name="settings"><see cref="UserSettings"/> used to fetch
        /// pipeline plugins.</param>
        /// <param name="pipelinePluginsOptions">What kind of pipeline plugins
        /// to add to the list.</param>
        private static void GetPipelinePlugins(List <Plugin> plugins, UserSettings settings,
                                               PipelinePluginsOptions pipelinePluginsOptions)
        {
            Debug.Assert(plugins != null);
            Debug.Assert(settings != null);

            List <PipelinePluginInfo> pluginInfos = new List <PipelinePluginInfo>();

            if ((pipelinePluginsOptions & PipelinePluginsOptions.FetchPipelinePlugins) != 0)
            {
                pluginInfos.AddRange(settings.PipelinePlugins);
            }
            if ((pipelinePluginsOptions & PipelinePluginsOptions.FetchTempPipelinePlugins) != 0)
            {
                // Temp pipeline plugins can actually override existing pipeline plugins.
                // This mimics the code in PathCopyCopyPluginsRegistry.cpp in the C++ project.
                pluginInfos = settings.TempPipelinePlugins.Union(pluginInfos).ToList();
            }
            if (pluginInfos.Count > 0)
            {
                if (plugins.Count > 0)
                {
                    plugins.Add(new SeparatorPlugin());
                }
                plugins.AddRange(PipelinePluginInfo.ToPlugins(pluginInfos));
            }
        }
예제 #2
0
        /// <summary>
        /// Adds all pipeline plugins to the given list, in display order if possible.
        /// </summary>
        /// <param name="plugins">List where to add plugins</param>
        /// <param name="settings"><see cref="UserSettings"/> used to fetch
        /// pipeline plugins.</param>
        private static void GetPipelinePlugins(List <Plugin> plugins, UserSettings settings)
        {
            Debug.Assert(plugins != null);
            Debug.Assert(plugins != null);

            List <PipelinePluginInfo> pluginInfos = settings.PipelinePlugins;

            if (pluginInfos.Count > 0)
            {
                if (plugins.Count > 0)
                {
                    plugins.Add(new SeparatorPlugin());
                }
                plugins.AddRange(PipelinePluginInfo.ToPlugins(pluginInfos));
            }
        }