예제 #1
0
        bool GetCommonAttributes(SettingsMappingWhatContents how, out string name, out string type)
        {
            name = type = null;

            Dictionary <string, string> attrs = how.Attributes;

            if (attrs == null || attrs.Count == 0)
            {
                return(false);
            }

            if (!attrs.TryGetValue("name", out name))
            {
                return(false);
            }

            if (String.IsNullOrEmpty(name))
            {
                return(false);
            }

            attrs.TryGetValue("type", out type);

            return(true);
        }
예제 #2
0
        void SetProviderProperties(SettingsMappingWhatContents how, ProviderSettings prov)
        {
            Dictionary <string, string> attrs = how.Attributes;

            if (attrs == null || attrs.Count == 0)
            {
                return;
            }

            string key;

            foreach (KeyValuePair <string, string> kvp in attrs)
            {
                key = kvp.Key;
                if (key == "name")
                {
                    continue;
                }
                if (key == "type")
                {
                    prov.Type = kvp.Value;
                    continue;
                }
                prov.Parameters [key] = kvp.Value;
            }
        }
        void RemoveAssembly(CompilationSection section, SettingsMappingWhatContents how)
        {
            Dictionary <string, string> attrs = how.Attributes;
            if (attrs == null || attrs.Count == 0)
                return;

            string assemblyName;
            if (!attrs.TryGetValue ("assembly", out assemblyName))
                return;

            section.Assemblies.Remove (assemblyName);
        }
예제 #4
0
        void ProcessReplace(MembershipSection section, SettingsMappingWhatContents how)
        {
            string name, type;

            if (!GetCommonAttributes(how, out name, out type))
            {
                return;
            }

            ProviderSettings provider = section.Providers [name];

            if (provider != null)
            {
                SetProviderProperties(how, provider);
            }
        }
예제 #5
0
		bool GetCommonAttributes (SettingsMappingWhatContents how, out string name, out string type)
		{
			name = type = null;
			
			Dictionary <string, string> attrs = how.Attributes;
			
			if (attrs == null || attrs.Count == 0)
				return false;

			if (!attrs.TryGetValue ("name", out name))
				return false;

			if (String.IsNullOrEmpty (name))
				return false;

			attrs.TryGetValue ("type", out type);

			return true;
		}
        void AddControl(PagesSection section, SettingsMappingWhatContents how)
        {
            Dictionary <string, string> attrs = how.Attributes;
            if (attrs == null || attrs.Count == 0)
                return;

            string tagPrefix, nameSpace, asm, tagName, source;
            if (!attrs.TryGetValue ("tagPrefix", out tagPrefix))
                tagPrefix = String.Empty;
            if (!attrs.TryGetValue ("namespace", out nameSpace))
                nameSpace = String.Empty;
            if (!attrs.TryGetValue ("assembly", out asm))
                asm = String.Empty;
            if (!attrs.TryGetValue ("tagName", out tagName))
                tagName = String.Empty;
            if (!attrs.TryGetValue ("src", out source))
                source = String.Empty;

            TagPrefixInfo info = new TagPrefixInfo (tagPrefix, nameSpace, asm, tagName, source);
            section.Controls.Add (info);
        }
예제 #7
0
        void ProcessRemove(MembershipSection section, SettingsMappingWhatContents how)
        {
            string name, type;

            if (!GetCommonAttributes(how, out name, out type))
            {
                return;
            }

            ProviderSettingsCollection providers = section.Providers;
            ProviderSettings           provider  = providers [name];

            if (provider != null)
            {
                if (provider.Type != type)
                {
                    return;
                }
                providers.Remove(name);
            }
        }
예제 #8
0
        void ProcessAdd(MembershipSection section, SettingsMappingWhatContents how)
        {
            string name, type;

            if (!GetCommonAttributes(how, out name, out type))
            {
                return;
            }

            ProviderSettingsCollection providers = section.Providers;
            ProviderSettings           provider  = providers [name];

            if (provider != null)
            {
                return;
            }

            ProviderSettings prov = new ProviderSettings(name, type);

            SetProviderProperties(how, prov);

            providers.Add(prov);
        }
예제 #9
0
		void ProcessClear (RoleManagerSection section, SettingsMappingWhatContents how)
		{
			section.Providers.Clear ();
		}
예제 #10
0
		void ProcessReplace (RoleManagerSection section, SettingsMappingWhatContents how)
		{
			string name, type;
			if (!GetCommonAttributes (how, out name, out type))
				return;

			ProviderSettings provider = section.Providers [name];
			if (provider != null)
				SetProviderProperties (how, provider);
		}
예제 #11
0
		void ProcessAdd (RoleManagerSection section, SettingsMappingWhatContents how)
		{
			string name, type;
			if (!GetCommonAttributes (how, out name, out type))
				return;

			ProviderSettingsCollection providers = section.Providers;
			ProviderSettings provider = providers [name];
			if (provider != null)
				return;

			ProviderSettings prov = new ProviderSettings (name, type);
			SetProviderProperties (how, prov);
			
			providers.Add (prov);
		}
예제 #12
0
		void ProcessRemove (RoleManagerSection section, SettingsMappingWhatContents how)
		{
			string name, type;
			if (!GetCommonAttributes (how, out name, out type))
				return;

			ProviderSettingsCollection providers = section.Providers;
			ProviderSettings provider = providers [name];
			if (provider != null) {
				if (provider.Type != type)
					return;
				providers.Remove (name);
			}
		}
 void ProcessClear(RoleManagerSection section, SettingsMappingWhatContents how)
 {
     section.Providers.Clear();
 }
 void ProcessAdd(string val, PagesSection section, SettingsMappingWhatContents how)
 {
     if (val == "controls")
         AddControl (section, how);
 }
예제 #15
0
 void ProcessClear(MembershipSection section, SettingsMappingWhatContents how)
 {
     section.Providers.Clear();
 }
 void ProcessRemove(string val, CompilationSection section, SettingsMappingWhatContents how)
 {
     if (val == "assemblies")
         RemoveAssembly (section, how);
 }
 void ProcessClear(string val, PagesSection section, SettingsMappingWhatContents how)
 {
     if (val == "controls")
         section.Controls.Clear ();
     else if (val == "tagMapping")
         section.TagMapping.Clear ();
 }
예제 #18
0
		void SetProviderProperties (SettingsMappingWhatContents how, ProviderSettings prov)
		{
			Dictionary <string, string> attrs = how.Attributes;
			if (attrs == null || attrs.Count == 0)
				return;

			string key;
			foreach (KeyValuePair <string, string> kvp in attrs) {
				key = kvp.Key;
				if (key == "name")
					continue;
				if (key == "type") {
					prov.Type = kvp.Value;
					continue;
				}
				prov.Parameters [key] = kvp.Value;
			}
		}
예제 #19
0
		void ProcessClear (MembershipSection section, SettingsMappingWhatContents how)
		{
			section.Providers.Clear ();
		}