Ejemplo n.º 1
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        public MapServiceInfoWrap(MapServiceInfo settings,
            UserMapServiceInfo userSettings)
        {
            Debug.Assert(settings != null);
            Debug.Assert(userSettings != null);

            _settings = settings;
            _userSettings = userSettings;
        }
Ejemplo n.º 2
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        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;
        }