Ejemplo n.º 1
0
        /// <summary>
        /// Intialize variables and check selected feature is valid.
        /// </summary>
        /// <param name="CustomCommandHelper"></param>
        public void Activate(Intergraph.GTechnology.API.IGTCustomCommandHelper CustomCommandHelper)
        {
            IGTDDCKeyObjects ddcKeyObjects = GTClassFactory.Create <IGTDDCKeyObjects>();

            gtApp = GTClassFactory.Create <IGTApplication>();
            try
            {
                gtCustomCommandHelper            = CustomCommandHelper;
                gtApp.SelectedObjectsChanged    += GtApp_SelectedObjectsChanged;
                gtCustomCommandHelper.MouseMove += new EventHandler <GTMouseEventArgs>(gtCustomCommandHelper_MouseMove);
                if (gtApp.DataContext.IsRoleGranted("PRIV_MGMT_LAND"))
                {
                    if (gtApp.SelectedObjects.FeatureCount == 1)
                    {
                        g3eFno_trg = gtApp.SelectedObjects.GetObjects()[0].FNO;
                        g3eFid_trg = gtApp.SelectedObjects.GetObjects()[0].FID;
                        if (!ValidateSelectedFeature(g3eFno_trg))
                        {
                            MessageBox.Show(ValidationMsg, msgBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            CleanUp();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Command Access Denied.  Please contact System Administrator", "G/Technology", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    CleanUp();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex.Message, msgBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                CleanUp();
            }
        }
        /// <summary>
        /// Intialize variables and check selected feature is valid.
        /// </summary>
        /// <param name="CustomCommandHelper"></param>
        public void Activate(Intergraph.GTechnology.API.IGTCustomCommandHelper CustomCommandHelper)
        {
            gtApp = GTClassFactory.Create <IGTApplication>();
            List <KeyValuePair <int, string> > featureTypes = null;

            try
            {
                gtCustomCommandHelper            = CustomCommandHelper;
                gtCustomCommandHelper.MouseMove += gtCustomCommandHelper_MouseMove;
                featureTypes = GetFeatureClass();
                detectOverlappingAnalysis = new DetectOverlappingAnalysis(featureTypes);

                if (detectOverlappingAnalysis.ShowDialog() == DialogResult.OK)
                {
                    //    RunProcess(detectOverlappingAnalysis.SelectedFeatureType, detectOverlappingAnalysis.IsSelfOverlap);
                    DetectOverlapping(detectOverlappingAnalysis.SelectedFeatureType, detectOverlappingAnalysis.IsSelfOverlap);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex.Message, msgBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                CleanUp();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Intialize variables and check selected feature is valid.
        /// </summary>
        /// <param name="CustomCommandHelper"></param>
        public void Activate(Intergraph.GTechnology.API.IGTCustomCommandHelper CustomCommandHelper)
        {
            try
            {
                m_oGTCustomCommandHelper = CustomCommandHelper;
                m_oGTApplication.BeginWaitCursor();

                if (m_oGTApplication.SelectedObjects.FeatureCount > 0)
                {
                    //Get Source feature FNO,FID
                    m_sourceFNO = m_oGTApplication.SelectedObjects.GetObjects()[0].FNO;
                    m_sourceFID = m_oGTApplication.SelectedObjects.GetObjects()[0].FID;

                    //Get Primary Graphic component
                    m_primaryGeoCNO = GetPrimaryGeographicCNO(m_sourceFNO);
                    int m_componentType = GetComponentType(m_primaryGeoCNO);

                    //if selected feature is not valid then show the error message
                    if ((m_componentType != 8) || (!ValidateSelectedFeature(m_sourceFNO)))
                    {
                        MessageBox.Show(sValidationMsg, sMsgBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        ExitCommand();
                    }
                    else
                    {
                        //subscribe the events
                        SubscribeEvents();

                        //Get target feature FNO and source geometry
                        m_targetFNO    = GetTargetFeature(m_sourceFNO);
                        m_gSrcGeometry = m_oGTApplication.SelectedObjects.GetObjects()[0].Geometry;

                        m_oGTApplication.SetStatusBarText(GTStatusPanelConstants.gtaspcMessage, sStatusBarMsg1);
                        m_oGTApplication.ActiveMapWindow.MousePointer = GTMousePointerConstants.gtmwmpCrossHair;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex.Message, sMsgBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                ExitCommand();
            }
        }