Esempio n. 1
0
        public MainWindow()
        {
            var logServerAddress = SavedValueRegistry.ReadValue("LogServerAddress", "");

            var processName = SavedValueRegistry.ReadValue("ProcessName", "SFLogViewer");

            SavedValueRegistry.SaveValue("ProcessName", processName);

            InitializeComponent();

            txtLogServerAddress.Text = logServerAddress;

            var backLog = SavedValueRegistry.ReadValue("InitialBacklog", "100");

            textBacklog.Text = backLog;

            GlobalEngine.Start("SFLogViewer", logServerAddress);

            RefreshChannelList();

            m_TickTimer          = new DispatcherTimer();
            m_TickTimer.Tick    += new EventHandler(Timer_Tick);
            m_TickTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            m_TickTimer.Start();
        }
        public TestNet2MainWindow()
        {
            InitializeComponent();

            var logServerAddress = SavedValueRegistry.ReadValue("LogServer", null);

            if (!string.IsNullOrEmpty(logServerAddress))
            {
                txtLogServer.Text = logServerAddress;
            }

            var loginServerAddress = SavedValueRegistry.ReadValue("LoginServer", null);

            if (!string.IsNullOrEmpty(loginServerAddress))
            {
                txtLoginServer.Text = loginServerAddress;
            }

            txtLoginName.Text = SavedValueRegistry.ReadValue("LoginName", "");

            var processName = SavedValueRegistry.ReadValue("ProcessName", "TestNet2.WinSharp");

            txtLogId.Text = processName;

            GlobalEngine.Start(processName, logServerAddress, 0xFFFFFFFF);

            m_MessageRouter = new SFMessageRouter();
            RegisterMessageLiteners();


            UpdateButtonState();

            OnlineClient.OnOnlineStateChanged += (object sender, OnlineClient.OnlineState prevState, OnlineClient.OnlineState newState) =>
            {
                UpdateStatusText(newState);
            };
            UpdateStatusText(OnlineClient.OnlineState.None);

            m_TickTimer          = new System.Windows.Threading.DispatcherTimer();
            m_TickTimer.Tick    += new EventHandler(Timer_Tick);
            m_TickTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            m_TickTimer.Start();
        }