/// <summary> /// Pastes any incoming deterministic transitions /// </summary> /// <param name="cd"></param> /// <param name="entry"></param> /// <remarks> /// Create all incoming deterministic transitions described in the specified clipboard entry as follows: /// /// (1.) We are not going to look at any state classes that are in the clipboard since the transitions for these state /// classes were established when the state classes paste was performed. /// /// (2.) If the transition is coming from a state class in the same diagram (but that state class is not found in the clipboard) then we /// can create that transition. But we can only do this if the source state class does not have a transition to another state class. /// /// (3.) If it is a transition coming from an off-stratum state class, make sure the state class still exists in the source stratum. And, /// as with a state class in this diagram, only do this if the source state class does not have a transition to another state class. /// </remarks> private void PasteDTIncoming(TransitionDiagramClipData cd, TransitionDiagramClipDataEntry entry, DTAnalyzer analyzer) { foreach (DeterministicTransitionClipData t in entry.IncomingDT) { if (!ClipContainsStateClass(cd, t.StateClassIdSource)) { if (this.m_ExplicitClasses.ContainsKey(t.StateClassIdSource)) { DataRow dr = analyzer.GetStateClassRow(this.m_StratumId, t.StateClassIdSource); if (IsDTToSelf(dr)) { dr[Strings.DATASHEET_DT_STATECLASSIDDEST_COLUMN_NAME] = entry.ShapeData.StateClassIdSource; } } else { DataRow dr = analyzer.GetStateClassRow(t.StratumIdSource, t.StateClassIdSource); if (dr != null && IsDTToSelf(dr)) { dr[Strings.DATASHEET_DT_STATECLASSIDDEST_COLUMN_NAME] = entry.ShapeData.StateClassIdSource; dr[Strings.DATASHEET_DT_STRATUMIDDEST_COLUMN_NAME] = this.m_StratumId; } } } } }
private void InternalDeleteStateClasses() { this.m_DTDataSheet.BeginDeleteRows(); this.m_PTDataSheet.BeginDeleteRows(); DTAnalyzer Analyzer = new DTAnalyzer(this.m_DTDataSheet.GetData(), this.m_DataFeed.Project); foreach (StateClassShape Shape in this.SelectedShapes) { if (!Shape.IsStatic) { DataRow row = Analyzer.GetStateClassRow(Shape.StratumIdSource, Shape.StateClassIdSource); if (row.RowState == DataRowState.Added) { this.m_DTDataSheet.GetData().Rows.Remove(row); } else { row.Delete(); } } } this.m_DTDataSheet.EndDeleteRows(); this.m_PTDataSheet.EndDeleteRows(); }
private void RecordStateClassLocation(StateClassShape shape, DTAnalyzer analyzer) { Debug.Assert(this.WorkspaceRectangle.Contains(shape.Bounds)); DataRow row = analyzer.GetStateClassRow(this.m_StratumId, shape.StateClassIdSource); row[Strings.DATASHEET_DT_LOCATION_COLUMN_NAME] = RowColToLocation(shape.Row, shape.Column); }
private void PasteStateClassesReplace(TransitionDiagramClipDataEntry entry, DTAnalyzer analyzer) { DataRow dr = analyzer.GetStateClassRow(this.m_StratumId, entry.ShapeData.StateClassIdSource); if (entry.ShapeData.AgeMin.HasValue) { dr[Strings.DATASHEET_AGE_MIN_COLUMN_NAME] = entry.ShapeData.AgeMin.Value; } else { dr[Strings.DATASHEET_AGE_MIN_COLUMN_NAME] = DBNull.Value; } if (entry.ShapeData.AgeMax.HasValue) { dr[Strings.DATASHEET_AGE_MAX_COLUMN_NAME] = entry.ShapeData.AgeMax.Value; } else { dr[Strings.DATASHEET_AGE_MAX_COLUMN_NAME] = DBNull.Value; } }