本文整理汇总了C#中EditorWindow.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# EditorWindow.ShowDialog方法的具体用法?C# EditorWindow.ShowDialog怎么用?C# EditorWindow.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EditorWindow
的用法示例。
在下文中一共展示了EditorWindow.ShowDialog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: gridDiffs_CellClick
private void gridDiffs_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
if (e.ColumnIndex == colCompare.DisplayIndex && e.RowIndex >= 0)
{
var diff = (InstallItemDiff)gridDiffs.Rows[e.RowIndex].DataBoundItem;
if (diff.DiffType == DiffType.Different)
{
var diffWin = new ADiff.DiffWindow();
diffWin.LeftText = diff.LeftScript.OuterXml;
diffWin.RightText = diff.RightScript.OuterXml;
ElementHost.EnableModelessKeyboardInterop(diffWin);
diffWin.Show();
}
else
{
using (var dialog = new EditorWindow())
{
dialog.AllowRun = false;
dialog.AmlGetter = o => Utils.FormatXml(diff.LeftScript ?? diff.RightScript);
dialog.DisplayMember = "Name";
dialog.DataSource = new List<InstallItemDiff>() { diff };
dialog.SetConnection(_wizard.Connection, _wizard.ConnectionInfo.First().ConnectionName);
dialog.ShowDialog(this);
}
}
}
}
catch (Exception ex)
{
Utils.HandleError(ex);
}
}
示例2: gridDiffs_CellClick
private void gridDiffs_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
if (e.ColumnIndex == colCompare.DisplayIndex && e.RowIndex >= 0)
{
var diff = (InstallItemDiff)gridDiffs.Rows[e.RowIndex].DataBoundItem;
if (diff.DiffType == DiffType.Different)
{
Settings.Current.PerformDiff("Left"
, s => ToAml(s, diff.LeftScript)
, "Right"
, s => ToAml(s, diff.RightScript));
}
else
{
using (var dialog = new EditorWindow())
{
dialog.AllowRun = false;
dialog.Script = Utils.FormatXml(diff.LeftScript ?? diff.RightScript);
dialog.SetConnection(_wizard.Connection, _wizard.ConnectionInfo.First().ConnectionName);
dialog.ShowDialog(this);
}
}
}
}
catch (Exception ex)
{
Utils.HandleError(ex);
}
}
示例3: mniEdit_Click
private void mniEdit_Click(object sender, EventArgs e)
{
using (var dialog = new EditorWindow())
{
dialog.AllowRun = false;
//dialog.AmlGetter = o => Utils.FormatXml(((ImportStepResolve)o).Item.Script);
//dialog.AmlSetter = (o,a) => ((ImportStepResolve)o).Item.SetScript(a);
//dialog.DisplayMember = "Name";
//dialog.DataSource = SelectedRows().ToList();
dialog.Script = Utils.FormatXml(SelectedRows().First().Item.Script);
dialog.SetConnection(_wizard.Connection, _wizard.ConnectionInfo.First().ConnectionName);
if (dialog.ShowDialog(this) == DialogResult.OK)
{
SelectedRows().First().Item.SetScript(dialog.Script);
}
}
}