/// <summary> /// Open selected element in diagram and select in project browser /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { var grid = (DataGridView)sender; string guid = null; DataGridViewRow row = grid.Rows[e.RowIndex]; // ReSharper disable CanBeReplacedWithTryCastAndCheckForNull if (row.DataBoundItem is IDecisionRelation) { var link = (IDecisionRelation)row.DataBoundItem; DetailViewHandler.Instance.OpenDecisionDetailView(link.RelatedDecision); } else { if (row.DataBoundItem is IStakeholderAction) { var stakeholderAction = (IStakeholderAction)row.DataBoundItem; guid = stakeholderAction.Stakeholder.GUID; } else if (row.DataBoundItem is ITraceLink) { var link = (ITraceLink)row.DataBoundItem; guid = link.TracedElementGUID; } if (guid != null && !"".Equals(guid)) { IEAElement element = EAMain.Repository.GetElementByGUID(guid); element.ShowInDiagrams(); } } // ReSharper restore CanBeReplacedWithTryCastAndCheckForNull }