public ToolAddControlPoints()
        {
            //
            // TODO: Define values for the public properties
            //
            base.m_category = "CustomCE";                      //localizable text
            base.m_caption  = "添加控制点";                         //localizable text
            base.m_message  = "添加控制点";                         //localizable text
            base.m_toolTip  = "添加控制点";                         //localizable text
            base.m_name     = "CustomCE.ToolAddControlPoints"; //unique id, non-localizable (e.g. "MyCategory_MyTool")
            try
            {
                //
                // TODO: change resource name if necessary
                //
                string bitmapResourceName = GetType().Name + ".bmp";
                base.m_bitmap = new Bitmap(GetType(), bitmapResourceName);
                base.m_cursor = new System.Windows.Forms.Cursor(GetType(), GetType().Name + ".cur");
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap");
            }
            FrmLinkTableRaster frm = m_FrmLinkTableRaster;

            frm.pRasterLayer            = pRasterLayer;
            frm.TargetPoints            = TargetPoints;
            frm.OriginPoints            = OriginPoints;
            frm.TransformedOriginPoints = TransformedOriginPoints;
            //frm.pMapCtr = (((IToolbarControl)m_hookHelper.Hook).Buddy) as IMapControl2;
            //frm.Show();
            frm.Owner =
                System.Windows.Forms.Form.FromChildHandle(User32API.GetCurrentWindowHandle()) as System.Windows.Forms.Form;
        }
Beispiel #2
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (hook == null)
            {
                return;
            }

            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;
            IMapControl2 pMapCtr = (((IToolbarControl)m_hookHelper.Hook).Buddy) as IMapControl2;

            if (pMapCtr != null)
            {
                pMap = pMapCtr.Map;
            }
            IPageLayoutControl pLayoutCtr = (((IToolbarControl)m_hookHelper.Hook).Buddy) as IPageLayoutControl;

            if (pLayoutCtr != null)
            {
                pMap = pLayoutCtr.ActiveView.FocusMap;
            }
            frmAddTINNode.Owner =
                System.Windows.Forms.Form.FromChildHandle(User32API.GetCurrentWindowHandle()) as System.Windows.Forms.Form;
            // TODO:  Add toolAddTinNode.OnCreate implementation
        }
Beispiel #3
0
        public static void RemoveProjectPathToWindowTitle()
        {
            var    handler = User32API.GetCurrentWindowHandle();
            string name    = User32API.GetWindowTitle(handler);

            string path = Directory.GetCurrentDirectory();

            User32API.SetWindowText(handler, name.Replace(" - " + path, ""));
        }
Beispiel #4
0
        public static void AddProjectPathToWindowTitle()
        {
            var    handler = User32API.GetCurrentWindowHandle();
            string name    = User32API.GetWindowTitle(handler);

            string path = Directory.GetCurrentDirectory();

            if (name.Contains(path))
            {
                return;
            }

            User32API.SetWindowText(handler, name + " - " + path);
        }
Beispiel #5
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;

            // TODO:  Add ToolNewDisplacement.OnCreate implementation
            IMapControl2 pMapCtr = (((IToolbarControl)m_hookHelper.Hook).Buddy) as IMapControl2;

            //m_NewLineFeedback.Display = pMapCtr.ActiveView.ScreenDisplay;
            //m_FrmVectorLinkTable.OriginPoints = OriginPoints;
            //m_FrmVectorLinkTable.TargetPoints = TargetPoints;
            m_FrmVectorLinkTable.IMUFeatureList             = m_IMUFeatureList;
            m_FrmVectorLinkTable.CenterlinePointFeatureList = m_CenterlinePointFeatureList;
            m_FrmVectorLinkTable.MapCtr = pMapCtr;
            //m_FrmVectorLinkTable.refreshLayer += new RefreshEvent(RefreshLayer);

            if (m_FrmVectorLinkTable != null)
            {
                m_FrmVectorLinkTable.Owner =
                    System.Windows.Forms.Form.FromChildHandle(User32API.GetCurrentWindowHandle()) as System.Windows.Forms.Form;
            }

            IExtensionManager extensionManager = ((IHookHelper2)m_hookHelper).ExtensionManager;
            UID guid = new UIDClass();

            guid.Value = "{E07B4C52-C894-4558-B8D4-D4050018D1DA}"; //Snapping extension.
            IExtension extension = extensionManager.FindExtension(guid);

            m_SnappingEnvironment = extension as ISnappingEnvironment;

            m_snappingFeed = new SnappingFeedbackClass();
            m_snappingFeed.Initialize(hook, m_SnappingEnvironment, true);
        }
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_hookHelper.Hook = hook;

            // TODO:  Add ToolNewDisplacement.OnCreate implementation
            IMapControl2 pMapCtr = (((IToolbarControl)m_hookHelper.Hook).Buddy) as IMapControl2;

            //m_NewLineFeedback.Display = pMapCtr.ActiveView.ScreenDisplay;
            m_FrmVectorLinkTable.OriginPoints = OriginPoints;
            m_FrmVectorLinkTable.TargetPoints = TargetPoints;
            m_FrmVectorLinkTable.MapCtr       = pMapCtr;
            //m_FrmVectorLinkTable.refreshLayer += new RefreshEvent(RefreshLayer);

            if (m_FrmVectorLinkTable != null)
            {
                m_FrmVectorLinkTable.Owner =
                    System.Windows.Forms.Form.FromChildHandle(User32API.GetCurrentWindowHandle()) as System.Windows.Forms.Form;
            }
        }
        /// <summary>
        /// Occurs when this tool is clicked
        /// </summary>
        public override void OnClick()
        {
            // TODO: Add ToolEditFeatures.OnClick implementation
            ISceneControl pSceneCtr = (((IToolbarControl)m_hookHelper.Hook).Buddy) as ISceneControl;
            IMapControl2  pMapCtr   = (((IToolbarControl)m_hookHelper.Hook).Buddy) as IMapControl2;

            // FrmEdit3DFeatures FrmEditFeatures = new FrmEdit3DFeatures();
            if (FrmEditFeatures == null)
            {
                FrmEditFeatures = new FrmEdit3DFeatures();
            }
            if (FrmEditFeatures.IsDisposed == true)
            {
                FrmEditFeatures = new FrmEdit3DFeatures();
            }
            FrmEditFeatures.psecontrol  = ((ArrayList)m_controls)[1];
            FrmEditFeatures.pmapcontrol = ((ArrayList)m_controls)[0];
            FrmEditFeatures.pTinLayer   = pTinLayer;
            FrmEditFeatures.m_SceneCtrl = pSceneCtr;
            FrmEditFeatures.m_MapCtrl   = pMapCtr;
            FrmEditFeatures.Show();
            FrmEditFeatures.Owner =
                System.Windows.Forms.Form.FromHandle(User32API.GetCurrentWindowHandle()) as System.Windows.Forms.Form;
        }