示例#1
0
        // REVIEW: need review. switch to notify changed schema
        public void PropagateVersionToUsages(IProjectReference projectReference)
        {
            bool usageUpdated = false;

            if (HasProjectAsParent(projectReference, false))
            {
                if (_project.Parent.Version != projectReference.Version)
                {
                    _project.Parent.Version = projectReference.Version;
                    usageUpdated            = true;
                }
            }

            foreach (var dependency in AllDependencies.Where(d => d.ReferenceOperations().ReferenceEqualTo(projectReference, false)))
            {
                if (dependency.Version.IsDefined && dependency.Version != projectReference.Version)
                {
                    dependency.Version = projectReference.Version;
                    usageUpdated       = true;
                }
            }

            foreach (var plugin in AllPlugins.Where(d => d.ReferenceOperations().ReferenceEqualTo(projectReference, false)))
            {
                if (plugin.Version.IsDefined && plugin.Version != projectReference.Version)
                {
                    plugin.Version = projectReference.Version;
                    usageUpdated   = true;
                }
            }

            // TODO: Changed = usageUpdated;
        }
示例#2
0
        private void CategorizePlugins(IEnumerable <IPlugin> plugins)
        {
            AllPlugins = plugins.ToArray();

            HostPlugin  = AllPlugins.FirstOrDefault(p => p.PluginType == PluginTypes.HostPlugin);
            AppPlugins  = AllPlugins.Where(p => p.PluginType == PluginTypes.ApplicationPlugin).ToArray();
            CorePlugins = AllPlugins.Where(p => p.PluginType == PluginTypes.CorePlugin).ToArray();

            LogPlugins(AllPlugins);
        }
示例#3
0
        /// <summary>
        /// Returns types associated with a specific category of plug-in.
        /// </summary>
        /// <param name="pluginTypes">The category of plug-ins to limit the return types.</param>
        /// <returns>List of limited plug in types or all plug-in types if no category is specified.</returns>
        public IEnumerable <Type> GetPluginTypes(params PluginTypes[] pluginTypes)
        {
            if (pluginTypes == null)
            {
                throw new ArgumentNullException(nameof(pluginTypes),
                                                "List of Plug-in types cannot be null.");
            }

            return(pluginTypes.Length == 0 ? AllPlugins.SelectMany(p => p.Types)
                : AllPlugins.Where(p => pluginTypes.Contains(p.PluginType)).SelectMany(p => p.Types));
        }
示例#4
0
 public static IEnumerable <PluginPair> GetPluginsForInterface <T>()
 {
     return(AllPlugins.Where(p => p.Plugin is T));
 }