private void CustomCommandHelper_MouseMove(object sender, GTMouseEventArgs e) { if (!string.IsNullOrEmpty(presenter.NotifyPresenterMess)) { GTClassFactory.Create <IGTApplication>().SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, presenter.NotifyPresenterMess); } }
private void m_oGTCustomCommandHelper_MouseMove(object sender, GTMouseEventArgs e) { if (!m_invalidFeatureMessage) { m_iGtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Identify next span to changeout wires; double-click to exit."); } }
/// <summary> /// Mosue move event handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void m_oGTCustomCommandHelper_MouseMove(object sender, GTMouseEventArgs e) { if (!m_invalidFeatureMessage) { m_iGtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Select features to receive copied ancillaries; double-click to accept selection and continue."); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CustomCommandHelper_Click(object sender, GTMouseEventArgs e) { if (isPlacementEnabled) { var btnclk = e.Button; IGTPointGeometry gtPointGeom = GTClassFactory.Create <IGTPointGeometry>(); gtPointGeom.Origin = e.WorldPoint; _gtKeyObj.Components.GetComponent(CommonUtil.MiscStructGeoCno).Geometry = gtPointGeom; } }
/// <summary> /// Mouse click event handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void m_oGTCustomCommandHelper_Click(object sender, GTMouseEventArgs e) { IGTLocateService selectedFeaturesService; IGTDDCKeyObjects selectedFeatures; try { if (e.Button == 1) { selectedFeaturesService = m_iGtApplication.ActiveMapWindow.LocateService; selectedFeatures = selectedFeaturesService.Locate(e.WorldPoint, -1, 0, GTSelectionTypeConstants.gtmwstSelectAll); IGTDDCKeyObjects selectedObjects = GTClassFactory.Create <IGTDDCKeyObjects>(); List <int> fidList = new List <int>(); foreach (IGTDDCKeyObject ddcKeyObject in selectedFeatures) { if (!fidList.Contains(ddcKeyObject.FID)) { fidList.Add(ddcKeyObject.FID); selectedObjects.Add(ddcKeyObject); } } if (selectedObjects == null || selectedObjects.Count == 0) { return; } if ((selectedObjects[0].FNO == m_originalObject.FNO) && (selectedObjects[0].FID != m_originalObject.FID)) // Restrict selection to features of the same class as the original feature and make sure same feature instance is not selected { m_invalidFeatureMessage = false; if (!m_selectedObjects.Any(o => o.FID == selectedObjects[0].FID)) { m_selectedObjects.Add(selectedObjects[0]); m_iGtApplication.ActiveMapWindow.HighlightedObjects.AddSingle(selectedObjects[0]); } } else { m_invalidFeatureMessage = true; m_iGtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Invalid feature selected.Selected features are not of same class as source feature or selected feature itself is source feature."); } } } catch (Exception ex) { if (m_oGTTransactionManager.TransactionInProgress) { m_oGTTransactionManager.Rollback(); } ExitCommand(); MessageBox.Show("Error during execution of Copy Ancillaries custom command." + Environment.NewLine + ex.Message, "G/Techonology", MessageBoxButtons.OK, MessageBoxIcon.Error); throw; } }
/// <summary> /// Mouse double click event handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void m_oGTCustomCommandHelper_DblClick(object sender, GTMouseEventArgs e) { try { m_iGtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, ""); if (m_selectedObjects.Count == 0) { MessageBox.Show("No target features were selected.", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Information); ExitCommand(); return; } if (m_ofrmCopyAncillaryCUs != null) // Initial feature has ACUs { m_iGtApplication.BeginWaitCursor(); if (m_ofrmCopyAncillaryCUs.CanDeleteAllExistigAcus) { DeleteExistingACUs(); } if (m_ofrmCopyAncillaryCUs.CuInformationList.Count > 0) { CopySourceACUsToTargetFeature(); if (CheckForCorrectionModeProperty()) { RemoveCorrectionModeProperty(); } } } else // Initial feature no ACUs and user selected to go ahead and delete ACUs from target { DeleteExistingACUs(); } m_oGTTransactionManager.Commit(); m_oGTTransactionManager.RefreshDatabaseChanges(); SynchronizeWP(); } catch (Exception ex) { if (m_oGTTransactionManager.TransactionInProgress) { m_oGTTransactionManager.Rollback(); } MessageBox.Show("Error during execution of Copy Ancillaries custom command." + Environment.NewLine + ex.Message, "G/Techonology", MessageBoxButtons.OK, MessageBoxIcon.Error); throw; } finally { m_iGtApplication.EndWaitCursor(); ExitCommand(); } }
/// <summary> /// Custom command mouse move event /// </summary> /// <param name="sender">object sender</param> /// <param name="e">GTMouseEventArgs</param> /// <returns></returns> void m_oGTCustomCommandHelper_MouseMove(object sender, GTMouseEventArgs e) { m_oGTApplication.ActiveMapWindow.MousePointer = GTMousePointerConstants.gtmwmpCrossHair; if ((m_blFirstPointSelected)) { m_oGTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, m_sStatusBarMsg2); //move the selected feature m_oEditService.Move(e.WorldPoint); m_blSecondPointSelected = true; m_blPointSelected = false; m_locatedObjects = m_oGTApplication.ActiveMapWindow.LocateService.Locate(e.WorldPoint, 3, 1, GTSelectionTypeConstants.gtmwstSelectSingle); } else { m_oGTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, m_sStatusBarMsg1); if (!m_blPointSelected) { m_blFirstPointSelected = false; m_blPointSelected = true; } } }
void m_oGTCustomCommandHelper_Click(object sender, GTMouseEventArgs e) { try { if (e.Button == 1) { foreach (Recordset rs in m_oRSList) { UpdateActivity(rs, "R", false); } } else if (e.Button == 2) { foreach (Recordset rs in m_oRSList) { UpdateActivity(rs, "S", false); } } // Commit the transaction to reflect the WR_EDITED when set by the trigger if (m_oGTTransactionManager.TransactionInProgress) { m_oGTTransactionManager.Commit(); m_oGTTransactionManager.RefreshDatabaseChanges(); } // Begin a new transaction to process WP synchronization m_oGTTransactionManager.Begin(" WP synchronization..."); SynchronizeWP(); ExitCommand(); } catch (Exception) { throw; } }
/// <summary> /// Custom command mouse move event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void m_oGTCustomCommandHelper_MouseMove(object sender, GTMouseEventArgs e) { m_oGTApplication.ActiveMapWindow.MousePointer = GTMousePointerConstants.gtmwmpCrossHair; if ((m_blFirstPointSelected)) { m_oGTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, sStatusBarMsg2); m_blSecondPointSelected = true; m_blPointSelected = false; m_oEditService.TargetMapWindow = m_oGTApplication.ActiveMapWindow; m_oEditService.RemoveAllGeometries(); //Snap to the Selected Geomentry m_secondtPoint = GetSnapPoint(m_gSrcGeometry, e.WorldPoint); //Append points to Line geometry m_gLineGeom = GTClassFactory.Create <IGTPolylineGeometry>(); m_gLineGeom.Points.Add(m_firstPoint); m_gLineGeom.Points.Add(m_secondtPoint); //Add Geometry to edit service m_oEditService.AddGeometry(m_gLineGeom, Convert.ToInt32(310000042)); //Begin move from snap point m_oEditService.BeginMove(e.WorldPoint); } else { m_oGTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, sStatusBarMsg1); if (!m_blPointSelected) { m_blFirstPointSelected = false; m_blPointSelected = true; } } }
private void gtCustomCommandHelper_MouseMove(object sender, GTMouseEventArgs e) { }
private void m_oGTCustomCommandHelper_DblClick(object sender, GTMouseEventArgs e) { m_oGTTransactionManager.Rollback(); ExitCommand(); }
/// <summary> /// Custom command mouse move event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void gtCustomCommandHelper_MouseMove(object sender, GTMouseEventArgs e) { gtApp.Application.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, StatusBarMsg); }
/// <summary> /// Command Click event /// </summary> /// <param name="sender">object sender</param> /// <param name="e">GTMouseEventArgs</param> /// <returns></returns> void m_oGTCustomCommandHelper_Click(object sender, GTMouseEventArgs e) { try { m_oGTApplication.ActiveMapWindow.MousePointer = GTMousePointerConstants.gtmwmpCrossHair; if (m_blPointSelected) { //Get snap point if (m_osrcGeometry != null) { m_snapPoint = GetSnapPoint(m_osrcGeometry, e.WorldPoint); } else { m_snapPoint = e.WorldPoint; } if (m_oGTApplication.SelectedObjects.FeatureCount > 0) { m_oGTTransactionManager.Begin("Copy Landbase Boundries"); m_oEditService.TargetMapWindow = m_oGTApplication.ActiveMapWindow; m_oEditService.RemoveAllGeometries(); //Create Copy of feature bool bCopyFeature = CopyFeature(m_sourceFNO, m_targetFNO); if (bCopyFeature) { //Lets start moving the feature from snap point m_oEditService.BeginMove(m_snapPoint); m_blFirstPointSelected = true; m_blSecondPointSelected = false; m_oGTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, m_sStatusBarMsg1); } } } if ((m_blFirstPointSelected) && (m_blSecondPointSelected)) { m_blFirstPointSelected = false; //Get the Located object m_locatedObjects = m_oGTApplication.ActiveMapWindow.LocateService.Locate(e.WorldPoint, 3, 1, GTSelectionTypeConstants.gtmwstSelectSingle); //snap the destination to nearest vertex. if (m_locatedObjects.Count > 0) { m_snapPoint = GetSnapPoint(m_locatedObjects[0].Geometry, e.WorldPoint); } else { m_snapPoint = e.WorldPoint; } //End move to snap point m_oEditService.EndMove(m_snapPoint); //Assign the copied geometry to target feature foreach (int i in m_EditObjects.Keys) { m_otrgFeature.Components.GetComponent(Convert.ToInt16(m_EditObjects[i].ToString())).Geometry = m_oEditService.GetGeometry(i); } m_oGTApplication.ActiveMapWindow.MousePointer = GTMousePointerConstants.gtmwmpNWArrow; m_oEditService.RemoveAllGeometries(); m_oGTTransactionManager.Commit(); m_oGTTransactionManager.RefreshDatabaseChanges(); m_oGTCustomCommandHelper.Complete(); } } catch (Exception ex) { MessageBox.Show("Error " + ex.Message, m_sMsgBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); m_oGTApplication.ActiveMapWindow.MousePointer = GTMousePointerConstants.gtmwmpNWArrow; ExitCommand(); } finally { if (m_blSecondPointSelected) { ExitCommand(); } } }
void m_oGTCustomCommandHelper_Click(object sender, GTMouseEventArgs e) { IGTLocateService selectedFeaturesService; IGTDDCKeyObjects selectedFeatures; try { m_iGtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, ""); m_iGtApplication.BeginWaitCursor(); m_invalidFeatureMessage = false; if (e.Button == 1) { selectedFeaturesService = m_iGtApplication.ActiveMapWindow.LocateService; selectedFeatures = selectedFeaturesService.Locate(e.WorldPoint, -1, 0, GTSelectionTypeConstants.gtmwstSelectAll); IGTDDCKeyObjects selectedObjects = GTClassFactory.Create <IGTDDCKeyObjects>(); List <int> fidList = new List <int>(); foreach (IGTDDCKeyObject ddcKeyObject in selectedFeatures) { if (!fidList.Contains(ddcKeyObject.FID)) { fidList.Add(ddcKeyObject.FID); selectedObjects.Add(ddcKeyObject); } } if (selectedObjects == null || selectedObjects.Count == 0) { return; } m_selectedObject = selectedObjects[0]; if (m_selectedObject.FNO != m_originalObject.FNO || m_selectedObject.FID == m_originalObject.FID) // Restrict selection to features of the same class as the original feature { m_invalidFeatureMessage = true; m_iGtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Invalid feature selected.Selected feature(s) are not of same class as source feature or selected feature itself is source feature."); return; } m_iGtApplication.ActiveMapWindow.HighlightedObjects.AddSingle(m_selectedObject); if (m_oGTTransactionManager != null && !m_oGTTransactionManager.TransactionInProgress) { m_oGTTransactionManager.Begin(" begin Repeat reconductoring..."); } if (ProcessChangeOutsToTargetFeature()) { m_oGTTransactionManager.Commit(); m_oGTTransactionManager.RefreshDatabaseChanges(); // Synchronize Work points - ALM-1838-JIRA-2514 SynchronizeWP(m_dataContext.OpenFeature(m_originalObject.FNO, m_originalObject.FID)); SynchronizeWP(m_dataContext.OpenFeature(m_selectedObject.FNO, m_selectedObject.FID)); m_iGtApplication.EndWaitCursor(); m_iGtApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Identify next span to changeout wires; double-click to exit."); } } } catch (Exception ex) { if (m_oGTTransactionManager.TransactionInProgress) { m_oGTTransactionManager.Rollback(); } ExitCommand(); MessageBox.Show("Error during execution of Repeat Reconductoring custom command." + Environment.NewLine + ex.Message, "G/Techonology", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { m_iGtApplication.EndWaitCursor(); } }
private void m_oGTCustomCommandHelper_MouseMove(object sender, GTMouseEventArgs e) { m_oGTApp.Application.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Left click to Remove, right click to Salvage."); }
public void m_oGTCustomCommandHelper_MouseMove(object sender, GTMouseEventArgs e) { m_oGTApp.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, m_oStatusBarMessage); }
/// <summary> /// Command Click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void m_oGTCustomCommandHelper_Click(object sender, GTMouseEventArgs e) { try { m_oGTApplication.ActiveMapWindow.MousePointer = GTMousePointerConstants.gtmwmpNWArrow; if (m_blPointSelected) { //Snap to the Selected Geomentry m_firstPoint = GetSnapPoint(m_gSrcGeometry, e.WorldPoint); m_blFirstPointSelected = true; m_blSecondPointSelected = false; m_oGTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, sStatusBarMsg1); } if ((m_blFirstPointSelected) && (m_blSecondPointSelected)) { try { m_oEditService.EndMove(e.WorldPoint); m_blFirstPointSelected = false; m_oGTTransactionManager.Begin("Divide Landbase Boundries"); // Get the Located object and snap the destination to nearest vertex. IGTDDCKeyObjects m_oLocatedObjects = m_oGTApplication.ActiveMapWindow.LocateService.Locate(e.WorldPoint, 3, 1, GTSelectionTypeConstants.gtmwstSelectSingle); m_secondtPoint = GetSnapPoint(m_oLocatedObjects[0].Geometry, e.WorldPoint); //Perform the break Polygon IGTGeometry[] m_gTargetPolygons = m_gSrcGeometry.BreakPolygon(m_gLineGeom); //Intialise two polygons IGTKeyObject m_oFirstPolygon = m_oGTApplication.DataContext.OpenFeature(m_sourceFNO, m_sourceFID); IGTKeyObject m_oSecondPolygon = m_oGTApplication.DataContext.NewFeature(m_sourceFNO); //Set the geometry with the newly created ones. m_oFirstPolygon.Components.GetComponent(m_primaryGeoCNO).Geometry = CreatePolygon(m_gTargetPolygons[0]); m_oSecondPolygon.Components.GetComponent(m_primaryGeoCNO).Geometry = CreatePolygon(m_gTargetPolygons[1]); //Fetch the required components Recordset rsFirstFeature = m_oFirstPolygon.Components.GetComponent(m_landbaseCNO).Recordset; Recordset rsSecondFeature = m_oSecondPolygon.Components.GetComponent(m_landbaseCNO).Recordset; //Assign required field values rsSecondFeature.Fields["SOURCE"].Value = rsFirstFeature.Fields["SOURCE"].Value; rsSecondFeature.Fields["CREATED_BY"].Value = m_oGTApplication.DataContext.DatabaseUserName; rsSecondFeature.Fields["CREATED_DATE"].Value = System.DateTime.Today; rsSecondFeature.Fields["STAGE"].Value = "Accepted"; m_oGTTransactionManager.Commit(); m_oGTTransactionManager.RefreshDatabaseChanges(); m_oGTApplication.RefreshWindows(); m_oGTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, "Commit complete"); m_oGTApplication.ActiveMapWindow.MousePointer = GTMousePointerConstants.gtmwmpNWArrow; m_oGTCustomCommandHelper.Complete(); } catch (Exception ex) { MessageBox.Show(sStatusBarMsg3, sMsgBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); m_oGTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, sStatusBarMsg3); } } } catch (Exception ex) { MessageBox.Show("Error " + ex.Message, sMsgBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); ExitCommand(); } finally { if (m_blSecondPointSelected) { m_gLineGeom = null; m_gSrcGeometry = null; m_oEditService.RemoveAllGeometries(); m_oEditService = null; ExitCommand(); } } }