private static GeoDataGlobals Load() { GeoDataGlobals retVal = null; // Don't initialize here, it will be set up with a default in case all other methods fail! AppSettingsReader reader = new AppSettingsReader(); retVal = new GeoDataGlobals(); try { retVal.BingMapsKey = (String)reader.GetValue("BingMapsKey", typeof(String)); } catch (InvalidOperationException) { } try { retVal.DefaultLocation = new GeoPoint((String)reader.GetValue("DefaultLocation", typeof(String))); } catch (InvalidOperationException) { } catch (ArgumentException) { } return(retVal); }
private static GeoDataGlobals Load() { GeoDataGlobals retVal = null; // Don't initialize here, it will be set up with a default in case all other methods fail! AppSettingsReader reader = new AppSettingsReader(); retVal = new GeoDataGlobals(); try { retVal.BingMapsKey = (String)reader.GetValue("BingMapsKey", typeof(String)); } catch ( InvalidOperationException ) { } try { retVal.DefaultLocation = new GeoPoint((String)reader.GetValue("DefaultLocation", typeof(String))); } catch ( InvalidOperationException ) { } catch ( ArgumentException ) { } return retVal; }