Browse Source

2005-12-04 Chris Toshok <[email protected]>

	* UrlMapping.cs: add an internal argument-less ctor.

	* UrlMappingCollection.cs (CreateNewElement): use argument-less
	ctor.
	(GetKey): implement.
	(AllKeys): implement.

	* TrustLevel.cs: add an internal argument-less ctor.
	
	* TrustLevelCollection.cs (Set): implement.
	(CreateNewElement): use argument-less ctor.
	(IsElementName): implement.
	(ElementName): implement.
	(set_Item (int index)): use Set.
	(ThrowOnDuplicate): implement.
	
	* TagPrefixInfo.cs: add internal argument-less ctor.

	* TagPrefixCollection.cs (CreateNewElement): call argument-less
	ctor.
	(CollectionType): add text to TODO.
	(ElementName): implement.
	
	* SqlCacheDependencyDatabaseCollection.cs (Set): implement.
	(AllKeys): implement.

	* RuleSettings.cs: add internal argument-less ctor.

	* RuleSettingsCollection.cs (Contains): implement.
	(CreateNewElement): use argument-less ctor.
	(IndexOf): implement.
	(Insert): implement.

	* RootProfilePropertySettingsCollection.cs (IsModified): chain up
	to base.IsModified for now.
	(Reset): chain up to base.Reset for now.
	(ResetModified): chain up to base.ResetModified for now.

	* ProfileSettings.cs: add internal argument-less ctor.

	* ProfileSettingsCollection.cs (Contains): implement.
	(CreateNewElement): use argument-less ctor.
	(IndexOf): implement.
	(Insert): implement.
	
	* ProfilePropertySettingsCollection.cs (IndexOf): implement.
	(Set): implement.
	(AllKeys): implement.
	
	* ProfileGroupSettings.cs: add internal argument-less ctor.

	* ProfileGroupSettingsCollection.cs (CreateNewElement): use
	parameter-less ctor.
	(GetKey): implement.
	(ResetModified): for now call base.ResetModified.
	(Set): implement.
	(AllKeys): implement.
	
	* OutputCacheProfile.cs: add internal argument-less ctor.

	* OutputCacheProfileCollection.cs (CreateNewElement): use
	parameter-less ctor.
	(Set): implement.
	(AllKeys): implement.

	* HttpModuleActionCollection.cs (Add): remove MonoTODO.
	(CreateNewElement): same.
	
	* HttpHandlerActionCollection.cs (GetElementKey): build up the key
	from both the path and the verb.
	(Remove): same.

	* FormsAuthenticationUserCollection.cs (Set): implement.
	(AllKeys): implement.

	* EventMappingSettings.cs: add an internal argument-less ctor.

	* EventMappingSettingsCollection.cs (Contains): implement.
	(CreateNewElement): use argument-less ctor.
	(IndexOf): implement.
	(Insert): implement.

	* CompilerCollection.cs (GetKey): implement.
	(AllKeys): implement.

	* ClientTargetCollection.cs (GetKey): implement.
	(AllKeys): implement.

	* AuthorizationRuleCollection.cs (Set): implement.
	(ElementName): add some text to the MonoTODO.
	(set_Item (int index)): use Set.


svn path=/trunk/mcs/; revision=53909
Chris Toshok 20 years ago
parent
commit
d747c896bc
26 changed files with 286 additions and 98 deletions
  1. 5 4
      mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationRuleCollection.cs
  2. 94 0
      mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
  3. 8 5
      mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetCollection.cs
  4. 9 4
      mcs/class/System.Web/System.Web.Configuration_2.0/CompilerCollection.cs
  5. 4 0
      mcs/class/System.Web/System.Web.Configuration_2.0/EventMappingSettings.cs
  6. 9 6
      mcs/class/System.Web/System.Web.Configuration_2.0/EventMappingSettingsCollection.cs
  7. 14 4
      mcs/class/System.Web/System.Web.Configuration_2.0/FormsAuthenticationUserCollection.cs
  8. 3 5
      mcs/class/System.Web/System.Web.Configuration_2.0/HttpHandlerActionCollection.cs
  9. 0 2
      mcs/class/System.Web/System.Web.Configuration_2.0/HttpModuleActionCollection.cs
  10. 4 0
      mcs/class/System.Web/System.Web.Configuration_2.0/OutputCacheProfile.cs
  11. 18 6
      mcs/class/System.Web/System.Web.Configuration_2.0/OutputCacheProfileCollection.cs
  12. 4 1
      mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettings.cs
  13. 19 8
      mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettingsCollection.cs
  14. 15 6
      mcs/class/System.Web/System.Web.Configuration_2.0/ProfilePropertySettingsCollection.cs
  15. 4 0
      mcs/class/System.Web/System.Web.Configuration_2.0/ProfileSettings.cs
  16. 9 7
      mcs/class/System.Web/System.Web.Configuration_2.0/ProfileSettingsCollection.cs
  17. 3 3
      mcs/class/System.Web/System.Web.Configuration_2.0/RootProfilePropertySettingsCollection.cs
  18. 4 0
      mcs/class/System.Web/System.Web.Configuration_2.0/RuleSettings.cs
  19. 9 7
      mcs/class/System.Web/System.Web.Configuration_2.0/RuleSettingsCollection.cs
  20. 17 5
      mcs/class/System.Web/System.Web.Configuration_2.0/SqlCacheDependencyDatabaseCollection.cs
  21. 5 9
      mcs/class/System.Web/System.Web.Configuration_2.0/TagPrefixCollection.cs
  22. 4 0
      mcs/class/System.Web/System.Web.Configuration_2.0/TagPrefixInfo.cs
  23. 4 0
      mcs/class/System.Web/System.Web.Configuration_2.0/TrustLevel.cs
  24. 8 10
      mcs/class/System.Web/System.Web.Configuration_2.0/TrustLevelCollection.cs
  25. 4 0
      mcs/class/System.Web/System.Web.Configuration_2.0/UrlMapping.cs
  26. 9 6
      mcs/class/System.Web/System.Web.Configuration_2.0/UrlMappingCollection.cs

+ 5 - 4
mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationRuleCollection.cs

@@ -98,24 +98,25 @@ namespace System.Web.Configuration {
 			BaseRemoveAt (index);
 		}
 
-		[MonoTODO]
 		public void Set (int index, AuthorizationRule rule)
 		{
-			throw new NotImplementedException ();
+			if (BaseGet(index) != null)
+				BaseRemoveAt(index);
+			BaseAdd(index, rule);
 		}
 
 		protected override ConfigurationElementCollectionType CollectionType {
 			get { return ConfigurationElementCollectionType.BasicMapAlternate; }
 		}
 
-		[MonoTODO]
+		[MonoTODO ("is it okay to return a comma delimited string here?")]
 		protected override string ElementName {
 			get { return "allow,deny"; }
 		}
 
 		public AuthorizationRule this [int index] {
 			get { return Get (index); }
-			set {  if (BaseGet(index) != null)  BaseRemoveAt(index);  BaseAdd(index, value); }
+			set { Set (index, value); }
 		}
 
 		protected override ConfigurationPropertyCollection Properties {

+ 94 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog

@@ -1,3 +1,97 @@
+2005-12-04  Chris Toshok  <[email protected]>
+
+	* UrlMapping.cs: add an internal argument-less ctor.
+
+	* UrlMappingCollection.cs (CreateNewElement): use argument-less
+	ctor.
+	(GetKey): implement.
+	(AllKeys): implement.
+
+	* TrustLevel.cs: add an internal argument-less ctor.
+	
+	* TrustLevelCollection.cs (Set): implement.
+	(CreateNewElement): use argument-less ctor.
+	(IsElementName): implement.
+	(ElementName): implement.
+	(set_Item (int index)): use Set.
+	(ThrowOnDuplicate): implement.
+	
+	* TagPrefixInfo.cs: add internal argument-less ctor.
+
+	* TagPrefixCollection.cs (CreateNewElement): call argument-less
+	ctor.
+	(CollectionType): add text to TODO.
+	(ElementName): implement.
+	
+	* SqlCacheDependencyDatabaseCollection.cs (Set): implement.
+	(AllKeys): implement.
+
+	* RuleSettings.cs: add internal argument-less ctor.
+
+	* RuleSettingsCollection.cs (Contains): implement.
+	(CreateNewElement): use argument-less ctor.
+	(IndexOf): implement.
+	(Insert): implement.
+
+	* RootProfilePropertySettingsCollection.cs (IsModified): chain up
+	to base.IsModified for now.
+	(Reset): chain up to base.Reset for now.
+	(ResetModified): chain up to base.ResetModified for now.
+
+	* ProfileSettings.cs: add internal argument-less ctor.
+
+	* ProfileSettingsCollection.cs (Contains): implement.
+	(CreateNewElement): use argument-less ctor.
+	(IndexOf): implement.
+	(Insert): implement.
+	
+	* ProfilePropertySettingsCollection.cs (IndexOf): implement.
+	(Set): implement.
+	(AllKeys): implement.
+	
+	* ProfileGroupSettings.cs: add internal argument-less ctor.
+
+	* ProfileGroupSettingsCollection.cs (CreateNewElement): use
+	parameter-less ctor.
+	(GetKey): implement.
+	(ResetModified): for now call base.ResetModified.
+	(Set): implement.
+	(AllKeys): implement.
+	
+	* OutputCacheProfile.cs: add internal argument-less ctor.
+
+	* OutputCacheProfileCollection.cs (CreateNewElement): use
+	parameter-less ctor.
+	(Set): implement.
+	(AllKeys): implement.
+
+	* HttpModuleActionCollection.cs (Add): remove MonoTODO.
+	(CreateNewElement): same.
+	
+	* HttpHandlerActionCollection.cs (GetElementKey): build up the key
+	from both the path and the verb.
+	(Remove): same.
+
+	* FormsAuthenticationUserCollection.cs (Set): implement.
+	(AllKeys): implement.
+
+	* EventMappingSettings.cs: add an internal argument-less ctor.
+
+	* EventMappingSettingsCollection.cs (Contains): implement.
+	(CreateNewElement): use argument-less ctor.
+	(IndexOf): implement.
+	(Insert): implement.
+
+	* CompilerCollection.cs (GetKey): implement.
+	(AllKeys): implement.
+
+	* ClientTargetCollection.cs (GetKey): implement.
+	(AllKeys): implement.
+
+	* AuthorizationRuleCollection.cs (Set): implement.
+	(ElementName): add some text to the MonoTODO.
+	(set_Item (int index)): use Set.
+
 2005-12-04  Chris Toshok  <[email protected]>
 
 	* CustomError.cs: add an internal argument-less ctor for use by

+ 8 - 5
mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetCollection.cs

@@ -65,10 +65,9 @@ namespace System.Web.Configuration {
 			return ((ClientTarget)element).Alias;
 		}
 
-		[MonoTODO]
 		public string GetKey (int index)
 		{
-			throw new NotImplementedException ();
+			return (string)BaseGetKey (index);
 		}
 
 		public void Remove (string name)
@@ -86,9 +85,13 @@ namespace System.Web.Configuration {
 			BaseRemoveAt (index);
 		}
 
-		[MonoTODO]
-		public String[] AllKeys {
-			get { throw new NotImplementedException (); }
+		public string[] AllKeys {
+			get {
+				string[] keys = new string[Count];
+				for (int i = 0; i < Count; i ++)
+					keys[i] = this[i].Alias;
+				return keys;
+			}
 		}
 
 		public ClientTarget this [int index] {

+ 9 - 4
mcs/class/System.Web/System.Web.Configuration_2.0/CompilerCollection.cs

@@ -70,15 +70,18 @@ namespace System.Web.Configuration
 			return ((Compiler)element).Language;
 		}
 
-		[MonoTODO]
 		public string GetKey (int index)
 		{
-			throw new NotImplementedException ();
+			return (string)BaseGetKey (index);
 		}
 
-		[MonoTODO]
 		public string[ ] AllKeys {
-			get { throw new NotImplementedException (); }
+			get {
+				string[] keys = new string[Count];
+				for (int i = 0; i < Count; i ++)
+					keys[i] = this[i].Language;
+				return keys;
+			}
 		}
 
 		protected override ConfigurationElementCollectionType CollectionType {
@@ -107,6 +110,7 @@ namespace System.Web.Configuration
 			}
 		}
 
+#region CompatabilityCode
 		[MonoTODO ("we shouldn't need this..")]
 		internal bool CompareLanguages (string lang1, string lang2)
 		{
@@ -117,6 +121,7 @@ namespace System.Web.Configuration
 		{
 			BaseAdd (compiler);
 		}
+#endregion
 	}
 }
 #endif

+ 4 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/EventMappingSettings.cs

@@ -67,6 +67,10 @@ namespace System.Web.Configuration {
 			properties.Add (typeProp);
 		}
 
+		internal EventMappingSettings ()
+		{
+		}
+
 		public EventMappingSettings (string name, string type)
 		{
 			this.Name = name;

+ 9 - 6
mcs/class/System.Web/System.Web.Configuration_2.0/EventMappingSettingsCollection.cs

@@ -55,15 +55,14 @@ namespace System.Web.Configuration {
 			BaseClear ();
 		}
 
-		[MonoTODO]
 		public bool Contains (string name)
 		{
-			throw new NotImplementedException ();
+			return BaseGet (name) != null;
 		}
 
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new EventMappingSettings ("", "");
+			return new EventMappingSettings ();
 		}
 
 		protected override object GetElementKey (ConfigurationElement element)
@@ -74,13 +73,17 @@ namespace System.Web.Configuration {
 		[MonoTODO]
 		public int IndexOf (string name)
 		{
-			throw new NotImplementedException ();
+			EventMappingSettings settings = (EventMappingSettings)BaseGet (name);
+			if (settings == null)
+				return -1; /* XXX */
+			else
+				return BaseIndexOf (settings);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("why did they use 'Insert' and not 'Add' as other collections do?")]
 		public void Insert (int index, EventMappingSettings eventMappingSettings)
 		{
-			throw new NotImplementedException ();
+			BaseAdd (index, eventMappingSettings);
 		}
 
 		public void Remove (string name)

+ 14 - 4
mcs/class/System.Web/System.Web.Configuration_2.0/FormsAuthenticationUserCollection.cs

@@ -95,16 +95,26 @@ namespace System.Web.Configuration
 			BaseRemoveAt (index);
 		}
 
-		[MonoTODO]
 		public void Set (FormsAuthenticationUser user)
 		{
-			throw new NotImplementedException ();
+			FormsAuthenticationUser existing = Get (user.Name);
+
+			if (existing == null) {
+				Add (user);
+			}
+			else {
+				int index = BaseIndexOf (existing);
+				RemoveAt (index);
+				BaseAdd (index, user);
+			}
 		}
 
-		[MonoTODO]
 		public string[ ] AllKeys {
 			get {
-				throw new NotImplementedException ();
+				string[] keys = new string[Count];
+				for (int i = 0; i < Count; i ++)
+					keys[i] = this[i].Name;
+				return keys;
 			}
 		}
 

+ 3 - 5
mcs/class/System.Web/System.Web.Configuration_2.0/HttpHandlerActionCollection.cs

@@ -66,7 +66,7 @@ namespace System.Web.Configuration
 
 		protected override object GetElementKey (ConfigurationElement element)
 		{
-			return ((HttpHandlerAction)element).Path;
+			return ((HttpHandlerAction)element).Path + "-" + ((HttpHandlerAction)element).Verb;
 		}
 
 		public int IndexOf (HttpHandlerAction action)
@@ -74,16 +74,14 @@ namespace System.Web.Configuration
 			return BaseIndexOf (action);
 		}
 
-		[MonoTODO]
 		public void Remove (string verb, string path)
 		{
-			throw new NotImplementedException ();
+			BaseRemove (path + "-" + verb);
 		}
 
-		[MonoTODO]
 		public void Remove (HttpHandlerAction action)
 		{
-			throw new NotImplementedException ();
+			BaseRemove (action.Path + "-" + action.Verb);
 		}
 
 		public void RemoveAt (int index)

+ 0 - 2
mcs/class/System.Web/System.Web.Configuration_2.0/HttpModuleActionCollection.cs

@@ -49,7 +49,6 @@ namespace System.Web.Configuration
 		{
 		}
 			
-		[MonoTODO]
 		public void Add (HttpModuleAction httpModuleAction)
 		{
 			BaseAdd (httpModuleAction);
@@ -60,7 +59,6 @@ namespace System.Web.Configuration
 			BaseClear ();
 		}
 
-		[MonoTODO]
 		protected override ConfigurationElement CreateNewElement ()
 		{
 			return new HttpModuleAction ();

+ 4 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/OutputCacheProfile.cs

@@ -83,6 +83,10 @@ namespace System.Web.Configuration {
 			properties.Add (varyByParamProp);
 		}
 
+		internal OutputCacheProfile ()
+		{
+		}
+
 		public OutputCacheProfile (string name)
 		{
 			this.Name = name;

+ 18 - 6
mcs/class/System.Web/System.Web.Configuration_2.0/OutputCacheProfileCollection.cs

@@ -58,7 +58,7 @@ namespace System.Web.Configuration {
 
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new OutputCacheProfile ("");
+			return new OutputCacheProfile ();
 		}
 
 		protected override object GetElementKey (ConfigurationElement element)
@@ -91,15 +91,27 @@ namespace System.Web.Configuration {
 			BaseRemoveAt (index);
 		}
 
-		[MonoTODO]
 		public void Set (OutputCacheProfile user)
 		{
-			throw new NotImplementedException ();
+			OutputCacheProfile existing = Get (user.Name);
+
+			if (existing == null) {
+				Add (user);
+			}
+			else {
+				int index = BaseIndexOf (existing);
+				RemoveAt (index);
+				BaseAdd (index, user);
+			}
 		}
 
-		[MonoTODO]
-		public String[] AllKeys {
-			get { throw new NotImplementedException (); }
+		public string[] AllKeys {
+			get {
+				string[] keys = new string[Count];
+				for (int i = 0; i < Count; i ++)
+					keys[i] = this[i].Name;
+				return keys;
+			}
 		}
 
 		public OutputCacheProfile this [int index] {

+ 4 - 1
mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettings.cs

@@ -58,7 +58,10 @@ namespace System.Web.Configuration
 			properties.Add (propertySettingsProp);
 		}
 
-		[MonoTODO]
+		internal ProfileGroupSettings ()
+		{
+		}
+
 		public ProfileGroupSettings (string name)
 		{
 			this.Name = name;

+ 19 - 8
mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettingsCollection.cs

@@ -61,7 +61,7 @@ namespace System.Web.Configuration
 
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new ProfileGroupSettings ("");
+			return new ProfileGroupSettings ();
 		}
 
 		public ProfileGroupSettings Get (int index)
@@ -79,10 +79,9 @@ namespace System.Web.Configuration
 			return ((ProfileGroupSettings)element).Name;
 		}
 
-		[MonoTODO]
 		public string GetKey (int index)
 		{
-			throw new NotImplementedException ();
+			return (string)BaseGetKey (index);
 		}
 
 		public int IndexOf (ProfileGroupSettings group)
@@ -109,18 +108,30 @@ namespace System.Web.Configuration
 		[MonoTODO]
 		protected override void ResetModified ()
 		{
-			throw new NotImplementedException ();
+			base.ResetModified ();
 		}
 
-		[MonoTODO]
 		public void Set (ProfileGroupSettings group)
 		{
-			throw new NotImplementedException ();
+			ProfileGroupSettings existing = Get (group.Name);
+
+			if (existing == null) {
+				Add (group);
+			}
+			else {
+				int index = BaseIndexOf (existing);
+				RemoveAt (index);
+				BaseAdd (index, group);
+			}
 		}
 
-		[MonoTODO]
 		public string[ ] AllKeys {
-			get { throw new NotImplementedException (); }
+			get {
+				string[] keys = new string[Count];
+				for (int i = 0; i < Count; i ++)
+					keys[i] = this[i].Name;
+				return keys;
+			}
 		}
 
 		protected override ConfigurationPropertyCollection Properties {

+ 15 - 6
mcs/class/System.Web/System.Web.Configuration_2.0/ProfilePropertySettingsCollection.cs

@@ -89,10 +89,9 @@ namespace System.Web.Configuration
 			return s.Name;
 		}
 
-		[MonoTODO]
 		public int IndexOf (ProfilePropertySettings propertySettings)
 		{
-			throw new NotImplementedException ();
+			return BaseIndexOf (propertySettings);
 		}
 
 		[MonoTODO]
@@ -111,16 +110,26 @@ namespace System.Web.Configuration
 			BaseRemoveAt (index);
 		}
 
-		[MonoTODO]
 		public void Set (ProfilePropertySettings propertySettings)
 		{
-			throw new NotImplementedException ();
+			ProfilePropertySettings existing = Get (propertySettings.Name);
+
+			if (existing == null) {
+				Add (propertySettings);
+			}
+			else {
+				int index = BaseIndexOf (existing);
+				RemoveAt (index);
+				BaseAdd (index, propertySettings);
+			}
 		}
 
-		[MonoTODO]
 		public string[ ] AllKeys {
 			get {
-				throw new NotImplementedException ();
+				string[] keys = new string[Count];
+				for (int i = 0; i < Count; i ++)
+					keys[i] = this[i].Name;
+				return keys;
 			}
 		}
 

+ 4 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/ProfileSettings.cs

@@ -74,6 +74,10 @@ namespace System.Web.Configuration {
 
 		}
 
+		internal ProfileSettings ()
+		{
+		}
+
 		public ProfileSettings (string name)
 		{
 			this.Name = name;

+ 9 - 7
mcs/class/System.Web/System.Web.Configuration_2.0/ProfileSettingsCollection.cs

@@ -55,15 +55,14 @@ namespace System.Web.Configuration {
 			BaseClear ();
 		}
 
-		[MonoTODO]
 		public bool Contains (string name)
 		{
-			throw new NotImplementedException ();
+			return BaseGet (name) != null;
 		}
 
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new ProfileSettings ("");
+			return new ProfileSettings ();
 		}
 
 		protected override object GetElementKey (ConfigurationElement element)
@@ -71,16 +70,19 @@ namespace System.Web.Configuration {
 			return ((ProfileSettings)element).Name;
 		}
 
-		[MonoTODO]
 		public int IndexOf (string name)
 		{
-			throw new NotImplementedException ();
+			ProfileSettings s = (ProfileSettings)BaseGet (name);
+			if (s == null)
+				return -1; /* XXX */
+			else
+				return BaseIndexOf (s);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("why did they use 'Insert' and not 'Add' as other collections do?")]
 		public void Insert (int index, ProfileSettings authorizationSettings)
 		{
-			throw new NotImplementedException ();
+			BaseAdd (index, authorizationSettings);
 		}
 
 		public void Remove (string name)

+ 3 - 3
mcs/class/System.Web/System.Web.Configuration_2.0/RootProfilePropertySettingsCollection.cs

@@ -69,7 +69,7 @@ namespace System.Web.Configuration
 		[MonoTODO]
 		protected override bool IsModified ()
 		{
-			throw new NotImplementedException ();
+			return base.IsModified ();
 		}
 
 		[MonoTODO]
@@ -81,13 +81,13 @@ namespace System.Web.Configuration
 		[MonoTODO]
 		protected override void Reset (ConfigurationElement parentElement)
 		{
-			throw new NotImplementedException ();
+			base.Reset (parentElement);
 		}
 
 		[MonoTODO]
 		protected override void ResetModified ()
 		{
-			throw new NotImplementedException ();
+			base.ResetModified ();
 		}
 
 		[MonoTODO]

+ 4 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/RuleSettings.cs

@@ -79,6 +79,10 @@ namespace System.Web.Configuration {
 			properties.Add (providerProp);
 		}
 
+		internal RuleSettings ()
+		{
+		}
+
 		public RuleSettings (string name, string eventName, string provider, string profile, int minInstances, int maxLimit, TimeSpan minInterval, string custom)
 		{
 			this.Name = name;

+ 9 - 7
mcs/class/System.Web/System.Web.Configuration_2.0/RuleSettingsCollection.cs

@@ -55,15 +55,14 @@ namespace System.Web.Configuration {
 			BaseClear ();
 		}
 
-		[MonoTODO]
 		public bool Contains (string name)
 		{
-			throw new NotImplementedException ();
+			return BaseGet (name) != null;
 		}
 
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new RuleSettings ("", "", "");
+			return new RuleSettings ();
 		}
 
 		protected override object GetElementKey (ConfigurationElement element)
@@ -71,16 +70,19 @@ namespace System.Web.Configuration {
 			return ((RuleSettings)element).Name;
 		}
 
-		[MonoTODO]
 		public int IndexOf (string name)
 		{
-			throw new NotImplementedException ();
+			RuleSettings r = (RuleSettings)BaseGet (name);
+			if (r == null)
+				return -1; /* XXX */
+			else
+				return BaseIndexOf (r);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("why did they use 'Insert' and not 'Add' as other collections do?")]
 		public void Insert (int index, RuleSettings eventSettings)
 		{
-			throw new NotImplementedException ();
+			BaseAdd (index, eventSettings);
 		}
 
 		public void Remove (string name)

+ 17 - 5
mcs/class/System.Web/System.Web.Configuration_2.0/SqlCacheDependencyDatabaseCollection.cs

@@ -86,15 +86,27 @@ namespace System.Web.Configuration {
 			BaseRemoveAt (index);
 		}
 
-		[MonoTODO]
 		public void Set (SqlCacheDependencyDatabase user)
 		{
-			throw new NotImplementedException ();
+			SqlCacheDependencyDatabase existing = Get (user.Name);
+
+			if (existing == null) {
+				Add (user);
+			}
+			else {
+				int index = BaseIndexOf (existing);
+				RemoveAt (index);
+				BaseAdd (index, user);
+			}
 		}
 
-		[MonoTODO]
-		public String[] AllKeys {
-			get { throw new NotImplementedException (); }
+		public string[] AllKeys {
+			get {
+				string[] keys = new string[Count];
+				for (int i = 0; i < Count; i ++)
+					keys[i] = this[i].Name;
+				return keys;
+			}
 		}
 
 		public SqlCacheDependencyDatabase this [int index] {

+ 5 - 9
mcs/class/System.Web/System.Web.Configuration_2.0/TagPrefixCollection.cs

@@ -62,7 +62,7 @@ namespace System.Web.Configuration
 
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new TagPrefixInfo ("", "", "", "", "");
+			return new TagPrefixInfo ();
 		}
 
 		[MonoTODO]
@@ -76,18 +76,14 @@ namespace System.Web.Configuration
 			BaseRemove (tagPrefixInformation.TagPrefix);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("why override this?")]
 		protected override ConfigurationElementCollectionType CollectionType {
-			get {
-				return ConfigurationElementCollectionType.BasicMap;
-			}
+			get { return ConfigurationElementCollectionType.BasicMap; }
 		}
 
-		[MonoTODO]
+		[MonoTODO ("why override this?")]
 		protected override string ElementName {
-			get {
-				throw new NotImplementedException ();
-			}
+			get { return "add"; }
 		}
 
 		protected override ConfigurationPropertyCollection Properties {

+ 4 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/TagPrefixInfo.cs

@@ -70,6 +70,10 @@ namespace System.Web.Configuration
 			elementProperty = new ConfigurationElementProperty (new CallbackValidator (typeof (TagPrefixInfo), ValidateElement));
 		}
 
+		internal TagPrefixInfo ()
+		{
+		}
+
 		public TagPrefixInfo (string tagPrefix, string nameSpace, string assembly, string tagName, string source)
 		{
 			this.TagPrefix = tagPrefix;

+ 4 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/TrustLevel.cs

@@ -55,6 +55,10 @@ namespace System.Web.Configuration {
 			properties.Add (policyFileProp);
 		}
 
+		internal TrustLevel ()
+		{
+		}
+
 		public TrustLevel (string name, string policyFile)
 		{
 			this.Name = name;

+ 8 - 10
mcs/class/System.Web/System.Web.Configuration_2.0/TrustLevelCollection.cs

@@ -70,15 +70,16 @@ namespace System.Web.Configuration {
 			BaseRemoveAt (index);
 		}
 
-		[MonoTODO]
 		public void Set (int index, TrustLevel trustLevel)
 		{
-			throw new NotImplementedException ();
+			if (BaseGet (index) != null)
+				BaseRemoveAt (index);
+			BaseAdd (index, trustLevel);
 		}
 
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new TrustLevel ("", "");
+			return new TrustLevel ();
 		}
 
 		protected override object GetElementKey (ConfigurationElement element)
@@ -86,19 +87,17 @@ namespace System.Web.Configuration {
 			return ((TrustLevel)element).Name;
 		}
 
-		[MonoTODO]
 		protected override bool IsElementName (string elementname)
 		{
-			throw new NotImplementedException ();
+			return elementname == "trustlevel";
 		}
 
 		protected override ConfigurationElementCollectionType CollectionType {
 			get { return ConfigurationElementCollectionType.BasicMap; }
 		}
 
-		[MonoTODO]
 		protected override string ElementName {
-			get { throw new NotImplementedException (); }
+			get { return "trustLevel"; }
 		}
 
 		public new TrustLevel this [string name] {
@@ -107,12 +106,11 @@ namespace System.Web.Configuration {
 
 		public TrustLevel this [int index] {
 			get { return (TrustLevel) BaseGet (index); }
-			set { if (BaseGet (index) != null) BaseRemoveAt (index); BaseAdd (index, value); }
+			set { Set (index, value); }
 		}
 
-		[MonoTODO]
 		protected override bool ThrowOnDuplicate {
-			get { throw new NotImplementedException (); }
+			get { return false; }
 		}
 
 		protected override ConfigurationPropertyCollection Properties {

+ 4 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/UrlMapping.cs

@@ -64,6 +64,10 @@ namespace System.Web.Configuration {
 			properties.Add (urlProp);
 		}
 
+		internal UrlMapping ()
+		{
+		}
+
 		public UrlMapping (string url, string mappedUrl)
 		{
 			this.Url = url;

+ 9 - 6
mcs/class/System.Web/System.Web.Configuration_2.0/UrlMappingCollection.cs

@@ -57,7 +57,7 @@ namespace System.Web.Configuration {
 
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new UrlMapping ("", "");
+			return new UrlMapping ();
 		}
 
 		protected override object GetElementKey (ConfigurationElement element)
@@ -65,10 +65,9 @@ namespace System.Web.Configuration {
 			return ((UrlMapping)element).Url;
 		}
 
-		[MonoTODO]
 		public string GetKey (int index)
 		{
-			throw new NotImplementedException ();
+			return (string)BaseGetKey (index);
 		}
 
 		public void Remove (string name)
@@ -86,9 +85,13 @@ namespace System.Web.Configuration {
 			BaseRemoveAt (index);
 		}
 
-		[MonoTODO]
-		public String[] AllKeys {
-			get { throw new NotImplementedException (); }
+		public string[] AllKeys {
+			get {
+				string[] keys = new string[Count];
+				for (int i = 0; i < Count; i ++)
+					keys[i] = this[i].Url;
+				return keys;
+			}
 		}
 
 		public UrlMapping this [int index] {