/// <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();
        }