Inheritance: System.Windows.Forms.Form
コード例 #1
0
		public override void OnClick()
		{
			//Get a name for bookmark from the user
			frmBookmark frm = new frmBookmark();
			frm.ShowDialog();
			int check = frm.Check; 
			string sName = "";	
	
			//OK button pressed					
			if (check == 1)
			{
				sName = frm.Bookmark;
			}
			if (sName == "") return;
			

			//Get the focus map 
			IActiveView activeView = (IActiveView) m_HookHelper.FocusMap;

			//Create a new bookmark 
			IAOIBookmark bookmark = new AOIBookmarkClass();
			//Set the location to the current extent of the focus map
			bookmark.Location = activeView.Extent;
			//Set the bookmark name
			bookmark.Name = sName;

			//Get the bookmark collection of the focus map
			IMapBookmarks mapBookmarks = (IMapBookmarks) m_HookHelper.FocusMap;
			//Add the bookmark to the bookmarks collection
			mapBookmarks.AddBookmark(bookmark);
		}
コード例 #2
0
        public override void OnClick()
        {
            //Get a name for bookmark from the user
            frmBookmark frm = new frmBookmark();

            frm.ShowDialog();
            int    check = frm.Check;
            string sName = "";

            //OK button pressed
            if (check == 1)
            {
                sName = frm.Bookmark;
            }
            if (sName == "")
            {
                return;
            }


            //Get the focus map
            IActiveView activeView = (IActiveView)m_HookHelper.FocusMap;

            //Create a new bookmark
            IAOIBookmark bookmark = new AOIBookmarkClass();

            //Set the location to the current extent of the focus map
            bookmark.Location = activeView.Extent;
            //Set the bookmark name
            bookmark.Name = sName;

            //Get the bookmark collection of the focus map
            IMapBookmarks mapBookmarks = (IMapBookmarks)m_HookHelper.FocusMap;

            //Add the bookmark to the bookmarks collection
            mapBookmarks.AddBookmark(bookmark);
        }