コード例 #1
0
ファイル: Main.cs プロジェクト: onlinekid/OWL
        // Edit an account
        private void DdAccountEdit_Click(object sender, EventArgs e)
        {
            if (lvData.SelectedItems.Count == 0)
            {
                MessageBox.Show("No account selected to edit.", "Edit Account", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            foreach (ListViewItem _lvi in lvData.SelectedItems)
            {
                // Find the account in our profile dictionary
                Class.Account _account;
                if (!Globals.CurrentProfile.Profiles.TryGetValue(_lvi.SubItems[0].Text, out _account))
                {
                    MessageBox.Show("Failed to obtain account data for steam url: " + _lvi.SubItems[1].Text + " with a unique id: " + _lvi.SubItems[0].Text + ". \n\nThis account has been skipped.", "Edit account", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    continue;
                }

                if (_account.hThread != null && _account.hThread.IsAlive)
                {
                    MessageBox.Show("You cannot edit an account that is actively parsing!", "Edit account", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }

                using (Forms.AccountInfo _fad = new Forms.AccountInfo(ref _account))
                {
                    _fad.ShowDialog();
                    _fad.Dispose();
                }
            }
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: onlinekid/OWL
 // Add an account
 private void DdAccountAdd_Click(object sender, EventArgs e)
 {
     do
     {
         using (Forms.AccountInfo _fad = new Forms.AccountInfo(ref lvData))
         {
             _fad.ShowDialog();
             _fad.Dispose();
         }
     } while (Forms.AccountInfo.cache_addAnother && Forms.AccountInfo.cache_addAnotherFlag);
 }