Exemple #1
0
 /// <summary>
 /// Starts the feature explorer after line placement is finished.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void placementFinished(object sender, EventArgs e)
 {
     loadServiceLineData();
     featureExplorerService.ExploreFeature(serviceLine, "Placement");
     if (featureExplorerVisible)
     {
         featureExplorerService.ExploreFeature(serviceLine, "Placement");
         featureExplorerService.Visible = true;
         featureExplorerService.Slide(true);
     }
     else
     {
         saveAndContinueActions();
     }
 }
Exemple #2
0
        public void Activate(IGTCustomCommandHelper CustomCommandHelper)
        {
            try
            {
                m_oGTApp = GTClassFactory.Create <IGTApplication>();
                m_oGTCustomCommandHelper = CustomCommandHelper;

                if (Validate())
                {
                    if (m_oGTExplorerService == null)
                    {
                        m_oGTExplorerService = GTClassFactory.Create <IGTFeatureExplorerService>(m_oGTCustomCommandHelper);
                    }

                    m_oGTExplorerService.Slide(true);

                    if (m_oGTPlacementService == null)
                    {
                        m_oGTPlacementService = GTClassFactory.Create <IGTFeaturePlacementService>(m_oGTCustomCommandHelper);
                    }

                    if (!m_oGTTransactionManager.TransactionInProgress)
                    {
                        m_oGTTransactionManager.Begin("Tree Trimming Request Estimate");
                    }

                    m_oStatusBarMessage = "Draw a polygon encompassing all affected Work Points";

                    SubscribeEvents();

                    m_oGTTreeTrimmingfeature = m_oGTApp.DataContext.NewFeature(190);
                    m_oGTPlacementService.StartFeature(m_oGTTreeTrimmingfeature);
                }
                else
                {
                    ExitCommand();
                }
            }
            catch (Exception ex)
            {
                m_oGTExplorerService_CancelClick(null, EventArgs.Empty);
                if (m_oGTTransactionManager.TransactionInProgress)
                {
                    m_oGTTransactionManager.Rollback();
                }
                MessageBox.Show("Error in TreeTrim Request Estimate command: " + ex.Message, "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Error);
                ExitCommand();
            }
        }