Author: toshok
Date: 2005-09-27 22:09:35 -0400 (Tue, 27 Sep 2005)
New Revision: 50905
Added:
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElementProperty.cs
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationLockCollection.cs
Modified:
trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElementCollection.cs
trunk/mcs/class/System.Configuration/System.Configuration/ContextInformation.cs
Log:
2005-09-27 Chris Toshok <[EMAIL PROTECTED]>
* ConfigurationElementProperty.cs: new file.
* ConfigurationLockCollection.cs: new file.
* ConfigurationElementCollection.cs
(OnDeserializeUnrecognizedElement): make sure we consume the
<clear /> element so we don't into an endless loop.
* ConfigurationElement.cs: add a bunch of NIE's properties.
* ContextInformation.cs: Add NIE'ed IsMachineLevel property.
Modified: trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
===================================================================
--- trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
2005-09-28 02:05:16 UTC (rev 50904)
+++ trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
2005-09-28 02:09:35 UTC (rev 50905)
@@ -1,3 +1,17 @@
+2005-09-27 Chris Toshok <[EMAIL PROTECTED]>
+
+ * ConfigurationElementProperty.cs: new file.
+
+ * ConfigurationLockCollection.cs: new file.
+
+ * ConfigurationElementCollection.cs
+ (OnDeserializeUnrecognizedElement): make sure we consume the
+ <clear /> element so we don't into an endless loop.
+
+ * ConfigurationElement.cs: add a bunch of NIE's properties.
+
+ * ContextInformation.cs: Add NIE'ed IsMachineLevel property.
+
2005-09-23 Chris Toshok <[EMAIL PROTECTED]>
* AppSettingsSection.cs: fix build and add a couple of TODO'ed
Modified:
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
===================================================================
---
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
2005-09-28 02:05:16 UTC (rev 50904)
+++
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
2005-09-28 02:09:35 UTC (rev 50905)
@@ -72,6 +72,82 @@
{
}
+ [MonoTODO]
+ public ConfigurationElementProperty ElementProperty {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ protected ContextInformation EvaluationContext {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public ContextInformation EvaluationInformation {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public ConfigurationLockCollection LockAllAttributesExcept {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public ConfigurationLockCollection LockAllElementsExcept {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ ConfigurationLockCollection lockAttributes;
+ public ConfigurationLockCollection LockAttributes {
+ get {
+ if (lockAttributes == null) {
+ lockAttributes = new
ConfigurationLockCollection (this, ConfigurationLockType.Attribute);
+ }
+
+ return lockAttributes;
+ }
+ }
+
+ [MonoTODO]
+ public ConfigurationLockCollection LockElements {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public bool LockItem {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO]
+ public void ListErrors (IList list)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void SetPropertyValue (ConfigurationProperty prop,
object value, bool ignoreLocks)
+ {
+ throw new NotImplementedException ();
+ }
+
internal ConfigurationPropertyCollection GetKeyProperties ()
{
if (keyProps != null) return keyProps;
Modified:
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElementCollection.cs
===================================================================
---
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElementCollection.cs
2005-09-28 02:05:16 UTC (rev 50904)
+++
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElementCollection.cs
2005-09-28 02:09:35 UTC (rev 50905)
@@ -445,6 +445,8 @@
}
else {
if (elementName == clearElementName) {
+ ConfigurationElement elem =
CreateNewElementInternal (null);
+ elem.DeserializeElement (reader, true);
BaseClear ();
emitClear = true;
modified = false;
Added:
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElementProperty.cs
===================================================================
---
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElementProperty.cs
2005-09-28 02:05:16 UTC (rev 50904)
+++
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationElementProperty.cs
2005-09-28 02:09:35 UTC (rev 50905)
@@ -0,0 +1,50 @@
+//
+// System.Configuration.ConfigurationElementProperty.cs
+//
+// Authors:
+// Chris Toshok ([EMAIL PROTECTED])
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+
+#if NET_2_0
+
+namespace System.Configuration
+{
+ public sealed class ConfigurationElementProperty
+ {
+ public ConfigurationElementProperty (ConfigurationValidatorBase
validator)
+ {
+ this.validator = validator;
+ }
+
+ public ConfigurationValidatorBase Validator {
+ get {
+ return validator;
+ }
+ }
+
+ ConfigurationValidatorBase validator;
+ }
+}
+
+#endif
Added:
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationLockCollection.cs
===================================================================
---
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationLockCollection.cs
2005-09-28 02:05:16 UTC (rev 50904)
+++
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationLockCollection.cs
2005-09-28 02:09:35 UTC (rev 50905)
@@ -0,0 +1,153 @@
+//
+// System.Configuration.ConfigurationLockCollection.cs
+//
+// Authors:
+// Chris Toshok ([EMAIL PROTECTED])
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+
+#if NET_2_0
+
+using System;
+using System.Collections;
+
+namespace System.Configuration
+{
+ [Flags]
+ internal enum ConfigurationLockType
+ {
+ Attribute = 0x01,
+ Element = 0x02,
+
+ Exclude = 0x10
+ }
+
+ public sealed class ConfigurationLockCollection : ICollection,
IEnumerable
+ {
+ ArrayList names;
+ ConfigurationElement element;
+ ConfigurationLockType lockType;
+
+ internal ConfigurationLockCollection (ConfigurationElement
element,
+ ConfigurationLockType
lockType)
+ {
+ names = new ArrayList ();
+ this.element = element;
+ this.lockType = lockType;
+
+ Populate();
+ }
+
+ void Populate ()
+ {
+ foreach (ConfigurationProperty prop in
element.Properties) {
+ if ((lockType &
ConfigurationLockType.Attribute) != ConfigurationLockType.Attribute
+ || !prop.IsDefaultCollection)
+ Add (prop.Name);
+ }
+ }
+
+ public void Add (string name)
+ {
+ names.Add (name);
+ }
+
+ public void Clear ()
+ {
+ names.Clear ();
+ }
+
+ public bool Contains (string name)
+ {
+ return names.Contains (name);
+ }
+
+ public void CopyTo (string[] array, int index)
+ {
+ names.CopyTo (array, index);
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ return names.GetEnumerator ();
+ }
+
+ [MonoTODO]
+ public bool IsReadOnly (string name)
+ {
+ return false; /* XXX */
+ }
+
+ public void Remove (string name)
+ {
+ names.Remove (name);
+ }
+
+ [MonoTODO]
+ public void SetFromList (string attributeList)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void ICollection.CopyTo (System.Array array, int index)
+ {
+ names.CopyTo (array, index);
+ }
+
+ public int Count {
+ get {
+ return names.Count;
+ }
+ }
+
+ [MonoTODO]
+ public bool HasParentElements {
+ get {
+ return false; /* XXX */
+ }
+ }
+
+ [MonoTODO]
+ public bool IsModified {
+ get {
+ return false; /* XXX */
+ }
+ }
+
+ [MonoTODO]
+ public bool IsSynchronized {
+ get {
+ return false; /* XXX */
+ }
+ }
+
+ [MonoTODO]
+ public object SyncRoot {
+ get {
+ return this; /* XXX */
+ }
+ }
+ }
+}
+
+#endif
Modified:
trunk/mcs/class/System.Configuration/System.Configuration/ContextInformation.cs
===================================================================
---
trunk/mcs/class/System.Configuration/System.Configuration/ContextInformation.cs
2005-09-28 02:05:16 UTC (rev 50904)
+++
trunk/mcs/class/System.Configuration/System.Configuration/ContextInformation.cs
2005-09-28 02:09:35 UTC (rev 50905)
@@ -51,6 +51,13 @@
public object HostingContext {
get { return ctx; }
}
+
+ [MonoTODO ("should this use HostingContext instead?")]
+ public bool IsMachineLevel {
+ get {
+ return config.ConfigPath == "machine";
+ }
+ }
}
}
#endif
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches