void UpdateList(int SortKey) { if (items == null) { return; } ((ListView)ControlDictionary["resultListView"]).BeginUpdate(); ((ListView)ControlDictionary["resultListView"]).Items.Clear(); if (items.Count == 0) { goto endupdate; } ReportComparer rc = new ReportComparer(SortKey); items.Sort(rc); for (int i = 0; i < items.Count; ++i) { ((ListView)ControlDictionary["resultListView"]).Items.Add(((Report)items[i]).ToListItem()); } if (total != null) { ((ListView)ControlDictionary["resultListView"]).Items.Add(new ListViewItem("")); ((ListView)ControlDictionary["resultListView"]).Items.Add(total.ToListItem()); } endupdate: ((ListView)ControlDictionary["resultListView"]).EndUpdate(); }
static void Main(string[] args) { Console.WriteLine("Start - GeoPosition comparison"); string bingKey = " "; string azureKey = " "; string googleKey = " "; string argisKey = " "; List <SourceAddress> addressList = DataTest.GetAddress(); IReport reportComparer = new ReportComparer(); AzureMapsGeocodeMethodType azureMapsGeocodeMethodType = AzureMapsGeocodeMethodType.GeocodeSearchAddress; BingMapsGeocodeMethodType bingMapsGeocodeMethodType = BingMapsGeocodeMethodType.GeocodeFindLocationByQuery; GoogleGeocodeMethodType googleGeocodeMethodType = GoogleGeocodeMethodType.AddressAndComponentsWithPostalCode; AzureProvider azureMapsGeocoder = new AzureProvider(azureKey, azureMapsGeocodeMethodType, reportComparer); BingProvider bingMapsGeocoder = new BingProvider(bingKey, bingMapsGeocodeMethodType, reportComparer); GoogleProvider googleGeocoder = new GoogleProvider(googleKey, googleGeocodeMethodType, reportComparer); CartociudadProvider cartociudadGeocoder = new CartociudadProvider(reportComparer); ArcGisProvider arcGisProvider = new ArcGisProvider(argisKey, reportComparer); foreach (var address in addressList) { azureMapsGeocoder.GeocodeAsync(address).Wait(); bingMapsGeocoder.GeocodeAsync(address).Wait(); googleGeocoder.GeocodeAsync(address).Wait(); cartociudadGeocoder.GeocodeAsync(address).Wait(); arcGisProvider.GeocodeAsync(address).Wait(); } Console.WriteLine("End"); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Start - GeoPosition comparison"); string bingKey = "bing-key"; string azureKey = "azure-key"; List <string> addressList = DataTest.GetAddress(); IReport reportComparer = new ReportComparer(); AzureProvider azureMaps = new AzureProvider(azureKey, reportComparer); BingProvider bingMaps = new BingProvider(bingKey, reportComparer); foreach (string address in addressList) { azureMaps.GeoPositionAsync(address).Wait(); bingMaps.GeoPositionAsync(address).Wait(); } Console.WriteLine("End"); Console.ReadLine(); }
void UpdateList(int SortKey) { if (items == null) { return; } // clear it here store = new TreeStore (typeof (string), typeof (string), typeof (string), typeof (string)); if (items.Count == 0) { return; } ReportComparer rc = new ReportComparer(SortKey); items.Sort(rc); for (int i = 0; i < items.Count; ++i) { string[] tmp = ((Report)items[i]).ToListItem(); store.AppendValues (tmp[0], tmp[1], tmp[2], tmp[3]); } if (total != null) { store.AppendValues ("", "", "", ""); string[] tmp = total.ToListItem(); store.AppendValues (tmp[0], tmp[1], tmp[2], tmp[3]); } resultListView.Model = store; resultListView.HeadersClickable = true; }