Beispiel #1
0
		public SettingsMapping (XPathNavigator nav)
		{
			_sectionTypeName = nav.GetAttribute ("sectionType", String.Empty);
			_mapperTypeName = nav.GetAttribute ("mapperType", String.Empty);

			EnumConverter cvt = new EnumConverter (typeof (SettingsMappingPlatform));
			_platform = (SettingsMappingPlatform) cvt.ConvertFromInvariantString (nav.GetAttribute ("platform", String.Empty));

			LoadContents (nav);
		}
        public SettingsMapping(XPathNavigator nav)
        {
            _sectionTypeName = nav.GetAttribute("sectionType", String.Empty);
            _mapperTypeName  = nav.GetAttribute("mapperType", String.Empty);

            EnumConverter cvt = new EnumConverter(typeof(SettingsMappingPlatform));

            _platform = (SettingsMappingPlatform)cvt.ConvertFromInvariantString(nav.GetAttribute("platform", String.Empty));

            LoadContents(nav);
        }
Beispiel #3
0
        static public void Init()
        {
            if (_instance != null)
            {
                return;
            }

            if (Environment.GetEnvironmentVariable("MONO_ASPNET_INHIBIT_SETTINGSMAP") != null)
            {
                return;
            }

            NameValueCollection appSettings = WebConfigurationManager.AppSettings;

            if (appSettings != null)
            {
                string inhibit = appSettings ["MonoAspnetInhibitSettingsMap"];
                if (String.Compare(inhibit, "true", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    return;
                }
            }

            if (IsRunningOnWindows)
            {
                _myPlatform = SettingsMappingPlatform.Windows;
            }
            else
            {
                _myPlatform = SettingsMappingPlatform.Unix;
            }

            SettingsMappingManager mapper = new SettingsMappingManager();

            mapper.LoadMappings();

            if (mapper.HasMappings)
            {
                _instance       = mapper;
                _mappedSections = new Dictionary <object, object> ();
            }
        }
		static public void Init ()
		{
			if (_instance != null)
				return;
			
			if (Environment.GetEnvironmentVariable ("MONO_ASPNET_INHIBIT_SETTINGSMAP") != null)
				return;
				
			NameValueCollection appSettings = WebConfigurationManager.AppSettings;
			if (appSettings != null) {
				string inhibit = appSettings ["MonoAspnetInhibitSettingsMap"];
				if (String.Compare (inhibit, "true", StringComparison.OrdinalIgnoreCase) == 0)
					return;
			}

			if (IsRunningOnWindows)
				_myPlatform = SettingsMappingPlatform.Windows;
			else
				_myPlatform = SettingsMappingPlatform.Unix;
		
			SettingsMappingManager mapper = new SettingsMappingManager ();
			mapper.LoadMappings ();

			if (mapper.HasMappings) {
				_instance = mapper;
				_mappedSections = new Dictionary <object, object> ();
			}
		}