示例#1
0
        internal void PopulateGrid(IEnumerable <Entity> results)
        {
            ptv.LogInfo("PopulateGrid with {0} logs", results.Count());
            var asyncinfo = new WorkAsyncInfo()
            {
                Message = "Populating result view",
                Work    = (a, args) =>
                {
                    ptv.UpdateUI(() =>
                    {
                        refreshingGrid         = true;
                        crmGridView.DataSource = results;
                        refreshingGrid         = false;
                        ptv.SendStatusMessage($"Loaded {results.Count()} trace records");
                        UpdateColumnsLayout();
                    });
                },
                PostWorkCallBack = (args) =>
                {
                    if (args.Error != null)
                    {
                        ptv.ShowErrorDialog(args.Error, "Populating Results");
                    }
                }
            };

            ptv.WorkAsync(asyncinfo);
        }
示例#2
0
        internal void PopulateGrid(EntityCollection results)
        {
            ptv.LogInfo("PopulateGrid with {0} logs", results.Entities.Count);
            var asyncinfo = new WorkAsyncInfo()
            {
                Message = "Populating result view",
                Work    = (a, args) =>
                {
                    ptv.UpdateUI(() =>
                    {
                        refreshingGrid         = true;
                        crmGridView.DataSource = results;
                        refreshingGrid         = false;
                        ptv.SendStatusMessage($"Loaded {results.Entities.Count} trace records");
                        UpdateColumnsLayout();
                    });
                },
                PostWorkCallBack = (args) =>
                {
                    if (args.Error != null)
                    {
                        ptv.AlertError($"Failed to populate result view:\n{args.Error.Message}", "Load");
                    }
                }
            };

            ptv.WorkAsync(asyncinfo);
        }