예제 #1
0
        public void RenameThreadSubjectPrompt(int threadBindingSourceIndex)
        {
            Thread thread = Model.Threads[threadBindingSourceIndex];
            GetStringMessageBox dialog = new GetStringMessageBox(thread.Subject);

            dialog.StartPosition = FormStartPosition.CenterParent;

            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                string newSubject = string.IsNullOrWhiteSpace(dialog.UserEntry) ? Thread.NO_SUBJECT : dialog.UserEntry;

                thread.Subject = newSubject;
            }
        }
예제 #2
0
        public static string MessageBoxGetString(string prepopulatedText = "")
        {
            GetStringMessageBox dialog = new GetStringMessageBox(prepopulatedText);

            dialog.TopMost = true;

            // Show testDialog as a modal dialog and determine if DialogResult = OK.
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                // Read the contents of testDialog's TextBox.
                return(dialog.UserEntry.Replace("\n", "").Replace("\r", ""));
            }
            else
            {
                return(null);
            }
        }