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 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); }
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); } }
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); }
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); } }
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); }
void ProcessClear (RoleManagerSection section, SettingsMappingWhatContents how) { section.Providers.Clear (); }
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); }
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); }
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); }
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 (); }
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 ProcessClear (MembershipSection section, SettingsMappingWhatContents how) { section.Providers.Clear (); }