예제 #1
0
        /// <summary>
        /// Initializes controller with active instance and custom channel view factory.
        /// </summary>
        /// <param name="view"></param>
        /// <param name="instance"></param>
        /// <param name="logger"></param>
        /// <param name="detailFactory"></param>
        public DefaultInstanceController(IInstanceView view, IInstance instance, InstanceLogger logger, IChannelViewFactory detailFactory)
        {
            this.view     = view;
            this.instance = instance;
            view.SetInstance(instance);

            if (this.instance is IClient)
            {
                ((IClient)this.instance).ChannelCreated += handleConnectionCreated;
            }
            else if (this.instance is IServer)
            {
                ((IServer)this.instance).ChannelCreated += handleConnectionCreated;
            }
            else if (this.instance is IProxy)
            {
                ((IProxy)this.instance).ChannelCreated += handleConnectionCreated;
            }

            this.logger = logger;
            this.view.SetLogger(logger);
            this.detailFactory = detailFactory;
            this.Active        = true;
            this.instanceName  = logger.ReadInstanceName();
        }
예제 #2
0
 /// <summary>
 /// Initializes controller with logged instance and custom channel view factory.
 /// </summary>
 /// <param name="view"></param>
 /// <param name="logger"></param>
 /// <param name="detailFactory"></param>
 public DefaultInstanceController(IInstanceView view, InstanceLogger logger, IChannelViewFactory detailFactory)
 {
     this.view = view;
     instance  = logger.ReadInstanceData();
     view.SetInstance(instance);
     view.SetLogger(logger);
     this.logger        = logger;
     this.detailFactory = detailFactory;
     this.Active        = false;
     this.instanceName  = logger.ReadInstanceName();
 }