예제 #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));
        }
예제 #2
0
 public static void RegisterKnownServiceType(Type type, Type service)
 {
     LocalServicesConfiguration.RegisterKnownServiceType(new KnownServiceTypeEntry(type, service));
 }
예제 #3
0
 public static void Configure(string fileName)
 {
     LocalServicesConfiguration.Configure(fileName);
 }
예제 #4
0
 /// <summary>
 /// Will load the settings from an embedded configuration file "LocalServices.config"
 /// </summary>
 public static void Configure()
 {
     LocalServicesConfiguration.Configure();
 }