public void Initialize()
 {
     _context.Register(builder =>
     {
         builder.RegisterType <ServerSocket>().As <ICommandServer>().SingleInstance();
     });
 }
 public void Initialize()
 {
     _context.Register(builder =>
     {
         builder.RegisterType <RtClientService>().As <IRtClientService>().SingleInstance();
     });
 }
        private static void ExtractAllComponents(Assembly assembly, IComponentContext context)
        {
            Type[] types;

            try
            {
                types = assembly.GetTypes();
            }
            catch (ReflectionTypeLoadException rtle)
            {
                var message = "Could not load types of assembly '" + assembly.FullName + "', with the following messages: \n";

                message = rtle.LoaderExceptions.Aggregate(message, (current, exception) => current + (exception.Message + "\n"));

                throw new CompositionException(message);
            }

            var candidateTypes = types
                                 .Where(ComponentContextUtils.HasComponentAttribute)
                                 .Where(componentType => !ComponentContextUtils.HasIgnoredOnAssemblyRegistrationAttribute(componentType));

            foreach (var componentType in candidateTypes)
            {
                context.Register(componentType);
            }
        }
Ejemplo n.º 4
0
 public void Initialize()
 {
     _context.Register(builder =>
     {
         builder.RegisterType <MeetingService>().As <IMeetingTrigger>();
         builder.RegisterType <LocalPushLiveService>().Named <IPushLive>(GlobalResources.LocalPushLive).SingleInstance();
         builder.RegisterType <ServerPushLiveService>().Named <IPushLive>(GlobalResources.RemotePushLive).SingleInstance();
         builder.RegisterType <LocalRecordService>().As <IRecord>().SingleInstance();
     });
 }
Ejemplo n.º 5
0
 public void Initialize()
 {
     _context.Register(builder =>
     {
         builder.RegisterType <BmsService>().As <IBms>().SingleInstance();
         builder.RegisterType <MeetingService>().As <IMeeting>().SingleInstance();
         builder.RegisterType <ViewLayoutService>().As <IViewLayout>().SingleInstance();
         builder.RegisterType <GroupManager>().As <IGroupManager>().SingleInstance();
     });
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Initialize the framework context in preparation for usage. This method must be called before the framework can be used.
        /// </summary>
        public void Initialize()
        {
            if (disposed)
            {
                throw new ObjectDisposedException("this");
            }

            if (initialized)
            {
                throw new InvalidOperationException("Cannot initialize the framework more than once");
            }

            initialized = true;

            componentContext.Register <IComponentContext>(componentContext);
            componentContext.Register <IConfigurationContext>(configurationContext);
            componentContext.Register <IFrameworkContext>(this);
            componentContext.Register <ITaskContext>(taskContext);

            configurationContext.Initialize();
            componentContext.Initialize();
            taskContext.Initialize();
        }