当前位置: 首页>>代码示例>>C#>>正文


C# Form.ShowAsync方法代码示例

本文整理汇总了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
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:Application.cs


注:本文中的System.Windows.Forms.Form.ShowAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。