示例#1
0
        //
        // Constructors
        //

        public MainWindow( )
        {
            InitializeComponent( );

            foreach (var network in _configuration.Networks)
            {
                var networkWrapper = new NetworkWrapper(network);
                networkWrapper.ConnectFailed    += NetworkWrapper_ConnectFailed;
                networkWrapper.ConnectStarted   += NetworkWrapper_ConnectStarted;
                networkWrapper.ConnectSucceeded += NetworkWrapper_ConnectSucceeded;
                networkWrapper.ServerChange     += NetworkWrapper_ServerChange;
                _networks.Add(network.RefId, networkWrapper);
                foreach (var serverWrapper in networkWrapper.Servers)
                {
                    serverWrapper.ConnectFailed    += ServerWrapper_ConnectFailed;
                    serverWrapper.ConnectStarted   += ServerWrapper_ConnectStarted;
                    serverWrapper.ConnectSucceeded += ServerWrapper_ConnectSucceeded;
                    _servers.Add(serverWrapper.RefId, serverWrapper);
                }
            }

            RestoreWindowState( );

            _commandProcessor = new CommandProcessor( );
            _inputProcessor   = new InputProcessor {
                CommandProcessor = _commandProcessor
            };
        }
        //
        // Constructors
        //

        public MainWindow( ) {
            InitializeComponent( );

            foreach ( var network in _configuration.Networks ) {
                var networkWrapper = new NetworkWrapper( network );
                networkWrapper.ConnectFailed    += NetworkWrapper_ConnectFailed;
                networkWrapper.ConnectStarted   += NetworkWrapper_ConnectStarted;
                networkWrapper.ConnectSucceeded += NetworkWrapper_ConnectSucceeded;
                networkWrapper.ServerChange     += NetworkWrapper_ServerChange;
                _networks.Add( network.RefId, networkWrapper );
                foreach ( var serverWrapper in networkWrapper.Servers ) {
                    serverWrapper.ConnectFailed    += ServerWrapper_ConnectFailed;
                    serverWrapper.ConnectStarted   += ServerWrapper_ConnectStarted;
                    serverWrapper.ConnectSucceeded += ServerWrapper_ConnectSucceeded;
                    _servers.Add( serverWrapper.RefId, serverWrapper );
                }
            }

            RestoreWindowState( );

            _commandProcessor = new CommandProcessor( );
            _inputProcessor = new InputProcessor {
                CommandProcessor = _commandProcessor
            };
        }
        //
        // Constructors
        //

        public MainWindow( )
        {
            InitializeComponent( );

            _app           = (App)Application.Current;
            _configuration = _app.ConfigurationManager.Configuration;
            foreach (var network in _configuration.Networks)
            {
                var networkWrapper = new NetworkWrapper(network);
                networkWrapper.ConnectFailed    += NetworkWrapper_ConnectFailed;
                networkWrapper.ConnectStarted   += NetworkWrapper_ConnectStarted;
                networkWrapper.ConnectSucceeded += NetworkWrapper_ConnectSucceeded;
                networkWrapper.ServerChange     += NetworkWrapper_ServerChange;
                _networks.Add(network.RefId, networkWrapper);
                foreach (var serverWrapper in networkWrapper.Servers)
                {
                    _servers.Add(serverWrapper.RefId, serverWrapper);
                }
            }

            RestoreWindowState( );

            InputProcessor = new InputProcessor {
                CommandProcessor = (CommandProcessor = new CommandProcessor( ))
            };
        }
        //
        // Constructors
        //
        public MainWindow( )
        {
            InitializeComponent( );

            _app = (App) Application.Current;
            _configuration = _app.ConfigurationManager.Configuration;
            foreach ( var network in _configuration.Networks ) {
                var networkWrapper = new NetworkWrapper( network );
                networkWrapper.ConnectFailed += NetworkWrapper_ConnectFailed;
                networkWrapper.ConnectStarted += NetworkWrapper_ConnectStarted;
                networkWrapper.ConnectSucceeded += NetworkWrapper_ConnectSucceeded;
                networkWrapper.ServerChange += NetworkWrapper_ServerChange;
                _networks.Add( network.RefId, networkWrapper );
                foreach ( var serverWrapper in networkWrapper.Servers ) {
                    _servers.Add( serverWrapper.RefId, serverWrapper );
                }
            }

            RestoreWindowState( );

            InputProcessor = new InputProcessor {
                CommandProcessor = ( CommandProcessor = new CommandProcessor( ) )
            };
        }