예제 #1
0
        /// <summary>
        /// Creates a new instance of a logging provider
        /// </summary>
        /// <param name="Provider">The provider from which to create an instance.</param>
        /// <param name="Name">The name of the instance to create.</param>
        public ProviderInstance(ProviderV2 Provider, string Name)
        {
            this.Name     = Name;
            this.Provider = Provider;

            ImportConfig();
            ProviderHost.InitializeProviderInstance(this);
        }
예제 #2
0
        /// <summary>
        /// Returns all enabled and initialized provider instances
        /// </summary>
        /// <param name="IncludeDisabled">Whether disabled instances should also be returned</param>
        /// <returns>All enabled and initialized provider instances</returns>
        public static List <ProviderInstance> GetInitializedInstances(bool IncludeDisabled = false)
        {
            List <ProviderInstance> results = new List <ProviderInstance>();

            foreach (Provider prov in Providers.Values)
            {
                if ((prov as ProviderV2) == null)
                {
                    continue;
                }

                ProviderV2 prov2 = (ProviderV2)prov;
                foreach (ProviderInstance inst in prov2.Instances.Values.Where(o => (o.Enabled || IncludeDisabled) && o.Initialized))
                {
                    results.Add(inst);
                }
            }

            return(results);
        }
예제 #3
0
        /// <summary>
        /// Returns all enabled provider instances
        /// </summary>
        /// <returns>All enabled provider instances</returns>
        public static List <ProviderInstance> GetEnabledInstances()
        {
            List <ProviderInstance> results = new List <ProviderInstance>();

            foreach (Provider prov in Providers.Values)
            {
                if ((prov as ProviderV2) == null)
                {
                    continue;
                }

                ProviderV2 prov2 = (ProviderV2)prov;
                foreach (ProviderInstance inst in prov2.Instances.Values.Where(o => o.Enabled))
                {
                    results.Add(inst);
                }
            }

            return(results);
        }