dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System/ComponentModel ArrayConverter.


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System/ComponentModel ArrayConverter.cs, NONE, 1.1 ComponentConverter.cs, NONE, 1.1 ComponentEditor.cs, NONE, 1.1 ComponentResourceManager.cs, NONE, 1.1 ExtenderProvidedPropertyAttribute.cs, NONE, 1.1 InstallerTypeAttribute.cs, NONE, 1.1 CultureInfoConverter.cs, 1.1, 1.2 DateTimeConverter.cs, 1.1, 1.2 DecimalConverter.cs, 1.1, 1.2 EnumConverter.cs, 1.6, 1.7 EventDescriptor.cs, 1.2, 1.3 EventDescriptorCollection.cs, 1.2, 1.3 ExpandableObjectConverter.cs, 1.3, 1.4 GuidConverter.cs, 1.1, 1.2 IComponent.cs, 1.3, 1.4 LicenseManager.cs, 1.1, 1.2 LicenseProviderAttribute.cs, 1.1, 1.2 MarshalByValueComponent.cs, 1.5, 1.6 MemberDescriptor.cs, 1.2, 1.3 PropertyDescriptor.cs, 1.4, 1.5 PropertyDescriptorCollection.cs, 1.3, 1.4 PropertyTabAttribute.cs, 1.1, 1.2 ProvidePropertyAttribute.cs, 1.1, 1.2 TimeSpanConverter.cs, 1.1, 1.2 TypeConverter.cs, 1.8, 1.9 TypeDescriptor.cs, 1.2, 1.3 TypeListConverter.cs, 1.2, 1.3
Date: Tue, 16 Sep 2003 01:25:34 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel
In directory subversions:/tmp/cvs-serv31418/System/ComponentModel

Modified Files:
        CultureInfoConverter.cs DateTimeConverter.cs 
        DecimalConverter.cs EnumConverter.cs EventDescriptor.cs 
        EventDescriptorCollection.cs ExpandableObjectConverter.cs 
        GuidConverter.cs IComponent.cs LicenseManager.cs 
        LicenseProviderAttribute.cs MarshalByValueComponent.cs 
        MemberDescriptor.cs PropertyDescriptor.cs 
        PropertyDescriptorCollection.cs PropertyTabAttribute.cs 
        ProvidePropertyAttribute.cs TimeSpanConverter.cs 
        TypeConverter.cs TypeDescriptor.cs TypeListConverter.cs 
Added Files:
        ArrayConverter.cs ComponentConverter.cs ComponentEditor.cs 
        ComponentResourceManager.cs 
        ExtenderProvidedPropertyAttribute.cs InstallerTypeAttribute.cs 
Log Message:


Missing classes and functionality within the "System.ComponentModel" namespace.


--- NEW FILE ---
/*
 * ArrayConverter.cs - Implementation of the
 *              "System.ComponentModel.ComponentModel.ArrayConverter" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel
{

#if CONFIG_COMPONENT_MODEL

using System;
using System.Collections;
using System.Globalization;

public class ArrayConverter : CollectionConverter
{
        // Constructor.
        public ArrayConverter() {}

        // Convert this object into another type.
        public override Object ConvertTo(ITypeDescriptorContext context,
                                                                         
CultureInfo culture,
                                                                         Object 
value, Type destinationType)
                        {
                                if(destinationType == null)
                                {
                                        throw new 
ArgumentNullException("destinationType");
                                }
                                else if(destinationType == typeof(String) &&
                                                value is Array)
                                {
                                        return value.GetType().ToString() + " 
Array";
                                }
                                else
                                {
                                        return base.ConvertTo(context, culture, 
value,
                                                                                
  destinationType);
                                }
                        }

        // Get the properties for an object.
        public override PropertyDescriptorCollection GetProperties
                                (ITypeDescriptorContext context, Object value,
                                 Attribute[] attributes)
                        {
                                Array array = (value as Array);
                                if(array == null)
                                {
                                        return new 
PropertyDescriptorCollection(null);
                                }
                                int len = array.GetLength(0);
                                PropertyDescriptor[] descs;
                                descs = new PropertyDescriptor [len];
                                int index;
                                for(index = 0; index < len; ++index)
                                {
                                        descs[index] = new 
ArrayElementDescriptor
                                                (array.GetType(),
                                                 
array.GetType().GetElementType(),
                                                 index, "[" + index.ToString() 
+ "]");
                                }
                                return new PropertyDescriptorCollection(descs);
                        }

        // Determine if the "GetProperties" method is supported.
        public override bool GetPropertiesSupported
                                (ITypeDescriptorContext context)
                        {
                                return true;
                        }

        // Descriptor for an array element.
        private sealed class ArrayElementDescriptor
                        : TypeConverter.SimplePropertyDescriptor
        {
                // Internal state.
                private int index;

                // Constructor.
                public ArrayElementDescriptor(Type componentType,
                                                                          Type 
propertyType,
                                                                          int 
index, String name)
                                : base(componentType, name, propertyType)
                                {
                                        this.index = index;
                                }

                // Get the property value associated with a component.
                public override Object GetValue(Object component)
                                {
                                        Array array = (component as Array);
                                        if(array != null)
                                        {
                                                if(index < array.GetLength(0))
                                                {
                                                        return 
array.GetValue(index);
                                                }
                                        }
                                        return null;
                                }

                // Set the property value associated with a component.
                public override void SetValue(Object component, Object value)
                                {
                                        Array array = (component as Array);
                                        if(array != null)
                                        {
                                                if(index < array.GetLength(0))
                                                {
                                                        array.SetValue(value, 
index);
                                                }
                                                OnValueChanged(component, 
EventArgs.Empty);
                                        }
                                }

        }; // class ArrayElementDescriptor

}; // class ArrayConverter

#endif // CONFIG_COMPONENT_MODEL

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * ComponentConverter.cs - Implementation of the
 *              "System.ComponentModel.ComponentModel.ComponentConverter" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel
{

#if CONFIG_COMPONENT_MODEL

using System;
using System.Collections;
using System.Globalization;
using System.ComponentModel.Design;

public class ComponentConverter : ReferenceConverter
{
        // Constructor.
        public ComponentConverter(Type type) : base(type) {}

        // Get the properties for an object.
        public override PropertyDescriptorCollection GetProperties
                                (ITypeDescriptorContext context, Object value,
                                 Attribute[] attributes)
                        {
                                return TypeDescriptor.GetProperties(value, 
attributes);
                        }

        // Determine if the "GetProperties" method is supported.
        public override bool GetPropertiesSupported
                                (ITypeDescriptorContext context)
                        {
                                return true;
                        }

}; // class ComponentConverter

#endif // CONFIG_COMPONENT_MODEL

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * ComponentEditor.cs - Implementation of the
 *              "System.ComponentModel.ComponentModel.ComponentEditor" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel
{

#if CONFIG_COMPONENT_MODEL

public abstract class ComponentEditor
{
        // Constructor.
        protected ComponentEditor() {}

        // Edit a component and indicate if it was modified.
        public bool EditComponent(Object component)
                        {
                                return EditComponent(null, component);
                        }
        public abstract bool EditComponent
                                (ITypeDescriptorContext context, Object 
component);

}; // class ComponentEditor

#endif // CONFIG_COMPONENT_MODEL

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * ComponentResourceManager.cs - Implementation of the
 *              "System.ComponentModel.ComponentModel.ComponentResourceManager" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel
{

#if CONFIG_COMPONENT_MODEL

using System.Resources;
using System.Globalization;

public class ComponentResourceManager : ResourceManager
{
        // Constructors.
        public ComponentResourceManager() {}
        public ComponentResourceManager(Type t) : base(t) {}

        // Apply resources to a property value.
        public void ApplyResources(Object value, String objectName)
                        {
                                ApplyResources(value, objectName, null);
                        }
        [TODO]
        public virtual void ApplyResources
                                (Object value, String objectName, CultureInfo 
culture)
                        {
                                // Validate the parameters.
                                if(value == null)
                                {
                                        throw new 
ArgumentNullException("value");
                                }
                                if(objectName == null)
                                {
                                        throw new 
ArgumentNullException("objectName");
                                }

                                // Get the default UI culture if necessary.
                                if(culture == null)
                                {
                                        culture = CultureInfo.CurrentUICulture;
                                }

                                // Read the resources and apply them to the 
component.
                                // TODO
                        }

}; // class ComponentResourceManager

#endif // CONFIG_COMPONENT_MODEL

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * ExtenderProvidedPropertyAttribute.cs - Implementation of
 *      
"System.ComponentModel.ComponentModel.ExtenderProvidedPropertyAttribute".
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel
{

#if CONFIG_COMPONENT_MODEL

using System;

[AttributeUsage(AttributeTargets.All)]
public sealed class ExtenderProvidedPropertyAttribute : Attribute
{
        // Internal state.
        private PropertyDescriptor extenderProperty;
        private IExtenderProvider provider;
        private Type receiverType;

        // Constructors.
        public ExtenderProvidedPropertyAttribute() {}
        internal ExtenderProvidedPropertyAttribute
                                (PropertyDescriptor extenderProperty,
                                 IExtenderProvider provider, Type receiverType)
                        {
                                this.extenderProperty = extenderProperty;
                                this.provider = provider;
                                this.receiverType = receiverType;
                        }

        // Get this object's properties.
        public PropertyDescriptor ExtenderProperty
                        {
                                get
                                {
                                        return extenderProperty;
                                }
                        }
        public IExtenderProvider Provider
                        {
                                get
                                {
                                        return provider;
                                }
                        }
        public Type ReceiverType
                        {
                                get
                                {
                                        return receiverType;
                                }
                        }

        // Determine if this attribute is a default value.
        public override bool IsDefaultAttribute()
                        {
                                return (receiverType == null);
                        }

        // Determine if two objects are equal.
        public override bool Equals(Object obj)
                        {
                                ExtenderProvidedPropertyAttribute other;
                                other = (obj as 
ExtenderProvidedPropertyAttribute);
                                if(other != null)
                                {
                                        if(extenderProperty != null)
                                        {
                                                
if(!extenderProperty.Equals(other.extenderProperty))
                                                {
                                                        return false;
                                                }
                                        }
                                        else if(other.extenderProperty != null)
                                        {
                                                return false;
                                        }
                                        if(provider != null)
                                        {
                                                
if(!provider.Equals(other.provider))
                                                {
                                                        return false;
                                                }
                                        }
                                        else if(other.provider != null)
                                        {
                                                return false;
                                        }
                                        if(receiverType != null)
                                        {
                                                
if(!receiverType.Equals(other.receiverType))
                                                {
                                                        return false;
                                                }
                                        }
                                        else if(other.receiverType != null)
                                        {
                                                return false;
                                        }
                                        return true;
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return base.GetHashCode();
                        }

}; // class ExtenderProvidedPropertyAttribute

#endif // CONFIG_COMPONENT_MODEL

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * InstallerTypeAttribute.cs - Implementation of the
 *              "System.ComponentModel.ComponentModel.InstallerTypeAttribute" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel
{

#if CONFIG_COMPONENT_MODEL

using System;
using System.Globalization;

[AttributeUsage(AttributeTargets.Class)]
public class InstallerTypeAttribute : Attribute
{
        // Internal state.
        private String typeName;

        // Constructors.
        public InstallerTypeAttribute(String typeName)
                        {
                                this.typeName = typeName;
                        }
        public InstallerTypeAttribute(Type type)
                        {
                                this.typeName = type.AssemblyQualifiedName;
                        }

        // Get the name of the converter type.
        public virtual Type InstallerType
                        {
                                get
                                {
                                        return Type.GetType(typeName);
                                }
                        }

        // Determine if two type converter attributes are equal.
        public override bool Equals(Object obj)
                        {
                                InstallerTypeAttribute a = (obj as 
InstallerTypeAttribute);
                                if(a != null)
                                {
                                        return (a.typeName == typeName);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get a hash code for this instance.
        public override int GetHashCode()
                        {
                                return base.GetHashCode();
                        }

}; // class InstallerTypeAttribute

#endif // CONFIG_COMPONENT_MODEL

}; // namespace System.ComponentModel

Index: CultureInfoConverter.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/CultureInfoConverter.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** CultureInfoConverter.cs     8 Aug 2003 02:56:50 -0000       1.1
--- CultureInfoConverter.cs     16 Sep 2003 05:25:31 -0000      1.2
***************
*** 28,31 ****
--- 28,32 ----
  using System.Collections;
  using System.Globalization;
+ using System.Reflection;
  using System.ComponentModel.Design.Serialization;
  
***************
*** 66,80 ****
  
        // Convert from another type to the one represented by this class.
-       [TODO]
        public override Object ConvertFrom(ITypeDescriptorContext context,
                                                                           
CultureInfo culture,
                                                                           
Object value)
                        {
!                               // TODO
                                return base.ConvertFrom(context, culture, 
value);
                        }
  
        // Convert this object into another type.
-       [TODO]
        public override Object ConvertTo(ITypeDescriptorContext context,
                                                                         
CultureInfo culture,
--- 67,98 ----
  
        // Convert from another type to the one represented by this class.
        public override Object ConvertFrom(ITypeDescriptorContext context,
                                                                           
CultureInfo culture,
                                                                           
Object value)
                        {
!                               if(value is String)
!                               {
!                                       String name = (String)value;
!                                       if(name == "(Default)")
!                                       {
!                                               return 
CultureInfo.InvariantCulture;
!                                       }
!                                       CultureInfo[] cultures;
!                                       cultures = CultureInfo.GetCultures
!                                               (CultureTypes.AllCultures);
!                                       foreach(CultureInfo culture in cultures)
!                                       {
!                                               
if(String.Compare(culture.DisplayName, name, true) == 0)
!                                               {
!                                                       return culture;
!                                               }
!                                       }
!                                       throw new ArgumentException
!                                               (S._("Arg_InvalidCultureName"));
!                               }
                                return base.ConvertFrom(context, culture, 
value);
                        }
  
        // Convert this object into another type.
        public override Object ConvertTo(ITypeDescriptorContext context,
                                                                         
CultureInfo culture,
***************
*** 87,114 ****
                                if(destinationType == typeof(String))
                                {
!                                       // TODO
                                        return String.Empty;
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               else if(destinationType == 
typeof(InstanceDescriptor))
                                {
!                                       // TODO
!                                       return null;
                                }
                        #endif
!                               else
!                               {
!                                       return base.ConvertTo
!                                               (context, culture, value, 
destinationType);
!                               }
                        }
  
        // Return a collection of standard values for this data type.
-       [TODO]
        public override StandardValuesCollection GetStandardValues
                                (ITypeDescriptorContext context)
                        {
!                               // TODO
!                               return null;
                        }
  
--- 105,153 ----
                                if(destinationType == typeof(String))
                                {
!                                       if(value is CultureInfo)
!                                       {
!                                               if(((CultureInfo)value).LCID == 
0x007F)
!                                               {
!                                                       return "(Default)";
!                                               }
!                                               else
!                                               {
!                                                       return 
((CultureInfo)value).DisplayName;
!                                               }
!                                       }
                                        return String.Empty;
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               if(destinationType == 
typeof(InstanceDescriptor) &&
!                                  value is CultureInfo)
                                {
!                                       ConstructorInfo ctor;
!                                       ctor = 
typeof(CultureInfo).GetConstructor
!                                                       (new Type [] 
{typeof(int)});
!                                       if(ctor == null)
!                                       {
!                                               return null;
!                                       }
!                                       return new InstanceDescriptor
!                                               (ctor, new Object [] 
{((CultureInfo)value).LCID});
                                }
                        #endif
!                               return base.ConvertTo
!                                       (context, culture, value, 
destinationType);
                        }
  
        // Return a collection of standard values for this data type.
        public override StandardValuesCollection GetStandardValues
                                (ITypeDescriptorContext context)
                        {
!                               ArrayList list = new ArrayList();
!                               list.Add("(Default)");
!                               CultureInfo[] cultures =
!                                       
CultureInfo.GetCultures(CultureTypes.AllCultures);
!                               foreach(CultureInfo culture in cultures)
!                               {
!                                       list.Add(culture.DisplayName);
!                               }
!                               return new StandardValuesCollection(list);
                        }
  

Index: DateTimeConverter.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/DateTimeConverter.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** DateTimeConverter.cs        8 Aug 2003 02:56:50 -0000       1.1
--- DateTimeConverter.cs        16 Sep 2003 05:25:31 -0000      1.2
***************
*** 27,30 ****
--- 27,31 ----
  using System;
  using System.Collections;
+ using System.Reflection;
  using System.Globalization;
  using System.ComponentModel.Design.Serialization;
***************
*** 87,91 ****
  
        // Convert this object into another type.
-       [TODO]
        public override Object ConvertTo(ITypeDescriptorContext context,
                                                                         
CultureInfo culture,
--- 88,91 ----
***************
*** 121,135 ****
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               else if(destinationType == 
typeof(InstanceDescriptor))
                                {
!                                       // TODO
!                                       return null;
                                }
                        #endif
!                               else
!                               {
!                                       return base.ConvertTo
!                                               (context, culture, value, 
destinationType);
!                               }
                        }
  
--- 121,140 ----
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               if(destinationType == 
typeof(InstanceDescriptor) &&
!                                  value is DateTime)
                                {
!                                       ConstructorInfo ctor;
!                                       ctor = typeof(DateTime).GetConstructor
!                                                       (new Type [] 
{typeof(long)});
!                                       if(ctor == null)
!                                       {
!                                               return null;
!                                       }
!                                       return new InstanceDescriptor
!                                               (ctor, new Object [] 
{((DateTime)value).Ticks});
                                }
                        #endif
!                               return base.ConvertTo
!                                       (context, culture, value, 
destinationType);
                        }
  

Index: DecimalConverter.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/DecimalConverter.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** DecimalConverter.cs 7 Aug 2003 06:34:30 -0000       1.1
--- DecimalConverter.cs 16 Sep 2003 05:25:31 -0000      1.2
***************
*** 28,31 ****
--- 28,32 ----
  using System.Collections;
  using System.Globalization;
+ using System.Reflection;
  using System.ComponentModel.Design.Serialization;
  
***************
*** 67,71 ****
  
        // Convert this object into another type.
-       [TODO]
        public override Object ConvertTo(ITypeDescriptorContext context,
                                                                         
CultureInfo culture,
--- 68,71 ----
***************
*** 77,91 ****
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               if(destinationType == 
typeof(InstanceDescriptor))
                                {
!                                       // TODO
!                                       return null;
                                }
-                               else
                        #endif
!                               {
!                                       return base.ConvertTo(context, culture, 
value,
!                                                                               
  destinationType);
!                               }
                        }
  
--- 77,97 ----
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               if(destinationType == 
typeof(InstanceDescriptor) &&
!                                  value is Decimal)
                                {
!                                       ConstructorInfo ctor;
!                                       ctor = typeof(Decimal).GetConstructor
!                                                       (new Type [] 
{typeof(int[])});
!                                       if(ctor == null)
!                                       {
!                                               return null;
!                                       }
!                                       return new InstanceDescriptor
!                                               (ctor, new Object []
!                                                       
{Decimal.GetBits((Decimal)value)});
                                }
                        #endif
!                               return base.ConvertTo(context, culture, value,
!                                                                         
destinationType);
                        }
  

Index: EnumConverter.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/EnumConverter.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** EnumConverter.cs    8 Aug 2003 02:56:50 -0000       1.6
--- EnumConverter.cs    16 Sep 2003 05:25:31 -0000      1.7
***************
*** 28,31 ****
--- 28,32 ----
  using System.Collections;
  using System.Globalization;
+ using System.Reflection;
  using System.ComponentModel.Design.Serialization;
  
***************
*** 116,120 ****
  
        // Convert this object into another type.
-       [TODO]
        public override Object ConvertTo(ITypeDescriptorContext context,
                                                                         
CultureInfo culture,
--- 117,120 ----
***************
*** 130,144 ****
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               else if(destinationType == 
typeof(InstanceDescriptor))
                                {
!                                       // TODO
!                                       return null;
                                }
                        #endif
!                               else
!                               {
!                                       return base.ConvertTo
!                                               (context, culture, value, 
destinationType);
!                               }
                        }
  
--- 130,156 ----
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               if(destinationType == 
typeof(InstanceDescriptor) &&
!                                  type.IsInstanceOfType(value))
                                {
!                                       MethodInfo method;
!                                       method = typeof(Enum).GetMethod
!                                                       ("ToObject",
!                                                        new Type [] 
{typeof(Type), typeof(Object)});
!                                       if(method == null)
!                                       {
!                                               return null;
!                                       }
!                                       FieldInfo field = 
value.GetType().GetField("value__");
!                                       if(field == null)
!                                       {
!                                               return null;
!                                       }
!                                       return new InstanceDescriptor
!                                               (method, new Object []
!                                                       {type, 
field.GetValue(value)});
                                }
                        #endif
!                               return base.ConvertTo
!                                       (context, culture, value, 
destinationType);
                        }
  

Index: EventDescriptor.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/EventDescriptor.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** EventDescriptor.cs  29 May 2003 05:38:17 -0000      1.2
--- EventDescriptor.cs  16 Sep 2003 05:25:31 -0000      1.3
***************
*** 1,5 ****
  /*
!  * EventDescriptor.cs - 
!  *                            Implementation of 
"System.ComponentModel.EventDescriptor".
   *
   * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
--- 1,5 ----
  /*
!  * EventDescriptor.cs - Implementation of the
!  *                    "System.ComponentModel.EventDescriptor" class.
   *
   * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
***************
*** 24,47 ****
  namespace System.ComponentModel
  {
  #if CONFIG_COMPONENT_MODEL
  
!       public abstract class EventDescriptor: MemberDescriptor
!       {
!               protected EventDescriptor(MemberDescriptor desc) 
!                       : base(desc)
!               {
!               }
! 
!               protected EventDescriptor(MemberDescriptor desc, Attribute[] 
attrs)
!                       : base(desc,attrs)
!               {
!               }
! 
!               protected EventDescriptor(String str, Attribute[] attrs)
!                       : base(str,attrs)
!               {
!               }
!       }
  
! #endif
! }//namespace
--- 24,60 ----
  namespace System.ComponentModel
  {
+ 
  #if CONFIG_COMPONENT_MODEL
  
! using System.Runtime.InteropServices;
! 
! [ComVisible(true)]
! public abstract class EventDescriptor : MemberDescriptor
! {
!       // Constructors.
!       protected EventDescriptor(MemberDescriptor descr) : base(descr) {}
!       protected EventDescriptor(MemberDescriptor descr, Attribute[] attrs)
!                       : base(descr, attrs) {}
!       protected EventDescriptor(String name, Attribute[] attrs)
!                       : base(name, attrs) {}
! 
!       // Get the type of component that this event is bound to.
!       public abstract Type ComponentType { get; }
! 
!       // Get the delegate type associated with the event.
!       public abstract Type EventType { get; }
! 
!       // Determine if the event delegate is multicast.
!       public abstract bool IsMulticast { get; }
! 
!       // Add an event handler to a component.
!       public abstract void AddEventHandler(Object component, Delegate value);
! 
!       // Remove an event handler from a component.
!       public abstract void RemoveEventHandler(Object component, Delegate 
value);
! 
! }; // class EventDescriptor
! 
! #endif // CONFIG_COMPONENT_MODEL
  
! }; // namespace System.ComponentModel

Index: EventDescriptorCollection.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/EventDescriptorCollection.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** EventDescriptorCollection.cs        29 May 2003 05:38:17 -0000      1.2
--- EventDescriptorCollection.cs        16 Sep 2003 05:25:31 -0000      1.3
***************
*** 1,5 ****
  /*
!  * EventDescriptorCollection.cs - 
!  *            Implementation of 
"System.ComponentModel.EventDescriptorCollection" 
   *
   * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
--- 1,5 ----
  /*
!  * EventDescriptorCollection.cs - Implementation of the
!  *                    "System.ComponentModel.EventDescriptorCollection" class.
   *
   * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
***************
*** 20,26 ****
   */
  
- using System;
- using System.Collections;
- 
  namespace System.ComponentModel
  {
--- 20,23 ----
***************
*** 28,248 ****
  #if CONFIG_COMPONENT_MODEL
  
!       public class EventDescriptorCollection: IEnumerable, ICollection, IList
!       {
!               [TODO]
!               public EventDescriptorCollection(EventDescriptor[] events)
!               {
!                       throw new NotImplementedException(".ctor");
!               }
! 
!               [TODO]
!               public int Add(EventDescriptor value)
!               {
!                       throw new NotImplementedException("Add");
!               }
! 
!               [TODO]
!               public void Clear()
!               {
!                       throw new NotImplementedException("Clear");
!               }
! 
!               [TODO]
!               public bool Contains(EventDescriptor value)
!               {
!                       throw new NotImplementedException("Contains");
!               }
! 
!               [TODO]
!               public virtual EventDescriptor Find(String name, bool 
ignoreCase)
!               {
!                       throw new NotImplementedException("Find");
!               }
! 
!               [TODO]
!               public IEnumerator GetEnumerator()
!               {
!                       throw new NotImplementedException("GetEnumerator");
!               }
! 
!               [TODO]
!               public int IndexOf(EventDescriptor value)
!               {
!                       throw new NotImplementedException("IndexOf");
!               }
! 
!               [TODO]
!               public void Insert(int index, EventDescriptor value)
!               {
!                       throw new NotImplementedException("Insert");
!               }
! 
!               [TODO]
!               protected virtual EventDescriptorCollection InternalSort(
!                                                                               
IComparer comparer)
!               {
!                       throw new NotImplementedException("InternalSort");
!               }
! 
!               [TODO]
!               protected virtual EventDescriptorCollection 
InternalSort(String[] order)
!               {
!                       throw new NotImplementedException("InternalSort");
!               }
! 
!               [TODO]
!               public void Remove(EventDescriptor value)
!               {
!                       throw new NotImplementedException("Remove");
!               }
! 
!               [TODO]
!               public void RemoveAt(int index)
!               {
!                       throw new NotImplementedException("RemoveAt");
!               }
! 
!               [TODO]
!               public virtual EventDescriptorCollection Sort()
!               {
!                       throw new NotImplementedException("Sort");
!               }
! 
!               [TODO]
!               public virtual EventDescriptorCollection Sort(IComparer 
comparer)
!               {
!                       throw new NotImplementedException("Sort");
!               }
! 
!               [TODO]
!               public virtual EventDescriptorCollection Sort(String[] order)
!               {
!                       throw new NotImplementedException("Sort");
!               }
! 
!               [TODO]
!               public virtual EventDescriptorCollection Sort(String[] order, 
!                                                                               
                          IComparer comparer)
!               {
!                       throw new NotImplementedException("Sort");
!               }
! 
!               public static readonly EventDescriptorCollection Empty=new 
EventDescriptorCollection(new EventDescriptor[]{});
! 
!               [TODO]
!               public int Count 
!               { 
!                       get
!                       {
!                               throw new NotImplementedException("Count");
!                       }
!               }
! 
!               [TODO]
!               public virtual EventDescriptor this[String name] 
!               {
!                       get
!                       {
!                               throw new 
NotImplementedException("Item(string)");
!                       }
!               }
! 
!               [TODO]
!               public virtual EventDescriptor this[int index] 
!               {
!                       get
!                       {
!                               throw new NotImplementedException("Item(int)");
!                       }
!               }
! 
!               // IList implements
! 
!               [TODO]
!               int IList.Add (Object value)
!               {
!                       return Add((EventDescriptor) value);
!               }
! 
!               [TODO]
!               bool IList.Contains (Object value) 
!               {
!                       return Contains((EventDescriptor) value);
!               }
! 
!               [TODO]
!               int IList.IndexOf (Object value)
!               {
!                       return IndexOf((EventDescriptor) value);
!               }
! 
!               [TODO]
!               void IList.Insert (int index, Object value)
!               {
!                       Insert(index, (EventDescriptor) value);
!               }
! 
!               [TODO]
!               void IList.Remove (Object value)
!               {
!                       Remove((EventDescriptor) value);
!               }
! 
!               bool IList.IsFixedSize 
!               {
!                       get 
!                       {
!                               return false; 
!                       }
!               }
! 
!               bool IList.IsReadOnly
!               {
!                       get
!                       { 
!                               return false; 
!                       }
!               }
! 
!               [TODO]
!               Object IList.this[int index] 
!               {
!                       get 
!                       {
!                               throw new NotImplementedException("IList[int]");
!                       }
!                       set 
!                       {
!                               throw new NotImplementedException("IList[int]");
!                       }
!               }
! 
!               // ICollection implements
! 
!               [TODO]
!               void ICollection.CopyTo (Array array, int index)
!               {
!                       throw new NotImplementedException 
("ICollection.CopyTo");
!               }
! 
!               [TODO]
!               bool ICollection.IsSynchronized
!               {
!                       get 
!                       {
!                               throw new 
NotImplementedException("ICollection.IsSynchronized");
!                       }
!               }
! 
!               [TODO]
!               Object ICollection.SyncRoot
!               {
!                       get 
!                       {
!                               throw new 
NotImplementedException("ICollection.SyncRoot");
!                       }
!               }
! 
!       }
! #endif
! }//namespace
--- 25,308 ----
  #if CONFIG_COMPONENT_MODEL
  
! using System.Collections;
! using System.Globalization;
! using System.Runtime.InteropServices;
! 
! [ComVisible(true)]
! public class EventDescriptorCollection : IList, ICollection, IEnumerable
! {
!       // Internal state.
!       private ArrayList list;
! 
!       // Empty collection.
!       public static readonly EventDescriptorCollection Empty =
!                       new EventDescriptorCollection(null);
! 
!       // Constructors.
!       public EventDescriptorCollection(EventDescriptor[] events)
!                       {
!                               list = new ArrayList();
!                               if(events != null)
!                               {
!                                       foreach(EventDescriptor descr in events)
!                                       {
!                                               list.Add(descr);
!                                       }
!                               }
!                       }
!       private EventDescriptorCollection(EventDescriptorCollection copyFrom,
!                                                                         
String[] names, IComparer comparer)
!                       {
!                               list = (ArrayList)(copyFrom.list.Clone());
!                               InternalSort(names, comparer);
!                       }
! 
!       // Get the number of items in the collection.
!       public int Count
!                       {
!                               get
!                               {
!                                       return list.Count;
!                               }
!                       }
! 
!       // Get a specific event by index.
!       public virtual EventDescriptor this[int index]
!                       {
!                               get
!                               {
!                                       if(index < 0 || index >= list.Count)
!                                       {
!                                               throw new 
IndexOutOfRangeException
!                                                       
(S._("Arg_InvalidArrayIndex"));
!                                       }
!                                       return (EventDescriptor)(list[index]);
!                               }
!                       }
! 
!       // Get a specific event by name.
!       public virtual EventDescriptor this[String name]
!                       {
!                               get
!                               {
!                                       return Find(name, false);
!                               }
!                       }
! 
!       // Add an descriptor to this collection.
!       public int Add(EventDescriptor value)
!                       {
!                               return list.Add(value);
!                       }
! 
!       // Clear this collection.
!       public void Clear()
!                       {
!                               list.Clear();
!                       }
! 
!       // Determine if this collection contains a particular descriptor.
!       public bool Contains(EventDescriptor value)
!                       {
!                               return list.Contains(value);
!                       }
! 
!       // Find a descriptor with a specific name.
!       public virtual EventDescriptor Find(String name, bool ignoreCase)
!                       {
!                               foreach(EventDescriptor descr in list)
!                               {
!                                       if(String.Compare(descr.Name, name, 
ignoreCase,
!                                                                         
CultureInfo.InvariantCulture) == 0)
!                                       {
!                                               return descr;
!                                       }
!                               }
!                               return null;
!                       }
! 
!       // Get an enumerator for this collection.
!       public IEnumerator GetEnumerator()
!                       {
!                               return list.GetEnumerator();
!                       }
! 
!       // Get the index of a specific descriptor within the collection.
!       public int IndexOf(EventDescriptor value)
!                       {
!                               return list.IndexOf(value);
!                       }
! 
!       // Insert a descriptor into this collection.
!       public void Insert(int index, EventDescriptor value)
!                       {
!                               list.Insert(index, value);
!                       }
! 
!       // Remove a descriptor from this collection.
!       public void Remove(EventDescriptor value)
!                       {
!                               list.Remove(value);
!                       }
! 
!       // Remove a descriptor at a particular index within this collection.
!       public void RemoveAt(int index)
!                       {
!                               list.RemoveAt(index);
!                       }
! 
!       // Sort the descriptor collection.
!       public virtual EventDescriptorCollection Sort()
!                       {
!                               return new EventDescriptorCollection(this, 
null, null);
!                       }
!       public virtual EventDescriptorCollection Sort(IComparer comparer)
!                       {
!                               return new EventDescriptorCollection(this, 
null, comparer);
!                       }
!       public virtual EventDescriptorCollection Sort(String[] names)
!                       {
!                               return new EventDescriptorCollection(this, 
names, null);
!                       }
!       public virtual EventDescriptorCollection Sort
!                               (String[] names, IComparer comparer)
!                       {
!                               return new EventDescriptorCollection(this, 
names, comparer);
!                       }
! 
!       // Internal version of "Sort".
!       private void InternalSort(String[] names, IComparer comparer)
!                       {
!                               if(comparer == null)
!                               {
!                                       comparer = new 
TypeDescriptor.DescriptorComparer();
!                               }
!                               if(names != null && names.Length > 0)
!                               {
!                                       // Copy across elements from "names" 
before
!                                       // sorting the main list and appending 
it.
!                                       ArrayList newList = new 
ArrayList(list.Count);
!                                       foreach(String name in names)
!                                       {
!                                               EventDescriptor descr = 
Find(name, false);
!                                               if(descr != null)
!                                               {
!                                                       newList.Add(descr);
!                                                       list.Remove(descr);
!                                               }
!                                       }
!                                       list.Sort(comparer);
!                                       foreach(EventDescriptor ed in list)
!                                       {
!                                               newList.Add(ed);
!                                       }
!                                       list = newList;
!                               }
!                               else
!                               {
!                                       // No names, so just sort the main list.
!                                       list.Sort(comparer);
!                               }
!                       }
!       protected void InternalSort(IComparer comparer)
!                       {
!                               InternalSort(null, comparer);
!                       }
!       protected void InternalSort(String[] names)
!                       {
!                               InternalSort(names, null);
!                       }
! 
!       // Implement the IList interface.
!       int IList.Add(Object value)
!                       {
!                               return Add((EventDescriptor)value);
!                       }
!       void IList.Clear()
!                       {
!                               Clear();
!                       }
!       bool IList.Contains(Object value)
!                       {
!                               return list.Contains(value);
!                       }
!       int IList.IndexOf(Object value)
!                       {
!                               return list.IndexOf(value);
!                       }
!       void IList.Insert(int index, Object value)
!                       {
!                               Insert(index, (EventDescriptor)value);
!                       }
!       void IList.Remove(Object value)
!                       {
!                               list.Remove(value);
!                       }
!       void IList.RemoveAt(int index)
!                       {
!                               list.RemoveAt(index);
!                       }
!       bool IList.IsFixedSize
!                       {
!                               get
!                               {
!                                       return false;
!                               }
!                       }
!       bool IList.IsReadOnly
!                       {
!                               get
!                               {
!                                       return false;
!                               }
!                       }
!       Object IList.this[int index]
!                       {
!                               get
!                               {
!                                       return this[index];
!                               }
!                               set
!                               {
!                                       list[index] = (EventDescriptor)value;
!                               }
!                       }
! 
!       // Implement the ICollection interface.
!       void ICollection.CopyTo(Array array, int index)
!                       {
!                               list.CopyTo(array, index);
!                       }
!       int ICollection.Count
!                       {
!                               get
!                               {
!                                       return list.Count;
!                               }
!                       }
!       bool ICollection.IsSynchronized
!                       {
!                               get
!                               {
!                                       return false;
!                               }
!                       }
!       Object ICollection.SyncRoot
!                       {
!                               get
!                               {
!                                       return this;
!                               }
!                       }
! 
!       // Implement the IEnumerable interface.
!       IEnumerator IEnumerable.GetEnumerator()
!                       {
!                               return GetEnumerator();
!                       }
! 
! }; // class EventDescriptorCollection
! 
! #endif // CONFIG_COMPONENT_MODEL
! 
! }; // namespace System.ComponentModel

Index: ExpandableObjectConverter.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/ExpandableObjectConverter.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ExpandableObjectConverter.cs        29 May 2003 05:38:17 -0000      1.3
--- ExpandableObjectConverter.cs        16 Sep 2003 05:25:31 -0000      1.4
***************
*** 1,8 ****
  /*
!  * ExpandableObjectConverter.cs - Implementation of 
!  *                                            
"System.ComponentModel.ExpandableObjectConverter" 
   *
!  * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
!  * Copyright (C) 2002  Free Software Foundation, Inc.
   *
   * This program is free software; you can redistribute it and/or modify
--- 1,7 ----
  /*
!  * ExpandableObjectConverter.cs - Implementation of the
!  *            
"System.ComponentModel.ComponentModel.ExpandableObjectConverter" class.
   *
!  * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 20,52 ****
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
- using System;
  
  namespace System.ComponentModel
  {
  #if CONFIG_COMPONENT_MODEL
!       public class ExpandableObjectConverter: TypeConverter
!       {
!               [TODO]
!               public ExpandableObjectConverter()
!               {
!                       throw new NotImplementedException(".ctor");
!               }
! 
!               [TODO]
!               public override PropertyDescriptorCollection GetProperties(
!                                               ITypeDescriptorContext context, 
Object value, 
!                                               Attribute[] attributes)
!               {
!                       throw new NotImplementedException("GetProperties");
!               }
! 
!               [TODO]
!               public override bool GetPropertiesSupported(
!                                               ITypeDescriptorContext context)
!               {
!                       throw new 
NotImplementedException("GetPropertiesSupported");
!               }
! 
!       }
! #endif        
! }//namespace
--- 19,56 ----
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
  
  namespace System.ComponentModel
  {
+ 
  #if CONFIG_COMPONENT_MODEL
! 
! using System;
! using System.Collections;
! using System.Globalization;
! using System.ComponentModel.Design;
! 
! public class ExpandableObjectConverter : TypeConverter
! {
!       // Constructor.
!       public ExpandableObjectConverter() {}
! 
!       // Get the properties for an object.
!       public override PropertyDescriptorCollection GetProperties
!                               (ITypeDescriptorContext context, Object value,
!                                Attribute[] attributes)
!                       {
!                               return TypeDescriptor.GetProperties(value, 
attributes);
!                       }
! 
!       // Determine if the "GetProperties" method is supported.
!       public override bool GetPropertiesSupported
!                               (ITypeDescriptorContext context)
!                       {
!                               return true;
!                       }
! 
! }; // class ExpandableObjectConverter
! 
! #endif // CONFIG_COMPONENT_MODEL
! 
! }; // namespace System.ComponentModel

Index: GuidConverter.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/GuidConverter.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** GuidConverter.cs    8 Aug 2003 02:56:50 -0000       1.1
--- GuidConverter.cs    16 Sep 2003 05:25:31 -0000      1.2
***************
*** 28,31 ****
--- 28,32 ----
  using System.Collections;
  using System.Globalization;
+ using System.Reflection;
  using System.ComponentModel.Design.Serialization;
  
***************
*** 81,85 ****
  
        // Convert this object into another type.
-       [TODO]
        public override Object ConvertTo(ITypeDescriptorContext context,
                                                                         
CultureInfo culture,
--- 82,85 ----
***************
*** 95,109 ****
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               else if(destinationType == 
typeof(InstanceDescriptor))
                                {
!                                       // TODO
!                                       return null;
                                }
                        #endif
!                               else
!                               {
!                                       return base.ConvertTo
!                                               (context, culture, value, 
destinationType);
!                               }
                        }
  
--- 95,114 ----
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               if(destinationType == 
typeof(InstanceDescriptor) &&
!                                  value is Guid)
                                {
!                                       ConstructorInfo ctor;
!                                       ctor = typeof(Guid).GetConstructor
!                                                       (new Type [] 
{typeof(String)});
!                                       if(ctor == null)
!                                       {
!                                               return null;
!                                       }
!                                       return new InstanceDescriptor
!                                               (ctor, new Object [] 
{((Guid)value).ToString()});
                                }
                        #endif
!                               return base.ConvertTo
!                                       (context, culture, value, 
destinationType);
                        }
  

Index: IComponent.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/IComponent.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** IComponent.cs       8 Aug 2003 05:52:47 -0000       1.3
--- IComponent.cs       16 Sep 2003 05:25:31 -0000      1.4
***************
*** 31,35 ****
  
  [ComVisible(true)]
! //TODO: [TypeConverter(typeof(ComponentConverter))]
  #if CONFIG_COMPONENT_MODEL_DESIGN
  [Designer
--- 31,35 ----
  
  [ComVisible(true)]
! [TypeConverter(typeof(ComponentConverter))]
  #if CONFIG_COMPONENT_MODEL_DESIGN
  [Designer
***************
*** 37,41 ****
         typeof(IRootDesigner))]
  [Designer
!       ("System.Windows.Forms.Design.ComponentDocumentDesigner, System.Design",
         typeof(IDesigner))]
  [RootDesignerSerializer
--- 37,41 ----
         typeof(IRootDesigner))]
  [Designer
!       ("System.ComponentModel.Design.ComponentDesigner, System.Design",
         typeof(IDesigner))]
  [RootDesignerSerializer

Index: LicenseManager.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/LicenseManager.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** LicenseManager.cs   12 Sep 2003 06:08:58 -0000      1.1
--- LicenseManager.cs   16 Sep 2003 05:25:31 -0000      1.2
***************
*** 130,134 ****
                                }
                        }
!       public static void Validate(Type type, Object instance)
                        {
                                License license;
--- 130,134 ----
                                }
                        }
!       public static License Validate(Type type, Object instance)
                        {
                                License license;
***************
*** 137,140 ****
--- 137,141 ----
                                        throw new LicenseException(type, 
instance);
                                }
+                               return license;
                        }
  

Index: LicenseProviderAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/LicenseProviderAttribute.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** LicenseProviderAttribute.cs 12 Sep 2003 06:08:58 -0000      1.1
--- LicenseProviderAttribute.cs 16 Sep 2003 05:25:31 -0000      1.2
***************
*** 27,35 ****
  using System;
  
! [AttributeUsage(AttributeTargets.Class)]
  public sealed class LicenseProviderAttribute : Attribute
  {
        // Internal state.
        private Type type;
  
        // Constructors.
--- 27,40 ----
  using System;
  
! [AttributeUsage(AttributeTargets.Class,
!                               AllowMultiple=false, Inherited=false)]
  public sealed class LicenseProviderAttribute : Attribute
  {
        // Internal state.
        private Type type;
+ 
+       // The default attribute value.
+       public static readonly LicenseProviderAttribute Default =
+                       new LicenseProviderAttribute();
  
        // Constructors.

Index: MarshalByValueComponent.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/MarshalByValueComponent.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** MarshalByValueComponent.cs  8 Aug 2003 05:52:47 -0000       1.5
--- MarshalByValueComponent.cs  16 Sep 2003 05:25:31 -0000      1.6
***************
*** 29,33 ****
  
  [DesignerCategory("Component")]
! // TODO: [TypeConverter(typeof(ComponentConverter))]
  #if CONFIG_COMPONENT_MODEL_DESIGN
  [Designer
--- 29,33 ----
  
  [DesignerCategory("Component")]
! [TypeConverter(typeof(ComponentConverter))]
  #if CONFIG_COMPONENT_MODEL_DESIGN
  [Designer

Index: MemberDescriptor.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/MemberDescriptor.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** MemberDescriptor.cs 29 May 2003 05:38:17 -0000      1.2
--- MemberDescriptor.cs 16 Sep 2003 05:25:31 -0000      1.3
***************
*** 3,7 ****
   *            "System.ComponentModel.ComponentModel.MemberDescriptor" class.
   *
!  * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
--- 3,7 ----
   *            "System.ComponentModel.ComponentModel.MemberDescriptor" class.
   *
!  * Copyright (C) 2002, 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 28,31 ****
--- 28,32 ----
  using System.Reflection;
  using System.Runtime.InteropServices;
+ using System.ComponentModel.Design;
  
  [ComVisible(true)]
***************
*** 38,42 ****
--- 39,45 ----
        private String description;
        private bool designTimeOnly;
+       private bool loadedDesignTimeOnly;
        private bool isBrowsable;
+       private bool loadedBrowsable;
        private String displayName;
        private String name;
***************
*** 47,62 ****
        protected MemberDescriptor(String name)
                        : this(name, null) {}
-       [TODO]
        protected MemberDescriptor
                                (MemberDescriptor descr, Attribute[] 
newAttributes)
                        {
!                               // TODO
!                               name = descr.Name;
                        }
-       [TODO]
        protected MemberDescriptor(String name, Attribute[] newAttributes)
                        {
!                               // TODO
                                this.name = name;
                        }
  
--- 50,96 ----
        protected MemberDescriptor(String name)
                        : this(name, null) {}
        protected MemberDescriptor
                                (MemberDescriptor descr, Attribute[] 
newAttributes)
                        {
!                               this.name = descr.Name;
!                               this.displayName = descr.DisplayName;
!                               this.attributes =
!                                       MergeAttributes(descr.AttributeArray, 
newAttributes);
                        }
        protected MemberDescriptor(String name, Attribute[] newAttributes)
                        {
!                               if(name == null || name.Length == 0)
!                               {
!                                       throw new ArgumentException
!                                               
(S._("ArgRange_StringNonEmpty"), "name");
!                               }
                                this.name = name;
+                               this.displayName = name;
+                               this.attributes = newAttributes;
+                       }
+ 
+       // Merge two attribute lists.
+       private static Attribute[] MergeAttributes
+                               (Attribute[] list1, Attribute[] list2)
+                       {
+                               if(list1 == null)
+                               {
+                                       if(list2 == null)
+                                       {
+                                               return null;
+                                       }
+                                       else
+                                       {
+                                               return 
(Attribute[])(list2.Clone());
+                                       }
+                               }
+                               else if(list2 == null)
+                               {
+                                       return (Attribute[])(list1.Clone());
+                               }
+                               Attribute[] list = new Attribute [list1.Length 
+ list2.Length];
+                               Array.Copy(list1, 0, list, 0, list1.Length);
+                               Array.Copy(list2, 0, list, list1.Length, 
list2.Length);
+                               return list;
                        }
  
***************
*** 73,118 ****
                                }
                        }
-       [TODO]
        public virtual String Category
                        {
                                get
                                {
!                                       // TODO
                                        return category;
                                }
                        }
-       [TODO]
        public virtual String Description
                        {
                                get
                                {
!                                       // TODO
                                        return description;
                                }
                        }
-       [TODO]
        public virtual bool DesignTimeOnly
                        {
                                get
                                {
!                                       // TODO
                                        return designTimeOnly;
                                }
                        }
-       [TODO]
        public virtual String DisplayName
                        {
                                get
                                {
-                                       // TODO
                                        return displayName;
                                }
                        }
-       [TODO]
        public virtual bool IsBrowsable
                        {
                                get
                                {
!                                       // TODO
                                        return isBrowsable;
                                }
--- 107,184 ----
                                }
                        }
        public virtual String Category
                        {
                                get
                                {
!                                       if(category == null)
!                                       {
!                                               CategoryAttribute attr;
!                                               attr = (CategoryAttribute)
!                                                       
(Attributes[typeof(CategoryAttribute)]);
!                                               if(attr != null)
!                                               {
!                                                       category = 
attr.Category;
!                                               }
!                                       }
                                        return category;
                                }
                        }
        public virtual String Description
                        {
                                get
                                {
!                                       if(description == null)
!                                       {
!                                               DescriptionAttribute attr;
!                                               attr = (DescriptionAttribute)
!                                                       
(Attributes[typeof(DescriptionAttribute)]);
!                                               if(attr != null)
!                                               {
!                                                       description = 
attr.Description;
!                                               }
!                                       }
                                        return description;
                                }
                        }
        public virtual bool DesignTimeOnly
                        {
                                get
                                {
!                                       if(!loadedDesignTimeOnly)
!                                       {
!                                               DesignOnlyAttribute attr;
!                                               attr = (DesignOnlyAttribute)
!                                                       
(Attributes[typeof(DesignOnlyAttribute)]);
!                                               if(attr != null)
!                                               {
!                                                       designTimeOnly = 
attr.IsDesignOnly;
!                                               }
!                                               loadedDesignTimeOnly = true;
!                                       }
                                        return designTimeOnly;
                                }
                        }
        public virtual String DisplayName
                        {
                                get
                                {
                                        return displayName;
                                }
                        }
        public virtual bool IsBrowsable
                        {
                                get
                                {
!                                       if(!loadedBrowsable)
!                                       {
!                                               BrowsableAttribute attr;
!                                               attr = (BrowsableAttribute)
!                                                       
(Attributes[typeof(BrowsableAttribute)]);
!                                               if(attr != null)
!                                               {
!                                                       isBrowsable = 
attr.Browsable;
!                                               }
!                                               loadedBrowsable = true;
!                                       }
                                        return isBrowsable;
                                }
***************
*** 134,138 ****
  
        // Determine if this member descriptor is equal to another.
-       [TODO]
        public override bool Equals(Object obj)
                        {
--- 200,203 ----
***************
*** 140,145 ****
                                if(other != null)
                                {
!                                       // TODO
!                                       return false;
                                }
                                else
--- 205,236 ----
                                if(other != null)
                                {
!                                       if(other.Name != Name ||
!                                          other.Category != Category ||
!                                          other.Description != Description)
!                                       {
!                                               return false;
!                                       }
!                                       Attribute[] attrs = 
other.AttributeArray;
!                                       if(attrs == null)
!                                       {
!                                               return (attributes == null || 
attributes.Length == 0);
!                                       }
!                                       else if(attributes == null)
!                                       {
!                                               return (attrs.Length == 0);
!                                       }
!                                       else if(attrs.Length != 
attributes.Length)
!                                       {
!                                               return false;
!                                       }
!                                       int index;
!                                       for(index = 0; index < attrs.Length; 
++index)
!                                       {
!                                               
if(!attributes[index].Equals(attrs[index]))
!                                               {
!                                                       return false;
!                                               }
!                                       }
!                                       return true;
                                }
                                else
***************
*** 156,160 ****
  
        // Get or set the entire attribute array.
-       [TODO]
        protected virtual Attribute[] AttributeArray
                        {
--- 247,250 ----
***************
*** 236,252 ****
  
        // Get the object to be invoked.
-       [TODO]
        protected static Object GetInvokee(Type componentClass, Object 
component)
                        {
!                               // TODO
!                               return component;
                        }
  
        // Get a component site for an object.
-       [TODO]
        protected static ISite GetSite(Object component)
                        {
!                               // TODO
!                               return null;
                        }
  
--- 326,371 ----
  
        // Get the object to be invoked.
        protected static Object GetInvokee(Type componentClass, Object 
component)
                        {
!                               if(componentClass.IsInstanceOfType(component))
!                               {
!                                       return component;
!                               }
!                               if(!(component is IComponent))
!                               {
!                                       return component;
!                               }
!                               ISite site = ((IComponent)component).Site;
!                               if(site == null || !(site.DesignMode))
!                               {
!                                       return component;
!                               }
!                               IDesignerHost host = (IDesignerHost)
!                                       site.GetService(typeof(IDesignerHost));
!                               if(host == null)
!                               {
!                                       return component;
!                               }
!                               IDesigner designer = 
host.GetDesigner((IComponent)component);
!                               if(designer == null ||
!                                  !(componentClass.IsInstanceOfType(designer)))
!                               {
!                                       return component;
!                               }
!                               return designer;
                        }
  
        // Get a component site for an object.
        protected static ISite GetSite(Object component)
                        {
!                               IComponent comp = (component as IComponent);
!                               if(comp != null)
!                               {
!                                       return comp.Site;
!                               }
!                               else
!                               {
!                                       return null;
!                               }
                        }
  

Index: PropertyDescriptor.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/PropertyDescriptor.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** PropertyDescriptor.cs       10 Jun 2003 05:00:27 -0000      1.4
--- PropertyDescriptor.cs       16 Sep 2003 05:25:31 -0000      1.5
***************
*** 3,7 ****
   *            "System.ComponentModel.ComponentModel.PropertyDescriptor" class.
   *
!  * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
--- 3,7 ----
   *            "System.ComponentModel.ComponentModel.PropertyDescriptor" class.
   *
!  * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 29,157 ****
  using System.Runtime.InteropServices;
  
- [TODO]
  [ComVisible(true)]
  public abstract class PropertyDescriptor : MemberDescriptor
  {
!       // TODO
!       public PropertyDescriptor(String name) : base(name) {}
!       
!       public PropertyDescriptor(String name, Attribute[] attrs) : base(name) 
{}
! 
!       protected PropertyDescriptor(MemberDescriptor desc, Attribute[] attrs) 
!                               : base(desc) {}
!       [TODO]
        public virtual void AddValueChanged(Object component, EventHandler 
handler)
!       {
!                throw new NotImplementedException("AddValueChanged");
!       }
  
        public abstract bool CanResetValue(Object component);
  
!       [TODO]
!       protected Object CreateInstance(Type type)
!       {
!                throw new NotImplementedException("CreateInstance");
!       }
! 
!       [TODO]
        public override bool Equals(Object obj)
!       {
!                throw new NotImplementedException("Equals");
!       }
  
!       [TODO]
        public PropertyDescriptorCollection GetChildProperties()
!       {
!                throw new NotImplementedException("GetChildProperties");
!       }
! 
!       [TODO]
        public PropertyDescriptorCollection GetChildProperties(Attribute[] 
filter)
!       {
!                throw new NotImplementedException("GetChildProperties");
!       }
! 
!       [TODO]
        public PropertyDescriptorCollection GetChildProperties(Object instance)
!       {
!                throw new NotImplementedException("GetChildProperties");
!       }
! 
!       [TODO]
!       public virtual PropertyDescriptorCollection GetChildProperties(Object 
instance, Attribute[] filter)
!       {
!                throw new NotImplementedException("GetChildProperties");
!       }
  
!       [TODO]
        public virtual Object GetEditor(Type editorBaseType)
!       {
!                throw new NotImplementedException("GetEditor");
!       }
  
!       [TODO]
        public override int GetHashCode()
!       {
!                throw new NotImplementedException("GetHashCode");
!       }
! 
!       [TODO]
!       protected Type GetTypeFromName(String typeName)
!       {
!                throw new NotImplementedException("GetTypeFromName");
!       }
  
        public abstract Object GetValue(Object component);
  
!       [TODO]
!       protected virtual void OnValueChanged(Object component, EventArgs e)
!       {
!                throw new NotImplementedException("OnValueChanged");
!       }
! 
!       [TODO]
!       public virtual void RemoveValueChanged(Object component, EventHandler 
handler)
!       {
!                throw new NotImplementedException("RemoveValueChanged");
!       }
  
        public abstract void ResetValue(Object component);
  
        public abstract void SetValue(Object component, Object value);
  
        public abstract bool ShouldSerializeValue(Object component);
  
!       public abstract Type ComponentType { get; }
  
!       [TODO]
!       public virtual TypeConverter Converter 
!       {
!               get
!               {
!                       throw new NotImplementedException("Converter");
!               }
!       }
! 
!       [TODO]
!       public virtual bool IsLocalizable 
!       {
!               get
!               {
!                       throw new NotImplementedException("IsLocalizable");
!               }
!       }
! 
!       public abstract bool IsReadOnly { get; } 
! 
!       public abstract Type PropertyType { get; } 
! 
!       [TODO]
!       public DesignerSerializationVisibility SerializationVisibility 
!       {
!               get
!               {
!                       throw new 
NotImplementedException("SerializationVisibility");
!               }
!       }
  
  }; // class PropertyDescriptor
--- 29,295 ----
  using System.Runtime.InteropServices;
  
  [ComVisible(true)]
  public abstract class PropertyDescriptor : MemberDescriptor
  {
!       // Internal state.
!       private TypeConverter converter;
!       private Hashtable changedHandlers;
! 
!       // Constructors.
!       protected PropertyDescriptor(MemberDescriptor descr) : base(descr) {}
!       protected PropertyDescriptor(String name, Attribute[] attrs)
!                       : base(name, attrs) {}
!       protected PropertyDescriptor(MemberDescriptor descr, Attribute[] attrs) 
!                       : base(descr, attrs) {}
! 
!       // Get the component type that owns this property.
!       public abstract Type ComponentType { get; }
! 
!       // Get the type converter for this property's value.
!       public virtual TypeConverter Converter
!                       {
!                               get
!                               {
!                                       if(converter == null)
!                                       {
!                                               TypeConverterAttribute attr;
!                                               attr = (TypeConverterAttribute)
!                                                       
(Attributes[typeof(TypeConverterAttribute)]);
!                                               if(attr != null)
!                                               {
!                                                       // The property has a 
converter declaration.
!                                                       Type type = 
GetTypeFromName(attr.ConverterTypeName);
!                                                       if(type != null)
!                                                       {
!                                                               converter = 
(TypeConverter)CreateInstance(type);
!                                                       }
!                                               }
!                                               if(converter == null)
!                                               {
!                                                       // Check the property 
type for a converter.
!                                                       converter =
!                                                               
TypeDescriptor.GetConverter(PropertyType);
!                                               }
!                                       }
!                                       return converter;
!                               }
!                       }
! 
!       // Determine if this property is localizable.
!       public virtual bool IsLocalizable
!                       {
!                               get
!                               {
!                                       LocalizableAttribute attr;
!                                       attr = (LocalizableAttribute)
!                                               
(Attributes[typeof(LocalizableAttribute)]);
!                                       if(attr != null)
!                                       {
!                                               return attr.IsLocalizable;
!                                       }
!                                       else
!                                       {
!                                               return false;
!                                       }
!                               }
!                       }
! 
!       // Determine if this property is read-only.
!       public abstract bool IsReadOnly { get; }
! 
!       // Get the type of this property.
!       public abstract Type PropertyType { get; }
! 
!       // Get the serialization visibility of this property.
!       public DesignerSerializationVisibility SerializationVisibility
!                       {
!                               get
!                               {
!                                       
DesignerSerializationVisibilityAttribute attr;
!                                       attr = 
(DesignerSerializationVisibilityAttribute)
!                                               (Attributes
!                                                 
[typeof(DesignerSerializationVisibilityAttribute)]);
!                                       if(attr != null)
!                                       {
!                                               return attr.Visibility;
!                                       }
!                                       else
!                                       {
!                                               return 
DesignerSerializationVisibility.Visible;
!                                       }
!                               }
!                       }
! 
!       // Add an event delegate that tracks when this value is changed.
        public virtual void AddValueChanged(Object component, EventHandler 
handler)
!                       {
!                               if(component == null)
!                               {
!                                       throw new 
ArgumentNullException("component");
!                               }
!                               if(handler == null)
!                               {
!                                       throw new 
ArgumentNullException("handler");
!                               }
!                               if(changedHandlers == null)
!                               {
!                                       changedHandlers = new Hashtable();
!                               }
!                               Object list = changedHandlers[component];
!                               if(list == null)
!                               {
!                                       changedHandlers[component] = handler;
!                               }
!                               else
!                               {
!                                       changedHandlers[component] =
!                                               ((EventHandler)list) + handler;
!                               }
!                       }
  
+       // Determine if resetting a component's property will change its value.
        public abstract bool CanResetValue(Object component);
  
!       // Determine if two objects are equal.
        public override bool Equals(Object obj)
!                       {
!                               if(obj is PropertyDescriptor)
!                               {
!                                       return base.Equals(obj);
!                               }
!                               else
!                               {
!                                       return false;
!                               }
!                       }
  
!       // Get the child properties.
        public PropertyDescriptorCollection GetChildProperties()
!                       {
!                               return GetChildProperties(null, null);
!                       }
        public PropertyDescriptorCollection GetChildProperties(Attribute[] 
filter)
!                       {
!                               return GetChildProperties(null, filter);
!                       }
        public PropertyDescriptorCollection GetChildProperties(Object instance)
!                       {
!                               return GetChildProperties(instance, null);
!                       }
!       public virtual PropertyDescriptorCollection GetChildProperties
!                               (Object instance, Attribute[] filter)
!                       {
!                               if(instance != null)
!                               {
!                                       return 
TypeDescriptor.GetProperties(instance, filter);
!                               }
!                               else
!                               {
!                                       return TypeDescriptor.GetProperties
!                                               (PropertyType, filter);
!                               }
!                       }
  
!       // Get an editor of the specified type.
        public virtual Object GetEditor(Type editorBaseType)
!                       {
!                               // Look for an editor declaration on the 
property itself.
!                               foreach(Attribute attr in Attributes)
!                               {
!                                       if(attr is EditorAttribute)
!                                       {
!                                               
if(GetTypeFromName(((EditorAttribute)attr)
!                                                                               
                .EditorBaseTypeName)
!                                                               == 
editorBaseType)
!                                               {
!                                                       Type type = 
GetTypeFromName
!                                                               
(((EditorAttribute)attr).EditorTypeName);
!                                                       if(type != null)
!                                                       {
!                                                               return 
CreateInstance(type);
!                                                       }
!                                               }
!                                       }
!                               }
! 
!                               // Look for an editor for the property's type.
!                               return TypeDescriptor.GetEditor(PropertyType, 
editorBaseType);
!                       }
  
!       // Get a hash code for this object.
        public override int GetHashCode()
!                       {
!                               return base.GetHashCode();
!                       }
  
+       // Get the property value associated with a component.
        public abstract Object GetValue(Object component);
  
!       // Remove an event delegate that tracks when this value is changed.
!       public virtual void RemoveValueChanged
!                               (Object component, EventHandler handler)
!                       {
!                               if(component == null)
!                               {
!                                       throw new 
ArgumentNullException("component");
!                               }
!                               if(handler == null)
!                               {
!                                       throw new 
ArgumentNullException("handler");
!                               }
!                               if(changedHandlers == null)
!                               {
!                                       return;
!                               }
!                               Object list = changedHandlers[component];
!                               if(list != null)
!                               {
!                                       list = ((EventHandler)list) - handler;
!                                       if(list != null)
!                                       {
!                                               changedHandlers[component] = 
list;
!                                       }
!                                       else
!                                       {
!                                               
changedHandlers.Remove(component);
!                                       }
!                               }
!                       }
  
+       // Reset the property value associated with a component.
        public abstract void ResetValue(Object component);
  
+       // Set the property value associated with a component.
        public abstract void SetValue(Object component, Object value);
  
+       // Determine if a property value needs to be serialized.
        public abstract bool ShouldSerializeValue(Object component);
  
!       // Create an instance of a type.
!       protected Object CreateInstance(Type type)
!                       {
!                               return Activator.CreateInstance
!                                       (type, new Object[] {PropertyType});
!                       }
! 
!       // Get a type from its name.
!       protected Type GetTypeFromName(String typeName)
!                       {
!                               return Type.GetType(typeName);
!                       }
  
!       // Raise a value changed event for a component.
!       protected virtual void OnValueChanged(Object component, EventArgs e)
!                       {
!                               if(component != null && changedHandlers != null)
!                               {
!                                       EventHandler list = (EventHandler)
!                                               changedHandlers[component];
!                                       if(list != null)
!                                       {
!                                               list(component, e);
!                                       }
!                               }
!                       }
  
  }; // class PropertyDescriptor

Index: PropertyDescriptorCollection.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/PropertyDescriptorCollection.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** PropertyDescriptorCollection.cs     29 May 2003 05:38:17 -0000      1.3
--- PropertyDescriptorCollection.cs     16 Sep 2003 05:25:31 -0000      1.4
***************
*** 1,7 ****
  /*
   * PropertyDescriptorCollection.cs - Implementation of the
!  *    "System.ComponentModel.ComponentModel.PropertyDescriptorCollection" 
class.
   *
!  * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
--- 1,7 ----
  /*
   * PropertyDescriptorCollection.cs - Implementation of the
!  *                    "System.ComponentModel.PropertyDescriptorCollection" 
class.
   *
!  * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 26,311 ****
  
  using System.Collections;
  using System.Runtime.InteropServices;
  
! [TODO]
! [ComVisible(true)]
! public class PropertyDescriptorCollection : IDictionary, IEnumerable, 
!                                                                               
        ICollection, IList
  {
!       // TODO
        public static readonly PropertyDescriptorCollection Empty =
!                                                               new 
PropertyDescriptorCollection(null);
  
!       [TODO]
!       public PropertyDescriptorCollection() 
!       {
!       }
!       
!       [TODO]
!       public PropertyDescriptorCollection(PropertyDescriptor [] properties) 
!       {
!       }
  
!       [TODO]
        public int Add(PropertyDescriptor value)
!       {
!                throw new NotImplementedException("Add");
!       }
  
!       [TODO]
        public void Clear()
!       {
!                throw new NotImplementedException("Clear");
!       }
  
!       [TODO]
        public bool Contains(PropertyDescriptor value)
!       {
!                throw new NotImplementedException("Contains");
!       }
! 
!       [TODO]
!       public void CopyTo(Array array, int index)
!       {
!                throw new NotImplementedException("CopyTo");
!       }
  
!       [TODO]
        public virtual PropertyDescriptor Find(String name, bool ignoreCase)
!       {
!                throw new NotImplementedException("Find");
!       }
  
!       [TODO]
        public virtual IEnumerator GetEnumerator()
!       {
!                throw new NotImplementedException("GetEnumerator");
!       }
  
!       [TODO]
        public int IndexOf(PropertyDescriptor value)
!       {
!                throw new NotImplementedException("IndexOf");
!       }
  
!       [TODO]
        public void Insert(int index, PropertyDescriptor value)
!       {
!                throw new NotImplementedException("Insert");
!       }
! 
!       [TODO]
!       protected void InternalSort(IComparer ic)
!       {
!                throw new NotImplementedException("InternalSort");
!       }
! 
!       [TODO]
!       protected void InternalSort(String[] order)
!       {
!                throw new NotImplementedException("InternalSort");
!       }
  
!       [TODO]
        public void Remove(PropertyDescriptor value)
!       {
!                throw new NotImplementedException("Remove");
!       }
  
!       [TODO]
        public void RemoveAt(int index)
!       {
!                throw new NotImplementedException("RemoveAt");
!       }
  
!       [TODO]
        public virtual PropertyDescriptorCollection Sort()
!       {
!                throw new NotImplementedException("Sort");
!       }
! 
!       [TODO]
!       public virtual PropertyDescriptorCollection Sort(IComparer ic)
!       {
!                throw new NotImplementedException("Sort");
!       }
! 
!       [TODO]
!       public virtual PropertyDescriptorCollection Sort(String []names)
!       {
!                throw new NotImplementedException("Sort");
!       }
! 
!       [TODO]
!       public int Count 
!       {
!               get
!               {
!                       throw new NotImplementedException("Count");
!               }
!       }
! 
!       [TODO]
!       public bool IsReadOnly 
!       {
!               get
!               {
!                       throw new NotImplementedException("IsReadOnly");
!               }
!       }
! 
!       [TODO]
!       public bool IsSynchronized 
!       {
!               get
!               {
!                       throw new NotImplementedException("IsSynchronized");
!               }
!       }
! 
!       [TODO]
!       public virtual PropertyDescriptor this[String name] 
!       {
!               get
!               {
!                       throw new NotImplementedException("Item");
!               }
!       }
  
!       [TODO]
!       public virtual PropertyDescriptor this[int index] 
!       {
!               get
!               {
!                       throw new NotImplementedException("Item");
!               }
!       }
! 
!       // NOTE: only the missing interface cases have been implemented , others
!       // are automatically obtained from the various virtual methods above.
!       // Implementor might find it necessary to split them out into seperate
!       // explicit interface methods.
! 
!       // IList implements
! 
!       [TODO]
        int IList.Add(Object value)
!       {
!               throw new NotImplementedException();
!       }
! 
!       [TODO]
        bool IList.Contains(Object value)
!       {
!               throw new NotImplementedException();
!       }
! 
!       [TODO]
        int IList.IndexOf(Object value)
!       {
!               throw new NotImplementedException();
!       }
! 
!       [TODO]
        void IList.Insert(int index, Object value)
!       {
!               throw new NotImplementedException();
!       }
! 
!       [TODO]
        void IList.Remove(Object value)
!       {
!               throw new NotImplementedException();
!       }
  
!       [TODO]
!       bool IList.IsFixedSize 
!       {
!               get
!               {
!                       throw new NotImplementedException();
!               }
!       }
!       
!       [TODO]
!       Object IList.this[int index] 
!       {
!               get
!               {
!                       throw new NotImplementedException();
!               }
!               set
!               {
!                       throw new NotImplementedException();
!               }
!       }
! 
!       // ICollection implements
!       Object ICollection.SyncRoot 
!       { 
!               get
!               {
!                       throw new NotImplementedException();
!               }
!       }
! 
!       // IDictionary implements
  
        void IDictionary.Add(Object key, Object value)
!       {
!               throw new NotImplementedException();
!       }
! 
        bool IDictionary.Contains(Object key)
!       {
!               throw new NotImplementedException();
!       }
! 
        IDictionaryEnumerator IDictionary.GetEnumerator()
!       {
!               throw new NotImplementedException();
!       }
! 
        void IDictionary.Remove(Object key)
!       {
!               throw new NotImplementedException();
!       }
! 
        bool IDictionary.IsFixedSize
!       {
!               get
!               {
!                       throw new NotImplementedException();
!               }
!       }
! 
        Object IDictionary.this[Object key]
!       {
!               get
!               {
!                       throw new NotImplementedException();
!               }
!               set
!               {
!                       throw new NotImplementedException();
!               }
!       }
! 
        ICollection IDictionary.Keys
!       {
!               get
!               {
!                       throw new NotImplementedException();
!               }
!       }
!       
        ICollection IDictionary.Values
!       {
!               get
!               {
!                       throw new NotImplementedException();
!               }
!       }
!       
  
  }; // class PropertyDescriptorCollection
--- 26,463 ----
  
  using System.Collections;
+ using System.Globalization;
  using System.Runtime.InteropServices;
  
! public class PropertyDescriptorCollection
!               : IList, ICollection, IEnumerable, IDictionary
  {
!       // Internal state.
!       private ArrayList list;
! 
!       // Empty collection.
        public static readonly PropertyDescriptorCollection Empty =
!                       new PropertyDescriptorCollection(null);
  
!       // Constructors.
!       public PropertyDescriptorCollection(PropertyDescriptor[] properties)
!                       {
!                               list = new ArrayList();
!                               if(properties != null)
!                               {
!                                       foreach(PropertyDescriptor descr in 
properties)
!                                       {
!                                               list.Add(descr);
!                                       }
!                               }
!                       }
!       private PropertyDescriptorCollection(PropertyDescriptorCollection 
copyFrom,
!                                                                            
String[] names, IComparer comparer)
!                       {
!                               list = (ArrayList)(copyFrom.list.Clone());
!                               InternalSort(names, comparer);
!                       }
! 
!       // Get the number of items in the collection.
!       public int Count
!                       {
!                               get
!                               {
!                                       return list.Count;
!                               }
!                       }
! 
!       // Get a specific property by index.
!       public virtual PropertyDescriptor this[int index]
!                       {
!                               get
!                               {
!                                       if(index < 0 || index >= list.Count)
!                                       {
!                                               throw new 
IndexOutOfRangeException
!                                                       
(S._("Arg_InvalidArrayIndex"));
!                                       }
!                                       return 
(PropertyDescriptor)(list[index]);
!                               }
!                       }
! 
!       // Get a specific property by name.
!       public virtual PropertyDescriptor this[String name]
!                       {
!                               get
!                               {
!                                       return Find(name, false);
!                               }
!                       }
  
!       // Add an descriptor to this collection.
        public int Add(PropertyDescriptor value)
!                       {
!                               return list.Add(value);
!                       }
  
!       // Clear this collection.
        public void Clear()
!                       {
!                               list.Clear();
!                       }
  
!       // Determine if this collection contains a particular descriptor.
        public bool Contains(PropertyDescriptor value)
!                       {
!                               return list.Contains(value);
!                       }
  
!       // Find a descriptor with a specific name.
        public virtual PropertyDescriptor Find(String name, bool ignoreCase)
!                       {
!                               foreach(PropertyDescriptor descr in list)
!                               {
!                                       if(String.Compare(descr.Name, name, 
ignoreCase,
!                                                                         
CultureInfo.InvariantCulture) == 0)
!                                       {
!                                               return descr;
!                                       }
!                               }
!                               return null;
!                       }
  
!       // Get an enumerator for this collection.
        public virtual IEnumerator GetEnumerator()
!                       {
!                               return list.GetEnumerator();
!                       }
  
!       // Get the index of a specific descriptor within the collection.
        public int IndexOf(PropertyDescriptor value)
!                       {
!                               return list.IndexOf(value);
!                       }
  
!       // Insert a descriptor into this collection.
        public void Insert(int index, PropertyDescriptor value)
!                       {
!                               list.Insert(index, value);
!                       }
  
!       // Remove a descriptor from this collection.
        public void Remove(PropertyDescriptor value)
!                       {
!                               list.Remove(value);
!                       }
  
!       // Remove a descriptor at a particular index within this collection.
        public void RemoveAt(int index)
!                       {
!                               list.RemoveAt(index);
!                       }
  
!       // Sort the descriptor collection.
        public virtual PropertyDescriptorCollection Sort()
!                       {
!                               return new PropertyDescriptorCollection(this, 
null, null);
!                       }
!       public virtual PropertyDescriptorCollection Sort(IComparer comparer)
!                       {
!                               return new PropertyDescriptorCollection(this, 
null, comparer);
!                       }
!       public virtual PropertyDescriptorCollection Sort(String[] names)
!                       {
!                               return new PropertyDescriptorCollection(this, 
names, null);
!                       }
!       public virtual PropertyDescriptorCollection Sort
!                               (String[] names, IComparer comparer)
!                       {
!                               return new PropertyDescriptorCollection(this, 
names, comparer);
!                       }
! 
!       // Internal version of "Sort".
!       private void InternalSort(String[] names, IComparer comparer)
!                       {
!                               if(comparer == null)
!                               {
!                                       comparer = new 
TypeDescriptor.DescriptorComparer();
!                               }
!                               if(names != null && names.Length > 0)
!                               {
!                                       // Copy across elements from "names" 
before
!                                       // sorting the main list and appending 
it.
!                                       ArrayList newList = new 
ArrayList(list.Count);
!                                       foreach(String name in names)
!                                       {
!                                               PropertyDescriptor descr = 
Find(name, false);
!                                               if(descr != null)
!                                               {
!                                                       newList.Add(descr);
!                                                       list.Remove(descr);
!                                               }
!                                       }
!                                       list.Sort(comparer);
!                                       foreach(PropertyDescriptor ed in list)
!                                       {
!                                               newList.Add(ed);
!                                       }
!                                       list = newList;
!                               }
!                               else
!                               {
!                                       // No names, so just sort the main list.
!                                       list.Sort(comparer);
!                               }
!                       }
!       protected void InternalSort(IComparer comparer)
!                       {
!                               InternalSort(null, comparer);
!                       }
!       protected void InternalSort(String[] names)
!                       {
!                               InternalSort(names, null);
!                       }
  
!       // Implement the IList interface.
        int IList.Add(Object value)
!                       {
!                               return Add((PropertyDescriptor)value);
!                       }
!       void IList.Clear()
!                       {
!                               Clear();
!                       }
        bool IList.Contains(Object value)
!                       {
!                               return list.Contains(value);
!                       }
        int IList.IndexOf(Object value)
!                       {
!                               return list.IndexOf(value);
!                       }
        void IList.Insert(int index, Object value)
!                       {
!                               Insert(index, (PropertyDescriptor)value);
!                       }
        void IList.Remove(Object value)
!                       {
!                               list.Remove(value);
!                       }
!       void IList.RemoveAt(int index)
!                       {
!                               list.RemoveAt(index);
!                       }
!       bool IList.IsFixedSize
!                       {
!                               get
!                               {
!                                       return false;
!                               }
!                       }
!       bool IList.IsReadOnly
!                       {
!                               get
!                               {
!                                       return false;
!                               }
!                       }
!       Object IList.this[int index]
!                       {
!                               get
!                               {
!                                       return this[index];
!                               }
!                               set
!                               {
!                                       list[index] = (PropertyDescriptor)value;
!                               }
!                       }
  
!       // Implement the ICollection interface.
!       public void CopyTo(Array array, int index)
!                       {
!                               list.CopyTo(array, index);
!                       }
!       int ICollection.Count
!                       {
!                               get
!                               {
!                                       return list.Count;
!                               }
!                       }
!       bool ICollection.IsSynchronized
!                       {
!                               get
!                               {
!                                       return false;
!                               }
!                       }
!       Object ICollection.SyncRoot
!                       {
!                               get
!                               {
!                                       return this;
!                               }
!                       }
! 
!       // Implement the IEnumerable interface.
!       IEnumerator IEnumerable.GetEnumerator()
!                       {
!                               return GetEnumerator();
!                       }
  
+       // Implement the IDictionary interface.
        void IDictionary.Add(Object key, Object value)
!                       {
!                               if(value is PropertyDescriptor)
!                               {
!                                       Add((PropertyDescriptor)value);
!                               }
!                               else
!                               {
!                                       throw new ArgumentException
!                                               (S._("Arg_InvalidElement"));
!                               }
!                       }
!       void IDictionary.Clear()
!                       {
!                               Clear();
!                       }
        bool IDictionary.Contains(Object key)
!                       {
!                               if(key is String)
!                               {
!                                       return (Find((String)key, false) != 
null);
!                               }
!                               else
!                               {
!                                       return false;
!                               }
!                       }
        IDictionaryEnumerator IDictionary.GetEnumerator()
!                       {
!                               return new Enumerator(GetEnumerator());
!                       }
        void IDictionary.Remove(Object key)
!                       {
!                               if(key is String)
!                               {
!                                       PropertyDescriptor descr = 
Find((String)key, false);
!                                       if(descr != null)
!                                       {
!                                               Remove(descr);
!                                       }
!                               }
!                       }
        bool IDictionary.IsFixedSize
!                       {
!                               get
!                               {
!                                       return false;
!                               }
!                       }
!       bool IDictionary.IsReadOnly
!                       {
!                               get
!                               {
!                                       return false;
!                               }
!                       }
        Object IDictionary.this[Object key]
!                       {
!                               get
!                               {
!                                       if(key is String)
!                                       {
!                                               return Find((String)key, false);
!                                       }
!                                       else
!                                       {
!                                               return null;
!                                       }
!                               }
!                               set
!                               {
!                                       ((IDictionary)this).Add(key, value);
!                               }
!                       }
        ICollection IDictionary.Keys
!                       {
!                               get
!                               {
!                                       String[] keys = new String [list.Count];
!                                       int posn = 0;
!                                       foreach(PropertyDescriptor descr in 
list)
!                                       {
!                                               keys[posn++] = descr.Name;
!                                       }
!                                       return keys;
!                               }
!                       }
        ICollection IDictionary.Values
!                       {
!                               get
!                               {
!                                       PropertyDescriptor[] values;
!                                       values = new PropertyDescriptor 
[list.Count];
!                                       int posn = 0;
!                                       foreach(PropertyDescriptor descr in 
list)
!                                       {
!                                               values[posn++] = descr;
!                                       }
!                                       return values;
!                               }
!                       }
! 
!       // Dictionary enumerator for property descriptor collections.
!       private sealed class Enumerator : IDictionaryEnumerator
!       {
!               // Internal state.
!               private IEnumerator e;
! 
!               // Constructor.
!               public Enumerator(IEnumerator e)
!                               {
!                                       this.e = e;
!                               }
! 
!               // Implement the IEnumerator interface.
!               public bool MoveNext()
!                               {
!                                       return e.MoveNext();
!                               }
!               public void Reset()
!                               {
!                                       e.Reset();
!                               }
!               public Object Current
!                               {
!                                       get
!                                       {
!                                               return Entry;
!                                       }
!                               }
! 
!               // Implement the IDictionaryEnumerator interface.
!               public DictionaryEntry Entry
!                               {
!                                       get
!                                       {
!                                               PropertyDescriptor descr;
!                                               descr = 
(PropertyDescriptor)(e.Current);
!                                               return new 
DictionaryEntry(descr.Name, descr);
!                                       }
!                               }
!               public Object Key
!                               {
!                                       get
!                                       {
!                                               return 
((PropertyDescriptor)(e.Current)).Name;
!                                       }
!                               }
!               public Object Value
!                               {
!                                       get
!                                       {
!                                               return 
(PropertyDescriptor)(e.Current);
!                                       }
!                               }
! 
!       }; // class IDictionaryEnumerator
  
  }; // class PropertyDescriptorCollection

Index: PropertyTabAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/PropertyTabAttribute.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** PropertyTabAttribute.cs     12 Sep 2003 06:08:58 -0000      1.1
--- PropertyTabAttribute.cs     16 Sep 2003 05:25:31 -0000      1.2
***************
*** 95,100 ****
        public override bool Equals(Object obj)
                        {
!                               PropertyTabAttribute other =
!                                       (obj as PropertyTabAttribute);
                                if(other != null)
                                {
--- 95,102 ----
        public override bool Equals(Object obj)
                        {
!                               return Equals(obj as PropertyTabAttribute);
!                       }
!       public bool Equals(PropertyTabAttribute other)
!                       {
                                if(other != null)
                                {

Index: ProvidePropertyAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/ProvidePropertyAttribute.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** ProvidePropertyAttribute.cs 12 Sep 2003 06:08:58 -0000      1.1
--- ProvidePropertyAttribute.cs 16 Sep 2003 05:25:31 -0000      1.2
***************
*** 27,31 ****
  using System;
  
! [AttributeUsage(AttributeTargets.Class)]
  public sealed class ProvidePropertyAttribute : Attribute
  {
--- 27,31 ----
  using System;
  
! [AttributeUsage(AttributeTargets.Class, AllowMultiple=true)]
  public sealed class ProvidePropertyAttribute : Attribute
  {

Index: TimeSpanConverter.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/TimeSpanConverter.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** TimeSpanConverter.cs        8 Aug 2003 02:56:50 -0000       1.1
--- TimeSpanConverter.cs        16 Sep 2003 05:25:31 -0000      1.2
***************
*** 28,31 ****
--- 28,32 ----
  using System.Collections;
  using System.Globalization;
+ using System.Reflection;
  using System.ComponentModel.Design.Serialization;
  
***************
*** 81,85 ****
  
        // Convert this object into another type.
-       [TODO]
        public override Object ConvertTo(ITypeDescriptorContext context,
                                                                         
CultureInfo culture,
--- 82,85 ----
***************
*** 102,116 ****
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               else if(destinationType == 
typeof(InstanceDescriptor))
                                {
!                                       // TODO
!                                       return null;
                                }
                        #endif
!                               else
!                               {
!                                       return base.ConvertTo
!                                               (context, culture, value, 
destinationType);
!                               }
                        }
  
--- 102,121 ----
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               if(destinationType == 
typeof(InstanceDescriptor) &&
!                                  value is TimeSpan)
                                {
!                                       ConstructorInfo ctor;
!                                       ctor = typeof(TimeSpan).GetConstructor
!                                                       (new Type [] 
{typeof(long)});
!                                       if(ctor == null)
!                                       {
!                                               return null;
!                                       }
!                                       return new InstanceDescriptor
!                                               (ctor, new Object [] 
{((TimeSpan)value).Ticks});
                                }
                        #endif
!                               return base.ConvertTo
!                                       (context, culture, value, 
destinationType);
                        }
  

Index: TypeConverter.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/TypeConverter.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** TypeConverter.cs    12 Sep 2003 06:08:58 -0000      1.8
--- TypeConverter.cs    16 Sep 2003 05:25:31 -0000      1.9
***************
*** 3,7 ****
   *            "System.ComponentModel.ComponentModel.TypeConverter" class.
   *
!  * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
--- 3,7 ----
   *            "System.ComponentModel.ComponentModel.TypeConverter" class.
   *
!  * Copyright (C) 2002, 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 281,352 ****
                        }
  
!       // nested class
        public class StandardValuesCollection : ICollection, IEnumerable
        {
!       
                private ICollection values;
                
!               public StandardValuesCollection (ICollection values)
!               {
!                       if(values != null)
!                       {
!                               this.values = values;
!                       }
!                       else
!                       {
!                               this.values = new Object [0];
!                       }
!               }
  
!               public void CopyTo (Array array, int index)
!               {
!                       values.CopyTo (array, index);
!               }
  
!               public IEnumerator GetEnumerator ()
!               {
!                       return values.GetEnumerator ();
!               }
  
                bool ICollection.IsSynchronized
!               {
!                       get 
!                       {
!                               return false; 
!                       }
!               }
  
!               object ICollection.SyncRoot
!               {
!                       get 
!                       { 
!                               return null;
!                       }
!               }
  
!               int ICollection.Count
!               {
!                       get 
!                       {
!                               return this.Count;
!                       }
!               }
  
!               public int Count
!               {
!                       get
!                       {
!                               return values.Count;
!                       }
!               }
  
!               public object this [int index]
!               {
!                       get 
!                       {
!                               return (values as IList) [index]; 
!                       }
!               }
!       }
  
  }; // class TypeConverter
--- 281,499 ----
                        }
  
!       // Wrap a collection to make it indexable.
        public class StandardValuesCollection : ICollection, IEnumerable
        {
!               // Internal state.
                private ICollection values;
                
!               // Constructor.
!               public StandardValuesCollection(ICollection values)
!                               {
!                                       if(values != null)
!                                       {
!                                               this.values = values;
!                                       }
!                                       else
!                                       {
!                                               this.values = new Object[0];
!                                       }
!                               }
  
!               // Get the number of elements in this collection.
!               public int Count
!                               {
!                                       get
!                                       {
!                                               return values.Count;
!                                       }
!                               }
  
!               // Copy the elements of this collection into an array.
!               public void CopyTo(Array array, int index)
!                               {
!                                       values.CopyTo(array, index);
!                               }
  
+               // Get an enumerator for this collection.
+               public IEnumerator GetEnumerator()
+                               {
+                                       return values.GetEnumerator();
+                               }
+ 
+               // Implement the ICollection interface.
+               void ICollection.CopyTo(Array array, int index)
+                               {
+                                       values.CopyTo(array, index);
+                               }
+               int ICollection.Count
+                               {
+                                       get 
+                                       {
+                                               return values.Count;
+                                       }
+                               }
                bool ICollection.IsSynchronized
!                               {
!                                       get 
!                                       {
!                                               return false; 
!                                       }
!                               }
!               Object ICollection.SyncRoot
!                               {
!                                       get 
!                                       { 
!                                               return null;
!                                       }
!                               }
  
!               // Implement the IEnumerable interface.
!               IEnumerator IEnumerable.GetEnumerator()
!                               {
!                                       return values.GetEnumerator();
!                               }
  
!               // Get an item from this collection.
!               public Object this[int index]
!                               {
!                                       get
!                                       {
!                                               if(values is IList)
!                                               {
!                                                       return 
((IList)values)[index];
!                                               }
!                                               else
!                                               {
!                                                       if(index < 0 || index 
>= values.Count)
!                                                       {
!                                                               throw new 
IndexOutOfRangeException
!                                                                       
(S._("Arg_InvalidArrayIndex"));
!                                                       }
!                                                       IEnumerator e = 
values.GetEnumerator();
!                                                       while(e.MoveNext())
!                                                       {
!                                                               if(index == 0)
!                                                               {
!                                                                       return 
e.Current;
!                                                               }
!                                                               --index;
!                                                       }
!                                                       throw new 
IndexOutOfRangeException
!                                                               
(S._("Arg_InvalidArrayIndex"));
!                                               }
!                                       }
!                               }
  
!       }; // class StandardValuesCollection
  
!       // Simple property descriptor for objects that don't have properties.
!       protected abstract class SimplePropertyDescriptor : PropertyDescriptor
!       {
!               // Internal state.
!               private Type componentType;
!               private Type propertyType;
! 
!               // Constructors.
!               public SimplePropertyDescriptor
!                                       (Type componentType, String name, Type 
propertyType)
!                               : base(name, null)
!                               {
!                                       this.componentType = componentType;
!                                       this.propertyType = propertyType;
!                               }
!               public SimplePropertyDescriptor
!                                       (Type componentType, String name, Type 
propertyType,
!                                        Attribute[] attributes)
!                               : base(name, attributes)
!                               {
!                                       this.componentType = componentType;
!                                       this.propertyType = propertyType;
!                               }
! 
!               // Get the component type that owns this property.
!               public override Type ComponentType
!                               {
!                                       get
!                                       {
!                                               return componentType;
!                                       }
!                               }
! 
!               // Determine if this property is read-only.
!               public override bool IsReadOnly
!                               {
!                                       get
!                                       {
!                                               ReadOnlyAttribute attr;
!                                               attr = (ReadOnlyAttribute)
!                                                       
(Attributes[typeof(ReadOnlyAttribute)]);
!                                               if(attr != null)
!                                               {
!                                                       return attr.IsReadOnly;
!                                               }
!                                               else
!                                               {
!                                                       return false;
!                                               }
!                                       }
!                               }
! 
!               // Get the type of this property.
!               public override Type PropertyType
!                               {
!                                       get
!                                       {
!                                               return propertyType;
!                                       }
!                               }
! 
!               // Determine if resetting a component's property will change 
its value.
!               public override bool CanResetValue(Object component)
!                               {
!                                       DefaultValueAttribute attr;
!                                       attr = (DefaultValueAttribute)
!                                               
(Attributes[typeof(DefaultValueAttribute)]);
!                                       if(attr != null)
!                                       {
!                                               // Strictly speaking, this 
should probably
!                                               // check that the values are 
*not* equal, but
!                                               // other implementations check 
for equality.
!                                               // So we do that as well, for 
compatibility.
!                                               Object value1 = 
GetValue(component);
!                                               Object value2 = attr.Value;
!                                               if(value1 == null)
!                                               {
!                                                       return (value2 == null);
!                                               }
!                                               else
!                                               {
!                                                       return 
value1.Equals(value2);
!                                               }
!                                       }
!                                       else
!                                       {
!                                               return false;
!                                       }
!                               }
! 
!               // Reset the property value associated with a component.
!               public override void ResetValue(Object component)
!                               {
!                                       DefaultValueAttribute attr;
!                                       attr = (DefaultValueAttribute)
!                                               
(Attributes[typeof(DefaultValueAttribute)]);
!                                       if(attr != null)
!                                       {
!                                               SetValue(component, attr.Value);
!                                       }
!                               }
! 
!               // Determine if a property value needs to be serialized.
!               public override bool ShouldSerializeValue(Object component)
!                               {
!                                       return false;
!                               }
! 
!       }; // class SimplePropertyDescriptor
  
  }; // class TypeConverter

Index: TypeDescriptor.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/TypeDescriptor.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** TypeDescriptor.cs   29 May 2003 05:38:17 -0000      1.2
--- TypeDescriptor.cs   16 Sep 2003 05:25:31 -0000      1.3
***************
*** 1,7 ****
  /*
!  * TypeDescriptor.cs - Implementation of "TypeDescriptor" 
   *
!  * Copyright (C) 2002  Southern Storm Software, Pty Ltd.
!  * Copyright (C) 2002  Free Software Foundation,Inc.
   *
   * This program is free software; you can redistribute it and/or modify
--- 1,7 ----
  /*
!  * TypeDescriptor.cs - Implementation of the
!  *            "System.ComponentModel.ComponentModel.TypeDescriptor" class.
   *
!  * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 20,286 ****
   */
  
  using System;
- using System.Collections;
  using System.Reflection;
  
! namespace System.ComponentModel
  {
! #if CONFIG_COMPONENT_MODEL
!       public sealed class TypeDescriptor
        {
!               [TODO]
!               public static void AddEditorTable(Type editorBaseType, 
!                                               Hashtable table)
!               {
!                       throw new NotImplementedException("AddEditorTable");
!               }
! /*
!               [TODO]
!               public static EventDescriptor CreateEvent(Type componentType, 
!                                               String name, Type type, 
Attribute[] attributes)
!               {
!                       throw new NotImplementedException("CreateEvent");
!               }
!               
!               [TODO]
!               public static EventDescriptor CreateEvent(Type componentType, 
!                       EventDescriptor oldEventDescriptor, Attribute[] 
attributes)
!               {
!                       throw new NotImplementedException("CreateEvent");
!               }
! */
!               [TODO]
!               public static PropertyDescriptor CreateProperty(Type 
componentType, 
!                               String name, Type type, Attribute[] attributes)
!               {
!                       throw new NotImplementedException("CreateProperty");
!               }
! 
!               [TODO]
!               public static PropertyDescriptor CreateProperty(Type 
componentType, 
!                                               PropertyDescriptor 
oldPropertyDescriptor, 
!                                               Attribute[] attributes)
!               {
!                       throw new NotImplementedException("CreateProperty");
!               }
! 
!               [TODO]
!               public static AttributeCollection GetAttributes(Type 
componentType)
!               {
!                       throw new NotImplementedException("GetAttributes");
!               }
! 
!               [TODO]
!               public static AttributeCollection GetAttributes(Object 
component)
!               {
!                       throw new NotImplementedException("GetAttributes");
!               }
! 
!               [TODO]
!               public static AttributeCollection GetAttributes(Object 
component, 
!                                       bool noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetAttributes");
!               }
! 
!               [TODO]
!               public static String GetClassName(Object component)
!               {
!                       throw new NotImplementedException("GetClassName");
!               }
! 
!               [TODO]
!               public static String GetClassName(Object component, bool 
noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetClassName");
!               }
! 
!               [TODO]
!               public static String GetComponentName(Object component)
!               {
!                       throw new NotImplementedException("GetComponentName");
!               }
! 
!               [TODO]
!               public static String GetComponentName(Object component, bool 
noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetComponentName");
!               }
! 
!               [TODO]
!               public static TypeConverter GetConverter(Object component)
!               {
!                       throw new NotImplementedException("GetConverter");
!               }
! 
!               [TODO]
!               public static TypeConverter GetConverter(Object component, bool 
noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetConverter");
!               }
! 
!               [TODO]
!               public static TypeConverter GetConverter(Type type)
!               {
!                       throw new NotImplementedException("GetConverter");
!               }
! /*
!               [TODO]
!               public static EventDescriptor GetDefaultEvent(Object component)
!               {
!                       throw new NotImplementedException("GetDefaultEvent");
!               }
!               
!               [TODO]
!               public static EventDescriptor GetDefaultEvent(Type 
componentType)
!               {
!                       throw new NotImplementedException("GetDefaultEvent");
!               }
! 
!               [TODO]
!               public static EventDescriptor GetDefaultEvent(Object component, 
!                                                               bool 
noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetDefaultEvent");
!               }
! */
! 
!               [TODO]
!               public static PropertyDescriptor GetDefaultProperty(Object 
component)
!               {
!                       throw new NotImplementedException("GetDefaultProperty");
!               }
! 
!               [TODO]
!               public static PropertyDescriptor GetDefaultProperty(Type 
componentType)
!               {
!                       throw new NotImplementedException("GetDefaultProperty");
!               }
! 
!               [TODO]
!               public static PropertyDescriptor GetDefaultProperty(Object 
component, bool noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetDefaultProperty");
!               }
! 
!               [TODO]
!               public static Object GetEditor(Object component, Type 
editorBaseType)
!               {
!                       throw new NotImplementedException("GetEditor");
!               }
! 
!               [TODO]
!               public static Object GetEditor(Type componentType, Type 
editorBaseType)
!               {
!                       throw new NotImplementedException("GetEditor");
!               }
! 
!               [TODO]
!               public static Object GetEditor(Object component, Type 
editorBaseType, bool noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetEditor");
!               }
! /*
!               [TODO]
!               public static EventDescriptorCollection GetEvents(Object 
component)
!               {
!                       throw new NotImplementedException("GetEvents");
!               }
! 
!               [TODO]
!               public static EventDescriptorCollection GetEvents(Type 
componentType)
!               {
!                       throw new NotImplementedException("GetEvents");
!               }
! 
!               [TODO]
!               public static EventDescriptorCollection GetEvents(Object 
component, 
!                                                                               
        Attribute[] attributes)
!               {
!                       throw new NotImplementedException("GetEvents");
!               }
! 
!               [TODO]
!               public static EventDescriptorCollection GetEvents(Object 
component, 
!                                       bool noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetEvents");
!               }
! 
!               [TODO]
!               public static EventDescriptorCollection GetEvents(Type 
componentType, 
!                                                       Attribute[] attributes)
!               {
!                       throw new NotImplementedException("GetEvents");
!               }
! 
!               [TODO]
!               public static EventDescriptorCollection GetEvents(Object 
component, 
!                               Attribute[] attributes, bool noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetEvents");
!               }
! */
!               [TODO]
!               public static PropertyDescriptorCollection GetProperties(Object 
component)
!               {
!                       throw new NotImplementedException("GetProperties");
!               }
! 
!               [TODO]
!               public static PropertyDescriptorCollection GetProperties(Type 
componentType)
!               {
!                       throw new NotImplementedException("GetProperties");
!               }
! 
!               [TODO]
!               public static PropertyDescriptorCollection GetProperties(Object 
component, Attribute[] attributes)
!               {
!                       throw new NotImplementedException("GetProperties");
!               }
! 
!               [TODO]
!               public static PropertyDescriptorCollection GetProperties(Object 
component, bool noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetProperties");
!               }
! 
!               [TODO]
!               public static PropertyDescriptorCollection GetProperties(Type 
componentType, Attribute[] attributes)
!               {
!                       throw new NotImplementedException("GetProperties");
!               }
! 
!               [TODO]
!               public static PropertyDescriptorCollection GetProperties(Type 
componentType, Attribute[] attributes, bool noCustomTypeDesc)
!               {
!                       throw new NotImplementedException("GetProperties");
!               }
! 
!               [TODO]
!               public static void Refresh(Assembly assembly)
!               {
!                       throw new NotImplementedException("Refresh");
!               }
! 
!               [TODO]
!               public static void Refresh(Module module)
!               {
!                       throw new NotImplementedException("Refresh");
!               }
! 
!               [TODO]
!               public static void Refresh(Object component)
!               {
!                       throw new NotImplementedException("Refresh");
!               }
! 
!               [TODO]
!               public static void Refresh(Type type)
!               {
!                       throw new NotImplementedException("Refresh");
!               }
! 
!       }
! #endif        
! }//namespace
--- 20,647 ----
   */
  
+ namespace System.ComponentModel
+ {
+ 
+ #if CONFIG_COMPONENT_MODEL
+ 
  using System;
  using System.Reflection;
+ using System.Collections;
+ using System.Globalization;
+ using System.ComponentModel.Design;
  
! public sealed class TypeDescriptor
  {
!       // Internal state.
!       private static IComNativeDescriptorHandler handler;
!       private static Hashtable typeTable = new Hashtable();
! 
!       // Element that is stored within the type table.
!       private sealed class TypeElement
        {
!               public TypeConverter converter;
! 
!       }; // class TypeElement
! 
!       // Cannot instantiate this class.
!       private TypeDescriptor() {}
! 
!       // Add information to the editor tables.
!       public static void AddEditorTable(Type editorBaseType, Hashtable table)
!                       {
!                               // Nothing to do here - we don't use editor 
tables.
!                       }
! 
!       // Create a designer for a specific component.
!       public static IDesigner CreateDesigner
!                               (IComponent component, Type designerBaseType)
!                       {
!                               // Get the attributes for the component.
!                               AttributeCollection attrs = 
GetAttributes(component, false);
! 
!                               // Scan the attributes to find a designer 
attribute.
!                               foreach(Attribute attr in attrs)
!                               {
!                                       DesignerAttribute dattr = (attr as 
DesignerAttribute);
!                                       if(dattr != null)
!                                       {
!                                               Type type = 
Type.GetType(dattr.DesignerBaseTypeName);
!                                               if(type != null && type == 
designerBaseType)
!                                               {
!                                                       if(component.Site != 
null)
!                                                       {
!                                                               
ITypeResolutionService trs;
!                                                               trs = 
(ITypeResolutionService)
!                                                                       
component.Site.GetService
!                                                                               
(typeof(ITypeResolutionService));
!                                                               if(trs != null)
!                                                               {
!                                                                       type = 
trs.GetType(dattr.DesignerTypeName);
!                                                               }
!                                                               else
!                                                               {
!                                                                       type = 
Type.GetType(dattr.DesignerTypeName);
!                                                               }
!                                                               if(type != null)
!                                                               {
!                                                                       return 
(IDesigner)Activator.CreateInstance
!                                                                               
(type,
!                                                                               
 BindingFlags.CreateInstance |
!                                                                               
    BindingFlags.Public |
!                                                                               
    BindingFlags.NonPublic |
!                                                                               
    BindingFlags.Instance,
!                                                                               
 null, null, null, null);
!                                                               }
!                                                       }
!                                               }
!                                       }
!                               }
! 
!                               // We were unable to find a suitable designer 
declaration.
!                               return null;
!                       }
! 
!       // Create a new event descriptor.
!       [TODO]
!       public static EventDescriptor CreateEvent
!                               (Type componentType, EventDescriptor 
oldEventDescriptor,
!                                params Attribute[] attributes)
!                       {
!                               // TODO
!                               return null;
!                       }
!       [TODO]
!       public static EventDescriptor CreateEvent
!                               (Type componentType, String name, Type type,
!                                params Attribute[] attributes)
!                       {
!                               // TODO
!                               return null;
!                       }
! 
!       // Create a new property descriptor.
!       [TODO]
!       public static PropertyDescriptor CreateProperty
!                               (Type componentType, PropertyDescriptor 
oldPropertyDescriptor,
!                                params Attribute[] attributes)
!                       {
!                               // TODO
!                               return null;
!                       }
!       [TODO]
!       public static PropertyDescriptor CreateProperty
!                               (Type componentType, String name, Type type,
!                                params Attribute[] attributes)
!                       {
!                               // TODO
!                               return null;
!                       }
! 
!       // Get the attributes associated with a particular component.
!       public static AttributeCollection GetAttributes(Object component)
!                       {
!                               return GetAttributes(component, false);
!                       }
!       public static AttributeCollection GetAttributes
!                               (Object component, bool noCustomTypeDesc)
!                       {
!                               if(component == null)
!                               {
!                                       throw new 
ArgumentNullException("component");
!                               }
!                               if(noCustomTypeDesc || !(component is 
ICustomTypeDescriptor))
!                               {
!                                       return 
GetAttributes(component.GetType());
!                               }
!                               else
!                               {
!                                       return 
((ICustomTypeDescriptor)component).GetAttributes();
!                               }
!                       }
! 
!       // Get the attributes associated with a particular type of component.
!       [TODO]
!       public static AttributeCollection GetAttributes(Type componentType)
!                       {
!                               // TODO
!                               return null;
!                       }
! 
!       // Get the name of a component's class.
!       public static String GetClassName(Object component)
!                       {
!                               return GetClassName(component, false);
!                       }
!       public static String GetClassName
!                               (Object component, bool noCustomTypeDesc)
!                       {
!                               if(component == null)
!                               {
!                                       throw new 
ArgumentNullException("component");
!                               }
!                               if(noCustomTypeDesc || !(component is 
ICustomTypeDescriptor))
!                               {
!                                       return component.GetType().FullName;
!                               }
!                               else
!                               {
!                                       return 
((ICustomTypeDescriptor)component).GetClassName();
!                               }
!                       }
! 
!       // Get the name of a component.
!       public static String GetComponentName(Object component)
!                       {
!                               return GetComponentName(component, false);
!                       }
!       public static String GetComponentName
!                               (Object component, bool noCustomTypeDesc)
!                       {
!                               if(component == null)
!                               {
!                                       throw new 
ArgumentNullException("component");
!                               }
!                               if(noCustomTypeDesc || !(component is 
ICustomTypeDescriptor))
!                               {
!                                       if(component is IComponent)
!                                       {
!                                               ISite site = 
((IComponent)component).Site;
!                                               if(site != null)
!                                               {
!                                                       return site.Name;
!                                               }
!                                       }
!                                       return component.GetType().FullName;
!                               }
!                               else
!                               {
!                                       return 
((ICustomTypeDescriptor)component)
!                                                               
.GetComponentName();
!                               }
!                       }
! 
!       // Get or create a cache element for a type.
!       private static TypeElement GetOrCreateElement(Type type)
!                       {
!                               TypeElement element = 
(TypeElement)(typeTable[type]);
!                               if(element == null)
!                               {
!                                       element = new TypeElement();
!                                       typeTable[element] = element;
!                               }
!                               return element;
!                       }
! 
!       // Get a particular attribute from a type.
!       private static Attribute GetAttributeForType(Type type, Type attrType)
!                       {
!                               AttributeCollection attrs = GetAttributes(type);
!                               if(attrs != null)
!                               {
!                                       return attrs[attrType];
!                               }
!                               else
!                               {
!                                       return null;
!                               }
!                       }
! 
!       // Get a converter for a specific component's type.
!       public static TypeConverter GetConverter(Object component)
!                       {
!                               return GetConverter(component, false);
!                       }
!       public static TypeConverter GetConverter
!                               (Object component, bool noCustomTypeDesc)
!                       {
!                               if(component == null)
!                               {
!                                       throw new 
ArgumentNullException("component");
!                               }
!                               if(noCustomTypeDesc || !(component is 
ICustomTypeDescriptor))
!                               {
!                                       return 
GetConverter(component.GetType());
!                               }
!                               else
!                               {
!                                       return 
((ICustomTypeDescriptor)component).GetConverter();
!                               }
!                       }
! 
!       // Get a converter for a builtin type.
!       private static TypeConverter GetBuiltinConverter(Type type)
!                       {
!                               if(type == typeof(bool))
!                               {
!                                       return new BooleanConverter();
!                               }
!                               else if(type == typeof(byte))
!                               {
!                                       return new ByteConverter();
!                               }
!                               else if(type == typeof(sbyte))
!                               {
!                                       return new SByteConverter();
!                               }
!                               else if(type == typeof(char))
!                               {
!                                       return new CharConverter();
!                               }
!                               else if(type == typeof(short))
!                               {
!                                       return new Int16Converter();
!                               }
!                               else if(type == typeof(ushort))
!                               {
!                                       return new UInt16Converter();
!                               }
!                               else if(type == typeof(int))
!                               {
!                                       return new Int32Converter();
!                               }
!                               else if(type == typeof(uint))
!                               {
!                                       return new UInt32Converter();
!                               }
!                               else if(type == typeof(long))
!                               {
!                                       return new Int64Converter();
!                               }
!                               else if(type == typeof(ulong))
!                               {
!                                       return new UInt64Converter();
!                               }
!                               else if(type == typeof(float))
!                               {
!                                       return new SingleConverter();
!                               }
!                               else if(type == typeof(double))
!                               {
!                                       return new DoubleConverter();
!                               }
!                               else if(type == typeof(String))
!                               {
!                                       return new StringConverter();
!                               }
!                               else if(type == typeof(Decimal))
!                               {
!                                       return new DecimalConverter();
!                               }
!                               else if(type == typeof(DateTime))
!                               {
!                                       return new DateTimeConverter();
!                               }
!                               else if(type == typeof(TimeSpan))
!                               {
!                                       return new TimeSpanConverter();
!                               }
!                               else if(type == typeof(Guid))
!                               {
!                                       return new GuidConverter();
!                               }
!                               else 
if(typeof(ICollection).IsAssignableFrom(type))
!                               {
!                                       return new CollectionConverter();
!                               }
!                               else if(type == typeof(CultureInfo))
!                               {
!                                       return new CultureInfoConverter();
!                               }
!                               else if(typeof(Enum).IsAssignableFrom(type))
!                               {
!                                       return new EnumConverter(type);
!                               }
!                               else 
if(typeof(IComponent).IsAssignableFrom(type) ||
!                                       
typeof(MarshalByValueComponent).IsAssignableFrom(type))
!                               {
!                                       return new ComponentConverter(type);
!                               }
!                               else
!                               {
!                                       return new ReferenceConverter(type);
!                               }
!                       }
! 
!       // Get a converter for a specific component type.
!       public static TypeConverter GetConverter(Type type)
!                       {
!                               lock(typeof(TypeDescriptor))
!                               {
!                                       TypeElement element = 
GetOrCreateElement(type);
!                                       if(element.converter != null)
!                                       {
!                                               return element.converter;
!                                       }
!                                       TypeConverterAttribute attr;
!                                       attr = 
(TypeConverterAttribute)GetAttributeForType
!                                               (type, 
typeof(TypeConverterAttribute));
!                                       if(attr != null)
!                                       {
!                                               Type converterType =
!                                                       
Type.GetType(attr.ConverterTypeName);
!                                               element.converter = 
(TypeConverter)
!                                                       
Activator.CreateInstance(converterType);
!                                               return element.converter;
!                                       }
!                                       element.converter = 
GetBuiltinConverter(type);
!                                       return element.converter;
!                               }
!                       }
! 
!       // Get the default event for a specified component.
!       public static EventDescriptor GetDefaultEvent(Object component)
!                       {
!                               return GetDefaultEvent(component, false);
!                       }
!       public static EventDescriptor GetDefaultEvent
!                               (Object component, bool noCustomTypeDesc)
!                       {
!                               if(component == null)
!                               {
!                                       return null;
!                               }
!                               if(noCustomTypeDesc || !(component is 
ICustomTypeDescriptor))
!                               {
!                                       return 
GetDefaultEvent(component.GetType());
!                               }
!                               else
!                               {
!                                       return 
((ICustomTypeDescriptor)component).GetDefaultEvent();
!                               }
!                       }
! 
!       // Get the default event for a specified component type.
!       [TODO]
!       public static EventDescriptor GetDefaultEvent(Type componentType)
!                       {
!                               // TODO
!                               return null;
!                       }
! 
!       // Get the default property for a specified component.
!       public static PropertyDescriptor GetDefaultProperty(Object component)
!                       {
!                               return GetDefaultProperty(component, false);
!                       }
!       public static PropertyDescriptor GetDefaultProperty
!                               (Object component, bool noCustomTypeDesc)
!                       {
!                               if(component == null)
!                               {
!                                       return null;
!                               }
!                               if(noCustomTypeDesc || !(component is 
ICustomTypeDescriptor))
!                               {
!                                       return 
GetDefaultProperty(component.GetType());
!                               }
!                               else
!                               {
!                                       return 
((ICustomTypeDescriptor)component)
!                                                               
.GetDefaultProperty();
!                               }
!                       }
! 
!       // Get the default property for a specified component type.
!       [TODO]
!       public static PropertyDescriptor GetDefaultProperty(Type componentType)
!                       {
!                               // TODO
!                               return null;
!                       }
! 
!       // Get an editor for a specified component.
!       public static Object GetEditor(Object component, Type editorBaseType)
!                       {
!                               return GetEditor(component, editorBaseType, 
false);
!                       }
!       public static Object GetEditor
!                               (Object component, Type editorBaseType, bool 
noCustomTypeDesc)
!                       {
!                               if(component == null)
!                               {
!                                       throw new 
ArgumentNullException("component");
!                               }
!                               if(noCustomTypeDesc || !(component is 
ICustomTypeDescriptor))
!                               {
!                                       return GetEditor(component.GetType(), 
editorBaseType);
!                               }
!                               else
!                               {
!                                       return 
((ICustomTypeDescriptor)component)
!                                                               
.GetEditor(editorBaseType);
!                               }
!                       }
! 
!       // Get an editor for a specified component type.
!       [TODO]
!       public static Object GetEditor(Type type, Type editorBaseType)
!                       {
!                               // TODO
!                               return null;
!                       }
! 
!       // Get all events for a specified component.
!       public static EventDescriptorCollection GetEvents(Object component)
!                       {
!                               return GetEvents(component, null, false);
!                       }
!       public static EventDescriptorCollection GetEvents
!                               (Object component, Attribute[] attributes)
!                       {
!                               return GetEvents(component, attributes, false);
!                       }
!       public static EventDescriptorCollection GetEvents
!                               (Object component, bool noCustomTypeDesc)
!                       {
!                               return GetEvents(component, null, 
noCustomTypeDesc);
!                       }
!       public static EventDescriptorCollection GetEvents
!                               (Object component, Attribute[] attributes,
!                                bool noCustomTypeDesc)
!                       {
!                               if(component == null)
!                               {
!                                       return new 
EventDescriptorCollection(null);
!                               }
!                               if(noCustomTypeDesc || !(component is 
ICustomTypeDescriptor))
!                               {
!                                       return GetEvents(component.GetType(), 
attributes);
!                               }
!                               else if(attributes == null)
!                               {
!                                       return 
((ICustomTypeDescriptor)component).GetEvents();
!                               }
!                               else
!                               {
!                                       return 
((ICustomTypeDescriptor)component)
!                                                               
.GetEvents(attributes);
!                               }
!                       }
! 
!       // Get all events for a specified component type.
!       public static EventDescriptorCollection GetEvents(Type componentType)
!                       {
!                               return GetEvents(componentType, null);
!                       }
!       [TODO]
!       public static EventDescriptorCollection GetEvents
!                               (Type componentType, Attribute[] attributes)
!                       {
!                               // TODO
!                               return null;
!                       }
! 
!       // Get all properties for a specified component.
!       public static PropertyDescriptorCollection GetProperties(Object 
component)
!                       {
!                               return GetProperties(component, null, false);
!                       }
!       public static PropertyDescriptorCollection GetProperties
!                               (Object component, Attribute[] attributes)
!                       {
!                               return GetProperties(component, attributes, 
false);
!                       }
!       public static PropertyDescriptorCollection GetProperties
!                               (Object component, bool noCustomTypeDesc)
!                       {
!                               return GetProperties(component, null, 
noCustomTypeDesc);
!                       }
!       public static PropertyDescriptorCollection GetProperties
!                               (Object component, Attribute[] attributes,
!                                bool noCustomTypeDesc)
!                       {
!                               if(component == null)
!                               {
!                                       return new 
PropertyDescriptorCollection(null);
!                               }
!                               if(noCustomTypeDesc || !(component is 
ICustomTypeDescriptor))
!                               {
!                                       return 
GetProperties(component.GetType(), attributes);
!                               }
!                               else if(attributes == null)
!                               {
!                                       return 
((ICustomTypeDescriptor)component).GetProperties();
!                               }
!                               else
!                               {
!                                       return 
((ICustomTypeDescriptor)component)
!                                                               
.GetProperties(attributes);
!                               }
!                       }
! 
!       // Get all properties for a specified component type.
!       public static PropertyDescriptorCollection GetProperties
!                               (Type componentType)
!                       {
!                               return GetProperties(componentType, null);
!                       }
!       [TODO]
!       public static PropertyDescriptorCollection GetProperties
!                               (Type componentType, Attribute[] attributes)
!                       {
!                               // TODO
!                               return null;
!                       }
! 
!       // Clear properties and events from the cache.
!       [TODO]
!       public static void Refresh(Assembly assembly)
!                       {
!                               // TODO
!                       }
!       [TODO]
!       public static void Refresh(Module module)
!                       {
!                               // TODO
!                       }
!       [TODO]
!       public static void Refresh(Object component)
!                       {
!                               // TODO
!                       }
!       [TODO]
!       public static void Refresh(Type type)
!                       {
!                               // TODO
!                       }
! 
!       // Private class for comparing descriptors by name.
!       internal sealed class DescriptorComparer : IComparer
!       {
!               // Compare two descriptors.
!               public int Compare(Object elem1, Object elem2)
!                               {
!                                       return String.CompareOrdinal
!                                               (((MemberDescriptor)elem1).Name,
!                                                
((MemberDescriptor)elem2).Name);
!                               }
! 
!       }; // class DescriptorComparer
! 
!       // Sort a descriptor array by name.
!       public static void SortDescriptorArray(IList infos)
!                       {
!                                ArrayList.Adapter(infos).Sort(new 
DescriptorComparer());
!                       }
! 
!       // Event that is emitted when a refresh occurs.
!       public static event RefreshEventHandler Refreshed;
! 
!       // Get or set the COM native descriptor handler (don't use this).
!       public static IComNativeDescriptorHandler ComNativeDescriptorHandler
!                       {
!                               get
!                               {
!                                       return handler;
!                               }
!                               set
!                               {
!                                       handler = value;
!                               }
!                       }
! 
! }; // class TypeDescriptor
! 
! #endif // CONFIG_COMPONENT_MODEL
! 
! }; // namespace System.ComponentModel

Index: TypeListConverter.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/TypeListConverter.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** TypeListConverter.cs        8 Aug 2003 05:52:47 -0000       1.2
--- TypeListConverter.cs        16 Sep 2003 05:25:31 -0000      1.3
***************
*** 28,31 ****
--- 28,32 ----
  using System.Collections;
  using System.Globalization;
+ using System.Reflection;
  using System.ComponentModel.Design.Serialization;
  
***************
*** 95,99 ****
  
        // Convert this object into another type.
-       [TODO]
        public override Object ConvertTo(ITypeDescriptorContext context,
                                                                         
CultureInfo culture,
--- 96,99 ----
***************
*** 116,130 ****
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               else if(destinationType == 
typeof(InstanceDescriptor))
                                {
!                                       // TODO
!                                       return null;
                                }
                        #endif
!                               else
!                               {
!                                       return base.ConvertTo
!                                               (context, culture, value, 
destinationType);
!                               }
                        }
  
--- 116,136 ----
                                }
                        #if CONFIG_COMPONENT_MODEL_DESIGN
!                               if(destinationType == 
typeof(InstanceDescriptor) &&
!                                  value is Type)
                                {
!                                       MethodInfo method;
!                                       method = typeof(Type).GetMethod
!                                                       ("GetType", new Type [] 
{typeof(String)});
!                                       if(method == null)
!                                       {
!                                               return null;
!                                       }
!                                       return new InstanceDescriptor
!                                               (method, new Object []
!                                                       
{((Type)value).AssemblyQualifiedName});
                                }
                        #endif
!                               return base.ConvertTo
!                                       (context, culture, value, 
destinationType);
                        }
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]