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); }
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); }
internal void LoadConstraints() { ptv.LogInfo("Loading constraints"); // These constraints really doesn't add much from a usability perspective, they take time, // and as #39 and #54 shows it can be quite annoying. //GetDateConstraint("min", (datemin) => //{ // if (!datemin.Equals(DateTime.MinValue)) // { // dateFrom.MinDate = datemin; // dateFrom.Value = datemin; // dateTo.MinDate = datemin; // } // GetDateConstraint("max", (datemax) => // { // if (!datemax.Equals(DateTime.MinValue)) // { // dateFrom.MaxDate = datemax; // dateTo.MaxDate = datemax; // dateTo.Value = datemax; // } GetPlugins((pluginlist) => { comboPlugin.Items.Clear(); comboPlugin.Items.AddRange(pluginlist.ToArray()); }); GetMessages((messagelist) => { comboMessage.Items.Clear(); comboMessage.Items.AddRange(messagelist.ToArray()); }); GetEntities((entitylist) => { comboEntity.Items.Clear(); comboEntity.Items.AddRange(entitylist.ToArray()); }); // }); //}); }