/// <summary> /// Hightlight/Unhightlight the selected point in CAD /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnHighlightPoint(object sender, SelectedRowChangedEventArgs e) { var db = HostApplicationServices.WorkingDatabase; var editor = Application.DocumentManager.MdiActiveDocument.Editor; editor.Regen(); try { using (var trans = db.TransactionManager.StartTransaction()) { var point = trans.GetObject(e.PreviousItem?.PointId ?? ObjectId.Null, OpenMode.ForWrite) as DBPoint; if (point != null) { point.ColorIndex = 0; } //point?.Unhighlight(); point = trans.GetObject(e.CurrentItem?.PointId ?? ObjectId.Null, OpenMode.ForWrite) as DBPoint; if (point != null) { point.ColorIndex = 6; } //point?.Highlight(); trans.Commit(); } } catch (Exception ex) { editor.WriteMessage($"\n{ex.Message}"); } }
private void _claimSearchModel_SelectedRowChanged(object sender, SelectedRowChangedEventArgs e) { if (e.SelectedRows == null || e.SelectedRows.Count() == 0) { return; } GlobalSearchGridRow row = e.SelectedRows.First(); SearchResultModel searchResultModel = this.ClaimSearchModel; if (searchResultModel.IsPreviewCollapsed) { searchResultModel.IsPreviewCollapsed = false; } this.LoadPreview(e.SelectedRows, null); }
private void BeginDelayedEvent(IList selectedRows) { var searchRows = new List<GlobalSearchGridRow>(); foreach (var row in selectedRows) { searchRows.Add((GlobalSearchGridRow)row); } var selectedRowEventArgs = new SelectedRowChangedEventArgs { SelectedRows = searchRows }; this._timer.Stop(); this._timer.Begin(selectedRowEventArgs); }