Exemplo n.º 1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            //load chats and ui views
            lblUserName.Text = _profile.LocalCertificateStore.Certificate.IssuedTo.Name;

            foreach (BitChat chat in _service.GetBitChatList())
            {
                AddChatView(chat);
            }

            lstChats.SelectItem(lstChats.GetFirstItem());
            ShowSelectedChatView();

            //load settings
            bool loadDefaultSettings = true;

            if (_profile.ClientData != null)
            {
                try
                {
                    LoadProfileSettings(_profile.ClientData);
                    loadDefaultSettings = false;
                }
                catch
                { }
            }

            if (loadDefaultSettings)
            {
                this.Width  = 960;
                this.Height = 540;

                Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;

                this.Left = workingArea.Width - workingArea.Left - this.Width - 20;
                this.Top  = 100;
            }

            //create AppLink
            _link = new AppLink(Program.APP_LINK_PORT);
            _link.CommandReceived += _link_CommandReceived;

            //if (_cmdLine != null)
            //    _link_CommandReceived(_cmdLine);


            //start automatic update client
            _updateClient = new AutomaticUpdateClient(Program.MUTEX_NAME, Application.ProductVersion, Program.UPDATE_URI, Program.UPDATE_CHECK_INTERVAL_DAYS, Program.TRUSTED_CERTIFICATES, _lastUpdateCheckedOn, _lastModifiedGMT);
            _updateClient.ExitApplication   += _updateClient_ExitApplication;
            _updateClient.UpdateAvailable   += _updateClient_UpdateAvailable;
            _updateClient.NoUpdateAvailable += _updateClient_NoUpdateAvailable;
            _updateClient.UpdateError       += _updateClient_UpdateError;


            //show tray icon
            notifyIcon1.Visible = true;
        }
Exemplo n.º 2
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            //load chats and ui views
            lblUserName.Text = _profile.LocalCertificateStore.Certificate.IssuedTo.Name;

            foreach (BitChat chat in _node.GetBitChatList())
            {
                AddChatView(chat);
            }

            lstChats.SelectItem(lstChats.GetFirstItem());
            ShowSelectedChatView();

            //load settings
            bool loadDefaultSettings = true;

            if (_profile.ClientData != null)
            {
                try
                {
                    LoadProfileSettings(_profile.ClientData);
                    loadDefaultSettings = false;
                }
                catch
                { }
            }

            if (loadDefaultSettings)
            {
                this.Width  = 960;
                this.Height = 540;

                Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;

                this.Left = workingArea.Width - workingArea.Left - this.Width - 20;
                this.Top  = 100;
            }

            this.mainContainer.Panel1.Resize += new System.EventHandler(this.mainContainer_Panel1_Resize);
            mainContainer_Panel1_Resize(null, null);

            //start automatic update client
            _updateClient                    = new AutomaticUpdateClient(Program.MUTEX_NAME, Application.ProductVersion, Program.UPDATE_URI, Program.UPDATE_CHECK_INTERVAL_DAYS, Program.TRUSTED_CERTIFICATES, _lastUpdateCheckedOn, _lastModifiedGMT);
            _updateClient.Proxy              = _profile.Proxy;
            _updateClient.ExitApplication   += _updateClient_ExitApplication;
            _updateClient.UpdateAvailable   += _updateClient_UpdateAvailable;
            _updateClient.NoUpdateAvailable += _updateClient_NoUpdateAvailable;
            _updateClient.UpdateError       += _updateClient_UpdateError;

            _updateTimer          = new Timer();
            _updateTimer.Interval = 10000;
            _updateTimer.Tick    += updateTimer_Tick;
            _updateTimer.Start();
        }