/// <summary> /// Initialize for an update (or recall) /// </summary> /// <param name="op">The edit that is being updated or recalled</param> /// <param name="lineNum">The sequence number of the distance involved (relevant only for /// a <see cref="IntersectTwoLinesOperation"/>)</param> internal void ShowUpdate(IntersectOperation op, int lineNum) { // Return if no update object (and no recall op). if (op==null) return; // Populate the dialog, depending on what sort of operation we have. if (op.EditId == EditingActionId.LineIntersect) { /* CeIntersectLine* pOper = dynamic_cast<CeIntersectLine*>(pop); if ( linenum==1 ) this->Show( pOper->GetpArc1() , pOper->IsSplit1() ); else this->Show( pOper->GetpArc2() , pOper->IsSplit2() ); */ } else if (op.EditId == EditingActionId.DirLineIntersect) { IntersectDirectionAndLineOperation oper = (IntersectDirectionAndLineOperation)op; ShowLine(oper.Line, oper.IsSplit); } else { MessageBox.Show("GetLineControl.ShowUpdate - Unexpected editing operation"); } }
/// <summary> /// Initializes dialog for an update. /// </summary> /// <param name="op">The edit that is being updated or recalled</param> /// <param name="dir">The direction number (1 or 2). A value of 2 is only /// valid when dealing with the <see cref="IntersectTwoDirectionsForm"/> dialog.</param> /// <returns>True if update (or recalled command) was shown.</returns> bool ShowUpdate(IntersectOperation op, byte dir) { /* // Return if no update feature (and no recall op). const CeIntersect* pop = GetUpdateOp(); if ( pop==0 ) pop = GetRecall(); if ( !pop ) return FALSE; */ if (op==null) return false; // Ensure that there is no direction line. If you don't do // this, it is possible that when we select a string in the // entity combo, we'll move directly to the next page of the // dialog (see <mf CdGetDir::OnSelChangeLineType>). m_Dir = null; // Populate the dialog, depending on what sort of operation we have. if (op.EditId == EditingActionId.DirIntersect) { Debug.Assert(dir==1 || dir==2); IntersectTwoDirectionsOperation oper = (IntersectTwoDirectionsOperation)op; if (dir==1) Show(oper.Direction1, oper.CreatedLine1); else Show(oper.Direction2, oper.CreatedLine2); } else if (op.EditId == EditingActionId.DirDistIntersect) { IntersectDirectionAndDistanceOperation oper = (IntersectDirectionAndDistanceOperation)op; Show(oper.Direction, oper.CreatedDirectionLine); } else if (op.EditId == EditingActionId.DirLineIntersect) { IntersectDirectionAndLineOperation oper = (IntersectDirectionAndLineOperation)op; Show(oper.Direction, oper.CreatedDirectionLine); } else { MessageBox.Show("GetDirectionControl.ShowUpdate - Unexpected editing operation"); } // Ensure everything is drawn ok. // this->OnDrawAll(); // Disallow change of line type (you cannot add or delete lines via update). lineTypeGroupBox.Enabled = false; return true; }
/// <summary> /// Initialize for an update (or recall) /// </summary> /// <param name="op">The edit that is being updated or recalled</param> /// <param name="distNum">The sequence number of the distance involved (relevant only for /// a <see cref="IntersectTwoDistancesOperation"/>)</param> internal void ShowUpdate(IntersectOperation op, int distNum) { // Return if no update object (and no recall op). if (op==null) return; // Populate the dialog, depending on what sort of operation we have. if (op.EditId == EditingActionId.DistIntersect) { Debug.Assert(distNum==1 || distNum==2); IntersectTwoDistancesOperation oper = (IntersectTwoDistancesOperation)op; if (distNum==1) ShowDistance(oper.Distance1FromPoint, oper.Distance1, oper.CreatedLine1); else ShowDistance(oper.Distance2FromPoint, oper.Distance2, oper.CreatedLine2); } else if (op.EditId == EditingActionId.DirDistIntersect) { IntersectDirectionAndDistanceOperation oper = (IntersectDirectionAndDistanceOperation)op; ShowDistance(oper.DistanceFromPoint, oper.Distance, oper.CreatedDistanceLine); } else { MessageBox.Show("GetDistanceControl.ShowUpdate - Unexpected editing operation"); } // Disallow change of line type (you cannot add or delete lines via update). lineTypeGroupBox.Enabled = false; }