/////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// public MapServiceInfoWrap(MapServiceInfo settings, UserMapServiceInfo userSettings) { Debug.Assert(settings != null); Debug.Assert(userSettings != null); _settings = settings; _userSettings = userSettings; }
/////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// private List <MapServiceInfoWrap> _CreateServices(MapInfo settings, UserMapInfo userSettings) { Debug.Assert(settings != null); Debug.Assert(userSettings != null); if (userSettings.Services == null) { userSettings.Services = new List <UserMapServiceInfo>(); } List <UserMapServiceInfo> userServices = userSettings.Services; List <MapServiceInfoWrap> wrapServices = new List <MapServiceInfoWrap>(); foreach (MapServiceInfo info in settings.Services) { if (!String.IsNullOrEmpty(info.Name)) { UserMapServiceInfo userInfo = _FindServiceInfo(info.Name, userServices); if (userInfo == null) { userInfo = new UserMapServiceInfo(); userInfo.Name = info.Name; userInfo.IsVisible = info.IsVisible; userInfo.Opacity = info.Opacity; userServices.Add(userInfo); } MapServiceInfoWrap wrap = new MapServiceInfoWrap(info, userInfo); wrapServices.Add(wrap); } else { Logger.Warning("Map service configuration error: invalid name."); } } return(wrapServices); }
private static UserMapServiceInfo _FindServiceInfo(string name, List <UserMapServiceInfo> coll) { Debug.Assert(name != null); Debug.Assert(coll != null); UserMapServiceInfo resInfo = null; foreach (UserMapServiceInfo info in coll) { if (!String.IsNullOrEmpty(info.Name) && info.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)) { resInfo = info; break; } } return(resInfo); }