コード例 #1
0
        private void cloneDialogButton_Click(object sender, EventArgs e)
        {
            if (mCallback != null)
            {
                CloneObjectParameters parameters = new CloneObjectParameters();

                for (int row = 0; row < parametersTable.RowCount; row++)
                {
                    TextBox original    = parametersTable.GetControlFromPosition(0, row) as TextBox;
                    TextBox replacement = parametersTable.GetControlFromPosition(1, row) as TextBox;
                    if ((original != null) &&
                        (replacement != null) &&
                        (!string.IsNullOrWhiteSpace(original.Text)) &&
                        (!string.IsNullOrWhiteSpace(replacement.Text)))
                    {
                        parameters.AddStringReplacement(original.Text, replacement.Text);
                    }
                }

                bool isSuccess = mCallback.OnAccept(parameters);
                if (isSuccess)
                {
                    mCallback = null;
                    Close();
                }
            }
        }
コード例 #2
0
 private void inputDialogOkayButton_Click(object sender, EventArgs e)
 {
     if (mCallback != null)
     {
         bool isSuccess = mCallback.OnAccept(inputDialogTextBox.Text);
         if (isSuccess)
         {
             mCallback = null;
             Close();
         }
     }
 }
コード例 #3
0
 private void acceptButton_Click(object sender, EventArgs e)
 {
     if (mCallback != null)
     {
         bool isSuccess = mCallback.OnAccept(GetUnwantedItems());
         if (isSuccess)
         {
             mCallback    = null;
             DialogResult = DialogResult.OK;
             Close();
         }
     }
 }
コード例 #4
0
 private void applyButton_Click(object sender, EventArgs e)
 {
     if (mCallback != null)
     {
         bool isSuccess = mCallback.OnAccept(baseModsPathTextbox.Text, steamUploadsPathTextbox.Text);
         if (isSuccess)
         {
             mCallback         = null;
             this.DialogResult = DialogResult.OK;
             Close();
         }
     }
 }
コード例 #5
0
 private void acceptButton_Click(object sender, EventArgs e)
 {
     if (mCallback != null)
     {
         // Casts the listbox items to strings (throws an exception should anything be uncastable),
         // then selects only unique (distinct) elements and passes that to OnAccept as IEnumerable<string>
         bool isSuccess = mCallback.OnAccept(listBox.SelectedItems.Cast <string>().Distinct());
         if (isSuccess)
         {
             mCallback = null;
             Close();
         }
     }
 }
コード例 #6
0
        private void acceptButton_Click(object sender, EventArgs e)
        {
            if (mCallback != null)
            {
                HashSet <string> selected = new HashSet <string>();
                foreach (object obj in listBox.SelectedItems)
                {
                    string alias = (string)obj;
                    selected.Add(alias);
                }

                bool isSuccess = mCallback.OnAccept(selected);
                if (isSuccess)
                {
                    mCallback = null;
                    Close();
                }
            }
        }