public override void OnClick()
        {
            if (m_Hook == null)
            {
                return;
            }
            if (m_Hook.ArcGisMapControl == null)
            {
                return;
            }
            if (m_Hook.ArcGisMapControl.Map == null)
            {
                return;
            }
            IMap pMap = m_Hook.ArcGisMapControl.Map;

            if (pMap.LayerCount == 0)
            {
                return;
            }


            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter = "shape文件(*.shp)|*.shp";

            //openFileDialog1.InitialDirectory = @"E:\test\文档和数据\Data";

            openFileDialog1.Multiselect = false;

            DialogResult pDialogResult = openFileDialog1.ShowDialog();

            if (pDialogResult != DialogResult.OK)
            {
                return;
            }
            IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactory();  //  1
            string            pPath             = openFileDialog1.FileName;

            string pFolder = System.IO.Path.GetDirectoryName(pPath); //文件夹

            string pFileName = System.IO.Path.GetFileName(pPath);    //文件名


            IWorkspace pWorkspace = pWorkspaceFactory.OpenFromFile(pFolder, 0);  // 2

            IFeatureWorkspace pFeatureWorkspace = pWorkspace as IFeatureWorkspace;

            IFeatureClass pFC = pFeatureWorkspace.OpenFeatureClass(pFileName);  //3

            if (pFC == null)
            {
                return;
            }
            string XmlPath = Application.StartupPath + "\\..\\Res\\Xml\\展示图层树0.xml";

            SysCommon.ModSysSetting.CopyLayerTreeXmlFromDataBase(Plugin.ModuleCommon.TmpWorkSpace, XmlPath);
            FrmImpLandUseReport pFrm    = null;
            DialogResult        pResult = DialogResult.No;

            try
            {
                pFrm    = new FrmImpLandUseReport(XmlPath);
                pResult = pFrm.ShowDialog();
            }
            catch (Exception err1)
            { }
            if (pResult == DialogResult.OK)   //行政区代码改为从数据中自动获取,不再由用户设置 20110919
            {
                string strYear = pFrm._Year;
                //string strXZQcode = pFrm._XZQcode;
                string strAreaUnit = pFrm._AreaUnit;
                bool   chkTDLY     = pFrm._chkTDLY;
                bool   chkZTGH     = pFrm._chkZTGH;
                int    FractionNum = pFrm._FractionNum;
                string ResPath     = pFrm._ResultPath;
                pFrm = null;
                SysCommon.CProgress pProgress = new SysCommon.CProgress("导入区域叠置分析...");
                pProgress.EnableCancel    = false;
                pProgress.ShowDescription = true;
                pProgress.FakeProgress    = true;
                pProgress.TopMost         = true;
                pProgress.ShowProgress();
                try
                {
                    IFeatureClass pPolygonFeaCls = GetPolygoneFeatureClass(pFC);
                    if (pPolygonFeaCls != null)
                    {
                        DoImportAreaLandUseStatic(XmlPath, pPolygonFeaCls, strYear, strAreaUnit, FractionNum, chkTDLY, chkZTGH, ResPath, pProgress);
                        if (!pPolygonFeaCls.Equals(pFC))
                        {
                            IDataset pDataset = pPolygonFeaCls as IDataset;
                            pDataset.Delete();
                        }
                    }
                }
                catch (Exception err2)
                { }
                pProgress.Close();
            }
            System.IO.File.Delete(XmlPath);
        }
        protected override void OnMouseUp(MouseEventArgs arg)
        {
            // Did they click the left mouse button?
            if (arg.Button == System.Windows.Forms.MouseButtons.Left)
            {
                // Get some application environment variables set
                IMxApplication mxApp = (IMxApplication)ArcMap.Application;

                // Get the clicked location in map units
                IPoint clickedPoint = mxApp.Display.DisplayTransformation.ToMapPoint(arg.Location.X, arg.Location.Y);

                // If this is the first click on the map...
                switch (numberOfClicks)
                {
                case 0:
                    // This is the first click, giving the location of the measurement.
                    measurementLocationX = clickedPoint.X;
                    measurementLocationY = clickedPoint.Y;

                    // Increment the click counter
                    numberOfClicks = 1;

                    // Change the cursor
                    System.Windows.Forms.Cursor firstCursor = new System.Windows.Forms.Cursor(GetType(), "Cursors.firstPointCursor.cur");
                    Cursor = firstCursor;

                    break;

                case 1:
                    // This is the second click, giving the first end of the strike line, according to right-hand rule.
                    firstEndX = clickedPoint.X;
                    firstEndY = clickedPoint.Y;

                    // Increment the click counter
                    numberOfClicks = 2;

                    // Change the cursor
                    System.Windows.Forms.Cursor secondCursor = new System.Windows.Forms.Cursor(GetType(), "Cursors.SecondPointCursor.cur");
                    Cursor = secondCursor;

                    break;

                case 2:
                    // This is the third click, giving the second end of the strike line, according to right-hand rule.
                    secondEndX = clickedPoint.X;
                    secondEndY = clickedPoint.Y;

                    // Increment the click counter
                    numberOfClicks = 3;

                    // Change the cursor
                    //base.m_cursor = Properties.Resources.GetDipCursor;

                    // Calculate the Strike from the two collected points
                    int theStrike = GetStrike(firstEndX, firstEndY, secondEndX, secondEndY);

                    // Get the dip input
                    int    theDip;
                    string inputValue = "";

getDipValue:
                    if (genericForms.InputBox("Digitize Structure Points", "Please enter the dip value", ref inputValue) == DialogResult.OK)
                    {
                        // Make sure they entered a valid dip value
                        int  dipValue;
                        bool result = int.TryParse(inputValue, out dipValue);

                        if (result == true)
                        {
                            // inputValue is an integer
                            if (dipValue >= -90)
                            {
                                if (dipValue <= 90)
                                {
                                    // inputValue is in the appropriate range
                                    theDip = int.Parse(inputValue);
                                }
                                else
                                {
                                    goto getDipValue;
                                }
                            }
                            else
                            {
                                goto getDipValue;
                            }
                        }
                        else
                        {
                            goto getDipValue;
                        }
                    }
                    else
                    {
                        // In this case, the action was canceled during the dip input. Reset the counter, cursor, and exit the routine.
                        numberOfClicks = 0;
                        //base.m_cursor = Properties.Resources.firstPointCursor;
                        return;
                    }

                    // Now we need to create the feature. First we'll find the current FeatureTemplate
                    IEditor3      templateEditor     = (IEditor3)ArcMap.Editor;
                    IEditTemplate theCurrentTemplate = templateEditor.CurrentTemplate;

                    // If they didn't select a template, they'll need to
                    if (theCurrentTemplate == null)
                    {
                        MessageBox.Show("Please select a feature template for the type of measurement that you're digitizing", "NCGMP Tools");
                        numberOfClicks = 0;
                        System.Windows.Forms.Cursor locCursor = new System.Windows.Forms.Cursor(GetType(), "Cursors.StationLocCursor.cur");
                        Cursor = locCursor;
                        return;
                    }

                    // Make sure that the template puts features into the OrientationPoints FeatureClass
                    IFeatureClass templateFC = ((IFeatureLayer)theCurrentTemplate.Layer).FeatureClass;
                    if (templateFC.Equals(commonFunctions.OpenFeatureClass(ArcMap.Editor.EditWorkspace, "OrientationPoints")))
                    {
                        try
                        {
                            // Create a dummy feature and read in values from the feature template
                            IFeature tempFeature = templateFC.CreateFeature();
                            theCurrentTemplate.SetDefaultValues(tempFeature);

                            // Grab values from the dummy feature - the code is actually cleaner than grabbing the values from the FeatureTemplate
                            string StationID = "";
                            string Type      = tempFeature.get_Value(templateFC.FindField("Type")).ToString();
                            string IDConf    = tempFeature.get_Value(templateFC.FindField("IdentityConfidence")).ToString();
                            string Label     = tempFeature.get_Value(templateFC.FindField("Label")).ToString();
                            string Notes     = tempFeature.get_Value(templateFC.FindField("Notes")).ToString();

                            int  Plot;
                            bool result = int.TryParse(tempFeature.get_Value(templateFC.FindField("PlotAtScale")).ToString(), out Plot);

                            double OrientConf;
                            result = double.TryParse(tempFeature.get_Value(templateFC.FindField("OrientationConfidenceDegrees")).ToString(), out OrientConf);

                            int RuleID;
                            result = int.TryParse(tempFeature.get_Value(templateFC.FindField("RuleID")).ToString(), out RuleID);

                            string DataSourceID = commonFunctions.GetCurrentDataSourceID();

                            int SymbolRot = 360 - theStrike;

                            IPoint Shape = new PointClass();
                            Shape.X = measurementLocationX;
                            Shape.Y = measurementLocationY;

                            // Remove the temporary Feature
                            tempFeature.Delete();

                            // Create the new feature
                            OrientationPointsAccess OdpAccess = new OrientationPointsAccess(ArcMap.Editor.EditWorkspace);
                            OdpAccess.NewOrientationPoint(StationID, Type, IDConf, Label, Plot, (double)theStrike, (double)theDip, OrientConf, Notes, DataSourceID, SymbolRot, RuleID, Shape);
                            OdpAccess.SaveOrientationPoints();

                            // Refresh the Active View
                            ArcMap.Document.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, theCurrentTemplate.Layer, null);
                        }
                        catch
                        {
                            MessageBox.Show("Create feature didn't work.", "NCGMP Tools");
                            numberOfClicks = 0;
                            System.Windows.Forms.Cursor locCursor = new System.Windows.Forms.Cursor(GetType(), "Cursors.StationLocCursor.cur");
                            Cursor = locCursor;
                            return;
                        }
                    }
                    else
                    {
                        // User needs to select a relevant feature template
                        MessageBox.Show("Please select a valid feature template to digitize structural measurements.", "NCGMP Tools");
                    }

                    // Finished successfully, reset the counter and cursor
                    numberOfClicks = 0;
                    System.Windows.Forms.Cursor theLocCursor = new System.Windows.Forms.Cursor(GetType(), "Cursors.StationLocCursor.cur");
                    Cursor = theLocCursor;
                    break;

                default:
                    // Don't do anything here, preventing any more input before the dip is entered and the counter resets
                    break;
                }
            }
        }