Exemple #1
0
        public static T CreateInstance <T>()
        {
            KnownServiceTypeEntry knownServiceTypeEntry = LocalServicesConfiguration.IsKnownServiceType(typeof(T));

            if (knownServiceTypeEntry == null)
            {
                throw new LocalServicesException(String.Format("Unknown service {0}", typeof(T).FullName));
            }
            return((T)Activator.CreateInstance(knownServiceTypeEntry.Service));
        }
Exemple #2
0
 public static void RegisterKnownServiceType(Type type, Type service)
 {
     LocalServicesConfiguration.RegisterKnownServiceType(new KnownServiceTypeEntry(type, service));
 }
Exemple #3
0
 public static void Configure(string fileName)
 {
     LocalServicesConfiguration.Configure(fileName);
 }
Exemple #4
0
 /// <summary>
 /// Will load the settings from an embedded configuration file "LocalServices.config"
 /// </summary>
 public static void Configure()
 {
     LocalServicesConfiguration.Configure();
 }