예제 #1
0
        public static void ConfigureServices(Omniscient.Foundation.ServiceModel.IServiceProvider container, ApplicationConfiguration config)
        {
            if (config == null) return;
            if (container == null) return;

            foreach (ServiceDefinition srvDef in config.ServicesConfiguration.ServiceDefinitions)
            {
                Type contractType = Type.GetType(srvDef.Contract, true, true);
                Type serviceType = Type.GetType(srvDef.Service, true, true);                
                IService service = (IService)Activator.CreateInstance(serviceType);
                container.RegisterService(contractType, service);

                //configure any IConfigurable service.
                if (typeof(IConfigurable).IsAssignableFrom(serviceType) && srvDef.Config != null)
                    ((IConfigurable)service).Configure(srvDef.Config);
            }

        }
예제 #2
0
 public void Activate(Omniscient.Foundation.ApplicationModel.Presentation.IPresentationController presentation)
 {
     throw new System.NotImplementedException();
 }
 public virtual void Activate(Omniscient.Foundation.ApplicationModel.Presentation.IPresentationController presentation)
 {
     IsActivated = true;
 }