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 AttributeCollec


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System/ComponentModel AttributeCollection.cs,NONE,1.1 ComponentCollection.cs,NONE,1.1 IBindingList.cs,NONE,1.1 IComponent.cs,NONE,1.1 IContainer.cs,NONE,1.1 ISite.cs,NONE,1.1 Makefile,NONE,1.1 MemberDescriptor.cs,NONE,1.1 PropertyDescriptor.cs,NONE,1.1 PropertyDescriptorCollection.cs,NONE,1.1 ITypeDescriptorContext.cs,1.1,1.2 TypeConverter.cs,1.2,1.3
Date: Mon, 02 Dec 2002 19:18:58 -0500

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

Modified Files:
        ITypeDescriptorContext.cs TypeConverter.cs 
Added Files:
        AttributeCollection.cs ComponentCollection.cs IBindingList.cs 
        IComponent.cs IContainer.cs ISite.cs Makefile 
        MemberDescriptor.cs PropertyDescriptor.cs 
        PropertyDescriptorCollection.cs 
Log Message:


New ComponentModel classes.


--- NEW FILE ---
/*
 * AttributeCollection.cs - Implementation of the
 *              "System.ComponentModel.ComponentModel.AttributeCollection" 
class.
 *
 * Copyright (C) 2002  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 !ECMA_COMPAT

using System.Collections;
using System.Runtime.InteropServices;

[TODO]
[ComVisible(true)]
public class AttributeCollection
{
        // TODO

        public AttributeCollection(Attribute[] attributes) {}

}; // class AttributeCollection

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * ComponentCollection.cs - Implementation of the
 *              "System.ComponentModel.ComponentModel.ComponentCollection" 
class.
 *
 * Copyright (C) 2002  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 !ECMA_COMPAT

using System.Collections;
using System.Runtime.InteropServices;

[TODO]
[ComVisible(true)]
public class ComponentCollection
{
        // TODO

        public ComponentCollection() {}

}; // class ComponentCollection

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * IBindingList.cs - Implementation of the
 *              "System.ComponentModel.IBindingList" interface.
 *
 * Copyright (C) 2002  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 !ECMA_COMPAT

using System;
using System.Collections;

[TODO]
public interface IBindingList : IList, ICollection, IEnumerable
{

        // Determine if editing is allowed.
        bool AllowEdit { get; }

        // Determine if it is possible to add new items to the list.
        bool AllowNew { get; }

        // Determine if it is possible to remove items from the list.
        bool AllowRemove { get; }

        // Determine if the list is sorted.
        bool IsSorted { get; }

        // Get the list sort direction.
        ListSortDirection SortDirection { get; }

        // Get the property that is being used for sorting.
        PropertyDescriptor SortProperty { get; }

        // Determine if this list supports change notification.
        bool SupportsChangeNotification { get; }

        // Determine if this list supports searching.
        bool SupportsSearching { get; }

        // Determine if this list supports sorting.
        bool SupportsSorting { get; }

        // Add a property descriptor to the search indexes.
        void AddIndex(PropertyDescriptor property);

        // Add a new item to the list.
        Object AddNew();

        // Sort based on a property and sort direction.
        void ApplySort(PropertyDescriptor property, ListSortDirection 
direction);

        // Find the index of an object with a particular property value.
        int Find(PropertyDescriptor property, Object key);

        // Remove a property descriptor from the search indexes.
        void RemoveIndex(PropertyDescriptor property);

        // Remove any sorting that was applied by "ApplySort".
        void RemoveSort();

#if false
        // Event that is raised when the list changes.
        event ListChangedEventHandler ListChanged;
#endif

}; // interface IBindingList

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * IComponent.cs - Implementation of the
 *              "System.ComponentModel.IComponent" interface.
 *
 * Copyright (C) 2002  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 !ECMA_COMPAT

using System;
using System.Runtime.InteropServices;

[ComVisible(true)]
public interface IComponent : IDisposable
{

        // Get or set the site associated with this component.
        ISite Site { get; set; }

        // Event that is raised when a component is disposed.
        event EventHandler Disposed;

}; // interface IComponent

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * IContainer.cs - Implementation of the
 *              "System.ComponentModel.IContainer" interface.
 *
 * Copyright (C) 2002  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 !ECMA_COMPAT

using System;
using System.Runtime.InteropServices;

[ComVisible(true)]
public interface IContainer : IDisposable
{

        // Get a collection of all components in this container.
        ComponentCollection Components { get; }

        // Add a component to this container.
        void Add(IComponent component);
        void Add(IComponent component, String name);

        // Remove a component from this container.
        void Remove(IComponent component);

}; // interface IContainer

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * ISite.cs - Implementation of the
 *              "System.ComponentModel.ISite" interface.
 *
 * Copyright (C) 2002  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 !ECMA_COMPAT

using System;
using System.Runtime.InteropServices;

[ComVisible(true)]
public interface ISite : IServiceProvider
{

        // Get the component associated with this site.
        IComponent Component { get; }

        // Get the container associated with this site.
        IContainer Container { get; }

        // Determine if the component is in design mode.
        bool DesignMode { get; }

        // Get or set the name of the component.
        String Name { get; set; }

}; // interface ISite

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

--- NEW FILE ---

all:
        (cd ..;make)

--- NEW FILE ---
/*
 * MemberDescriptor.cs - Implementation of the
 *              "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
 * 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 !ECMA_COMPAT

using System.Collections;
using System.Reflection;
using System.Runtime.InteropServices;

[ComVisible(true)]
public abstract class MemberDescriptor
{
        // Internal state.
        private AttributeCollection attributeCollection;
        private Attribute[] attributes;
        private String category;
        private String description;
        private bool designTimeOnly;
        private bool isBrowsable;
        private String displayName;
        private String name;

        // Constructors.
        protected MemberDescriptor(MemberDescriptor descr)
                        : this(descr, null) {}
        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;
                        }

        // Properties.
        public virtual AttributeCollection Attributes
                        {
                                get
                                {
                                        if(attributeCollection == null)
                                        {
                                                attributeCollection = 
CreateAttributeCollection();
                                        }
                                        return attributeCollection;
                                }
                        }
        [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;
                                }
                        }
        public virtual String Name
                        {
                                get
                                {
                                        if(name != null)
                                        {
                                                return name;
                                        }
                                        else
                                        {
                                                return "";
                                        }
                                }
                        }

        // Determine if this member descriptor is equal to another.
        [TODO]
        public override bool Equals(Object obj)
                        {
                                MemberDescriptor other = (obj as 
MemberDescriptor);
                                if(other != null)
                                {
                                        // TODO
                                        return false;
                                }
                                else
                                {
                                        return false;
                                }
                        }

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

        // Get or set the entire attribute array.
        [TODO]
        protected virtual Attribute[] AttributeArray
                        {
                                get
                                {
                                        return attributes;
                                }
                                set
                                {
                                        attributeCollection = null;
                                        attributes = value;
                                }
                        }

        // Get the hash code for the member name.
        protected virtual int NameHashCode
                        {
                                get
                                {
                                        if(name != null)
                                        {
                                                return name.GetHashCode();
                                        }
                                        else
                                        {
                                                return 0;
                                        }
                                }
                        }

        // Create the attribute collection.
        protected virtual AttributeCollection CreateAttributeCollection()
                        {
                                return new AttributeCollection(AttributeArray);
                        }

        // Fill a list with all attributes.
        protected virtual void FillAttributes(IList attributeList)
                        {
                                if(attributes != null)
                                {
                                        foreach(Object obj in attributes)
                                        {
                                                attributeList.Add(obj);
                                        }
                                }
                        }

        // Find a method by reflection in a component class.
        protected static MethodInfo FindMethod
                                (Type componentClass, String name,
                                 Type[] args, Type returnType)
                        {
                                return FindMethod(componentClass, name, args, 
returnType, true);
                        }
        protected static MethodInfo FindMethod
                                (Type componentClass, String name,
                                 Type[] args, Type returnType, bool publicOnly)
                        {
                                MethodInfo method;
                                method = componentClass.GetMethod
                                        (name, (publicOnly ? 
BindingFlags.Public |
                                                                                
 BindingFlags.Static |
                                                                                
 BindingFlags.Instance
                                                                           : 
BindingFlags.Public |
                                                                             
BindingFlags.NonPublic |
                                                                                
 BindingFlags.Static |
                                                                                
 BindingFlags.Instance),
                                         null, args, null);
                                if(method != null && method.ReturnType == 
returnType)
                                {
                                        return method;
                                }
                                else
                                {
                                        return null;
                                }
                        }

        // 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;
                        }

}; // class MemberDescriptor

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * PropertyDescriptor.cs - Implementation of the
 *              "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
 * 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 !ECMA_COMPAT

using System.Collections;
using System.Reflection;
using System.Runtime.InteropServices;

[TODO]
[ComVisible(true)]
public class PropertyDescriptor : MemberDescriptor
{
        // TODO
        public PropertyDescriptor(String name) : base(name) {}

}; // class PropertyDescriptor

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * 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
 * 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 !ECMA_COMPAT

using System.Collections;
using System.Runtime.InteropServices;

[TODO]
[ComVisible(true)]
public class PropertyDescriptorCollection
{
        // TODO

        public PropertyDescriptorCollection() {}

        public void Sort(String[] names) {}

}; // class PropertyDescriptorCollection

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

Index: ITypeDescriptorContext.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/ITypeDescriptorContext.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** ITypeDescriptorContext.cs   30 Jun 2002 09:19:50 -0000      1.1
--- ITypeDescriptorContext.cs   3 Dec 2002 00:18:55 -0000       1.2
***************
*** 29,33 ****
  
  [TODO]
! public interface ITypeDescriptorContext // : IServiceProvider
  {
        // TODO
--- 29,33 ----
  
  [TODO]
! public interface ITypeDescriptorContext : IServiceProvider
  {
        // TODO

Index: TypeConverter.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/TypeConverter.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** TypeConverter.cs    7 Nov 2002 11:25:19 -0000       1.2
--- TypeConverter.cs    3 Dec 2002 00:18:55 -0000       1.3
***************
*** 26,48 ****
  
  using System;
  using System.Globalization;
  
! [TODO]
  public class TypeConverter
  {
!       // TODO
  
        // Convert from another type to the one represented by this class.
        public Object ConvertFrom(Object value)
                        {
!                               return ConvertFrom(null, null, value);
                        }
-       [TODO]
        public virtual Object ConvertFrom(ITypeDescriptorContext context,
                                                                          
CultureInfo culture,
                                                                          
Object value)
                        {
!                               // TODO
!                               return value;
                        }
  
--- 26,282 ----
  
  using System;
+ using System.Collections;
  using System.Globalization;
+ using System.Runtime.InteropServices;
  
! [ComVisible(true)]
  public class TypeConverter
  {
!       // Constructor.
!       public TypeConverter()
!                       {
!                               // Nothing to do here.
!                       }
! 
!       // Determine if we can convert from a specific type to this one.
!       public bool CanConvertFrom(Type sourceType)
!                       {
!                               return CanConvertFrom(null, sourceType);
!                       }
!       public virtual bool CanConvertFrom
!                               (ITypeDescriptorContext context, Type 
sourceType)
!                       {
!                               return false;
!                       }
! 
!       // Determine if we can convert from this type to a specific type.
!       public bool CanConvertTo(Type destinationType)
!                       {
!                               return CanConvertTo(null, destinationType);
!                       }
!       public virtual bool CanConvertTo
!                               (ITypeDescriptorContext context, Type 
destinationType)
!                       {
!                               // By default, we can always convert to the 
string type.
!                               return (destinationType == typeof(String));
!                       }
  
        // Convert from another type to the one represented by this class.
        public Object ConvertFrom(Object value)
                        {
!                               return ConvertFrom(null, 
CultureInfo.CurrentCulture, value);
                        }
        public virtual Object ConvertFrom(ITypeDescriptorContext context,
                                                                          
CultureInfo culture,
                                                                          
Object value)
                        {
!                               throw GetConvertFromException(value);
!                       }
! 
!       // Convert a string into this type using the invariant culture.
!       public Object ConvertFromInvariantString(String text)
!                       {
!                               return ConvertFromString
!                                       (null, CultureInfo.InvariantCulture, 
text);
!                       }
!       public Object ConvertFromInvariantString
!                               (ITypeDescriptorContext context, String text)
!                       {
!                               return ConvertFromString
!                                       (context, CultureInfo.InvariantCulture, 
text);
!                       }
! 
!       // Convert a string into this type.
!       public Object ConvertFromString(String text)
!                       {
!                               return ConvertFrom(null, 
CultureInfo.CurrentCulture, text);
!                       }
!       public Object ConvertFromString
!                               (ITypeDescriptorContext context, String text)
!                       {
!                               return ConvertFrom(context, 
CultureInfo.CurrentCulture, text);
!                       }
!       public Object ConvertFromString
!                               (ITypeDescriptorContext context,
!                                CultureInfo culture, String text)
!                       {
!                               return ConvertFrom(context, culture, text);
!                       }
! 
!       // Convert this object into another type.
!       public Object ConvertTo(Object value, Type destinationType)
!                       {
!                               return ConvertTo(null, null, value, 
destinationType);
!                       }
!       public virtual Object ConvertTo(ITypeDescriptorContext context,
!                                                                       
CultureInfo culture,
!                                                                       Object 
value, Type destinationType)
!                       {
!                               if(destinationType == null)
!                               {
!                                       throw new 
ArgumentNullException("destinationType");
!                               }
!                               if(destinationType == typeof(String))
!                               {
!                                       if(value != null)
!                                       {
!                                               return value.ToString();
!                                       }
!                                       else
!                                       {
!                                               return String.Empty;
!                                       }
!                               }
!                               else
!                               {
!                                       throw GetConvertToException(value, 
destinationType);
!                               }
!                       }
! 
!       // Convert an object to a culture-invariant string.
!       public String ConvertToInvariantString(Object value)
!                       {
!                               return ConvertToString
!                                       (null, CultureInfo.InvariantCulture, 
value);
!                       }
!       public String ConvertToInvariantString
!                               (ITypeDescriptorContext context, Object value)
!                       {
!                               return ConvertToString
!                                       (context, CultureInfo.InvariantCulture, 
value);
!                       }
! 
!       // Convert an object into a string.
!       public String ConvertToString(Object value)
!                       {
!                               return (String)ConvertTo(null, 
CultureInfo.CurrentCulture,
!                                                                               
 value, typeof(String));
!                       }
!       public String ConvertToString
!                               (ITypeDescriptorContext context, Object value)
!                       {
!                               return (String)ConvertTo(context, 
CultureInfo.CurrentCulture,
!                                                                               
 value, typeof(String));
!                       }
!       public String ConvertToString
!                               (ITypeDescriptorContext context,
!                                CultureInfo culture, Object value)
!                       {
!                               return (String)ConvertTo(context, culture,
!                                                                               
 value, typeof(String));
!                       }
! 
!       // Create an instance of this type of object.
!       public Object CreateInstance(IDictionary propertyValues)
!                       {
!                               return CreateInstance(null, propertyValues);
!                       }
!       public virtual Object CreateInstance
!                               (ITypeDescriptorContext context, IDictionary 
propertyValues)
!                       {
!                               return null;
!                       }
! 
!       // Determine if creating new instances is supported.
!       public bool GetCreateInstanceSupported()
!                       {
!                               return GetCreateInstanceSupported(null);
!                       }
!       public virtual bool GetCreateInstanceSupported
!                               (ITypeDescriptorContext context)
!                       {
!                               return false;
!                       }
! 
!       // Get the properties for an object.
!       public PropertyDescriptorCollection GetProperties(Object value)
!                       {
!                               return GetProperties(null, value, null);
!                       }
!       public PropertyDescriptorCollection GetProperties
!                               (ITypeDescriptorContext context, Object value)
!                       {
!                               return GetProperties(context, value, null);
!                       }
!       public virtual PropertyDescriptorCollection GetProperties
!                               (ITypeDescriptorContext context, Object value,
!                                Attribute[] attributes)
!                       {
!                               return null;
!                       }
! 
!       // Determine if the "GetProperties" method is supported.
!       public bool GetPropertiesSupported()
!                       {
!                               return GetPropertiesSupported(null);
!                       }
!       public virtual bool GetPropertiesSupported
!                               (ITypeDescriptorContext context)
!                       {
!                               return false;
!                       }
! 
!       // Return a collection of standard values for this data type.
!       public ICollection GetStandardValues()
!                       {
!                               return GetStandardValues(null);
!                       }
!       public virtual ICollection GetStandardValues
!                               (ITypeDescriptorContext context)
!                       {
!                               return null;
!                       }
! 
!       // Determine if the list of standard values is an exclusive list.
!       public bool GetStandardValuesExclusive()
!                       {
!                               return GetStandardValuesExclusive(null);
!                       }
!       public virtual bool GetStandardValuesExclusive
!                               (ITypeDescriptorContext context)
!                       {
!                               return false;
!                       }
! 
!       // Determine if "GetStandardValues" is supported.
!       public bool GetStandardValuesSupported()
!                       {
!                               return GetStandardValuesSupported(null);
!                       }
!       public virtual bool GetStandardValuesSupported
!                               (ITypeDescriptorContext context)
!                       {
!                               return false;
!                       }
! 
!       // Determine if an object is valid for this type.
!       public bool IsValid(Object value)
!                       {
!                               return IsValid(null, value);
!                       }
!       public virtual bool IsValid(ITypeDescriptorContext context, Object 
value)
!                       {
!                               return true;
!                       }
! 
!       // Get the exception to use when "ConvertFrom" cannot be performed.
!       protected Exception GetConvertFromException(Object value)
!                       {
!                               return new 
NotSupportedException(S._("NotSupp_Conversion"));
!                       }
! 
!       // Get the exception to use when "ConvertTo" cannot be performed.
!       protected Exception GetConvertToException
!                               (Object value, Type destinationType)
!                       {
!                               return new 
NotSupportedException(S._("NotSupp_Conversion"));
!                       }
! 
!       // Sort a collection of properties.
!       protected PropertyDescriptorCollection SortProperties
!                               (PropertyDescriptorCollection props, String[] 
names)
!                       {
!                               props.Sort(names);
!                               return props;
                        }
  





reply via email to

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