Esempio n. 1
0
        public frmShareFileSelection(BitChatClient client, SharedFile sharedFile)
        {
            InitializeComponent();

            BitChat[] sharedChats = sharedFile.GetChatList();

            foreach (BitChat chat in client.GetBitChatList())
            {
                bool found = false;

                foreach (BitChat sharedChat in sharedChats)
                {
                    if (sharedChat == chat)
                    {
                        found = true;
                        break;
                    }
                }

                if (!found)
                {
                    checkedListBox1.Items.Add(chat);
                }
            }
        }
        private void frmMain_Load(object sender, EventArgs e)
        {
            //load chats and ui views
            lblUserName.Text = _profile.LocalCertificateStore.Certificate.IssuedTo.Name;

            foreach (BitChat chat in _client.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;
        }