Community of VE/MapPoint Users and Developers
This is a discussion on ForAllPushpins utility and C# source code within the News and Announcements forums, part of the Map Forums category; From a posting to the MapPoint newsgroup by Gilles Kohl -- Dear all, I've made a small utility available that ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| ForAllPushpins utility and C# source code Dear all, I've made a small utility available that nicely illustrates the power of .NET 2.0 iterators and (anonymous) delegates. While mainly meant as a tool for the MapPoint programmer, the demo sample can be useful on its own - I'm attaching the contents of the README.TXT file also found in the archive. ForAllPushpins.zip can be downloaded here: http://www.gilleskohl.de/mappoint/ForAllPushpins.zip (or via my MVP profile, as always) Regards, Gilles [MVP]. (Please reply to the group, not via email. Find my MVP profile with past articles / downloads here: http://www.gilleskohl.de/mvpprofile.htm) ForAllPushpins sample application --------------------------------- This archive serves two audiences: - non-programmers get a useful utility that can - show or hide the pushpin balloons for all pushpins of all datasets, (or only for selected datasets) - copy their coordinates to the clipboard. - programmers get a "PushpinIterator" class that has - a reusable .NET 2.0 style iterator to loop over all pushpins of all datasets - methods that call a delegate for all datasets, or all pushpins of a given dataset (very handy in combination with anonymous delegates) Non-Programmers --------------- If you'd just like to use the sample app as-is, copy the contents of the "Application" folder to your HD, and launch "ForAllPushpins.exe". (.NET runtime 2.0 required - download from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en ) If you already have MapPoint (with some datasets) running, they will be reflected in the top listbox. Otherwise, import some pushpins (or add manually) and press the "Update" button to refresh the list. Select the pushpin set on which you'd like to do some operation (e.g. "My Pushpins"), and select the operation you would like to perform (e.g. "Show all balloons"). Click "Go!" to see it happen. Programmers ----------- If you are a developer and would like to see how it is done, extend the functionality of the app or just reuse the "PushpinIterator" helper class, the source code is included, just open ForAllPushpins.sln in the "SourceCode" folder. Feel welcome to extend the functionality in "ForAllPushpinsSampleOperations.cs". The working horse that you can recycle is the PushPinIterator.cs Here is e.g. how you would iterate over all pushpins in all datasets: Code: // create a MapPoint.Application object mpApp, e.g.
MapPoint.ApplicationClass mpApp = new MapPoint.ApplicationClass();
// create the iterator object (do this once, after instantiating MapPoint)
PushpinIterator pushpinIterator = new PushpinIterator(mpApp);
// loop over all pushpins
foreach(MapPoint.Pushpin pushpin in pushpinIterator.AllPushpins)
{
// do something with the pushpin here
}
|
![]() |
| ||||
| Posted By | For | Type | Date | |
| Working With Excel and MapPoint - MP2K Magazine | This thread | Refback | 07-28-2007 01:50 AM | |
| Indiatimes Email Service | This thread | Refback | 07-19-2007 01:53 PM | |
| Microsoft MapPoint 2006 - MP2K Magazine | This thread | Refback | 07-18-2007 02:54 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Utility to move pushpins to correct side of street | Anonymous | MapPoint 2006/2009 Discussion | 5 | 07-07-2008 07:59 AM |
| Help with utility for Mappoint and Google Earth | radioman99 | MapPoint 2006/2009 Discussion | 1 | 09-04-2006 11:51 AM |
| Shapefile Import Utility | Anonymous | MapPoint 2006/2009 Discussion | 1 | 12-17-2004 03:34 PM |
| Winwaed releases v1.1 of the GridImp utility | Winwaed | News and Announcements | 0 | 10-11-2004 09:24 AM |
| Which data source to use ? | Anonymous | MapPoint 2006/2009 Discussion | 0 | 07-07-2004 05:03 AM |
Flight Departures
Check Holiday Hypermarket to find flight departures to numerous exotic destinations. We link to details on flight departures and arrivals to help you find information fast.
Flights to Turkey
Find cheap flights to Turkey on Travel Counsellors. A personal Travel Counsellor can help you plan flights and find accommodation in Turkey.
Holidays Italy
Book your holidays in Italy. Italy has a great climate and the beaches to go with it. Book a great deal for great value online at dealchecker.co.uk.
All Inclusive Maldives
Visit The Holiday Place.co.uk for great deals on all inclusive holidays to the Maldives. Book a holiday to the outstandingly beautiful Maldives.
Tunisia
Tunisia enjoys excellent weather, golden beaches and a beautiful blue sea. Moving away from the beach you will find a country that has a rich and varied past. Discover the secrets of history yourself by exploring all the ruins.
Family package holidays
Save a lot of time and opt for one of the great family package holidays at Travel.co.uk
Florida Holidays
Take a sunny holiday break! Find info on Florida holidays at On The Beach!