本文整理汇总了C#中System.Windows.Forms.Form.ShowAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Form.ShowAsync方法的具体用法?C# Form.ShowAsync怎么用?C# Form.ShowAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Form
的用法示例。
在下文中一共展示了Form.ShowAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplicationPerformanceForm
//.........这里部分代码省略.........
var rows =
kkg.Rows.AsEnumerable().Where(xx => xx.DataBoundItem != null).Select(
xrow => ((PerformanceResourceTimingData2ApplicationResourcePerformanceRow)((DataRowView)xrow.DataBoundItem).Row)
);
var min = rows.Min(
xx => xx.duration
);
var max = rows.Max(
xx => xx.duration
);
SourceCell.ToolTipText = new { crow.duration, min, max }.ToString();
var red = (int)(((crow.duration - min) * 255) / (max - min));
e.CellStyle.ForeColor = Color.FromArgb(
red: red,
green: 0,
blue: 255 - red
);
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
return;
}
#endregion
#region path
if (SourceCell.OwningColumn.Name == "path" && !SourceCell.IsInEditMode)
{
var crow = (PerformanceResourceTimingData2ApplicationResourcePerformanceRow)((DataRowView)SourceCell.OwningRow.DataBoundItem).Row;
var red = crow.path.Contains("xml?") ? 255 : 0;
e.CellStyle.ForeColor = Color.FromArgb(
red: red,
green: 0,
blue: 255 - red
);
return;
}
#endregion
};
#endregion
#region Load
kkf.Load +=
async delegate
{
Console.WriteLine("enter kkf.Load");
//kkg.DataSource = await this.GetSimilarApplicationResourcePerformance(row);
var s = Stopwatch.StartNew();
var xdata = await service.GetSimilarApplicationResourcePerformance(row);
Console.WriteLine("got xdata at kkf.Load");
kkf.Text += " " + s.ElapsedMilliseconds + "ms";
kkg.DataSourceChanged +=
delegate
{
var p = kkg.PreferredSize;
p.Height = p.Height.Min(400);
kkf.ClientSize = p;
};
kkg.DataSource = xdata;
};
#endregion
//kf.Hide();
//Native.document.title = "kkf";
await kkf.ShowAsync(hideOwner: true);
//kf.Show();
//Native.document.title = "kf";
}
);
};
//Native.document.title = "kf";
await kf.ShowAsync(hideOwner: true);
//Native.document.title = "f";
};
#endregion
}