本文整理汇总了C#中Task.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# Task.ShowDialog方法的具体用法?C# Task.ShowDialog怎么用?C# Task.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task.ShowDialog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button1_Click_1
private void button1_Click_1(object sender, EventArgs e)
{
if (textBox1.Text.Length == 0)
{
MessageBox.Show("Error 29486247826412");
return;
}
if (textBox2.Text.Length == 0)
{
MessageBox.Show("Error 29486247826413");
return;
}
if (textBox3.Text.Length == 0)
{
MessageBox.Show("Error 29486247826414");
return;
}
Task pr = new Task(textBox1.Text, textBox2.Text, textBox3.Text, listBox1.Text, comboBox1.Text, radioButton1.Checked, radioButton2.Checked);
pr.ShowDialog();
}
示例2: Create
private void Create(Microsoft.Office.Interop.Outlook.MailItem mailItem)
{
String messageClass;
DevExpress.XtraRichEdit.RichEditControl rtfControl = new DevExpress.XtraRichEdit.RichEditControl();
TIS.DL.Internal.Task.TaskObject taskObj;
Microsoft.Office.Interop.Outlook.Inspector inspector;
try
{
messageClass = mailItem.MessageClass;
if (messageClass == "IPM.Note")
{
taskObj = new TIS.DL.Internal.Task.TaskObject();
ProcessEmailAddresses(taskObj, mailItem);
//Get Reporter
Microsoft.Office.Interop.Outlook.NameSpace outNamespace;
outNamespace = Application.GetNamespace("MAPI");
Microsoft.Office.Interop.Outlook.Recipient reporter = outNamespace.CurrentUser;
ProcessEmailAddressReporter(taskObj, reporter.Address);
taskObj.CreationDate = PROF_IT.Common.Convert.DateFunctions.DateToStrDate(System.DateTime.Now);
//RTF BODY
inspector = mailItem.GetInspector;
inspector.Activate();
Microsoft.Office.Interop.Word.Document document = (Microsoft.Office.Interop.Word.Document)inspector.WordEditor;
document.Select();
document.Application.Selection.Copy();
rtfControl.Paste();
taskObj.Description = rtfControl.RtfText;
//Subject
taskObj.Tag = mailItem.Subject;
switch (mailItem.Importance)
{
case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh:
taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.High;
break;
case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceLow:
taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.Low;
break;
case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceNormal:
taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.Medium;
break;
}
taskObj.Effort = TIS.Framework.Common.Enumeration.Task.Effort.Low;
taskObj.Status = TIS.Framework.Common.Enumeration.Task.Status.Open;
Task task = new Task(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, taskObj);
task.ShowDialog();
//Close document, inspector
if (inspector != null) inspector.Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olDiscard);
document = null;
inspector = null;
mailItem = null;
}
else
{
MessageBox.Show("Kan geen task creëren omdat het geselecteerde item geen e-mail is!");
}
}
catch (System.Exception exception1)
{
System.Exception innerException = exception1;
throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
}
finally
{
rtfControl.Dispose();
}
}