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 IComNativeDescr


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System/ComponentModel IComNativeDescriptorHandler.cs, NONE, 1.1 ImmutableObjectAttribute.cs, NONE, 1.1 MergablePropertyAttribute.cs, NONE, 1.1 ParenthesizePropertyNameAttribute.cs, NONE, 1.1 AmbientValueAttribute.cs, 1.2, 1.3 AttributeCollection.cs, 1.3, 1.4 Component.cs, 1.5, 1.6 DefaultValueAttribute.cs, 1.2, 1.3 DescriptionAttribute.cs, 1.2, 1.3 DesignOnlyAttribute.cs, 1.3, 1.4 DesignTimeVisibleAttribute.cs, 1.3, 1.4 DesignerAttribute.cs, 1.2, 1.3 DesignerCategoryAttribute.cs, 1.2, 1.3 DesignerSerializationVisibilityAttribute.cs, 1.3, 1.4 EditorAttribute.cs, 1.4, 1.5 EventHandlerList.cs, 1.2, 1.3 IComponent.cs, 1.2, 1.3 ITypeDescriptorContext.cs, 1.4, 1.5 InvalidEnumArgumentException.cs, 1.5, 1.6 ListBindableAttribute.cs, 1.4, 1.5 LocalizableAttribute.cs, 1.4, 1.5 MarshalByValueComponent.cs, 1.4, 1.5 RefreshPropertiesAttribute.cs, 1.4, 1.5 RunInstallerAttribute.cs, 1.1, 1.2 TypeConverterAttribute.cs, 1.3, 1.4 TypeListConverter.cs, 1.1, 1.2
Date: Fri, 08 Aug 2003 01:52:51 -0400

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

Modified Files:
        AmbientValueAttribute.cs AttributeCollection.cs Component.cs 
        DefaultValueAttribute.cs DescriptionAttribute.cs 
        DesignOnlyAttribute.cs DesignTimeVisibleAttribute.cs 
        DesignerAttribute.cs DesignerCategoryAttribute.cs 
        DesignerSerializationVisibilityAttribute.cs EditorAttribute.cs 
        EventHandlerList.cs IComponent.cs ITypeDescriptorContext.cs 
        InvalidEnumArgumentException.cs ListBindableAttribute.cs 
        LocalizableAttribute.cs MarshalByValueComponent.cs 
        RefreshPropertiesAttribute.cs RunInstallerAttribute.cs 
        TypeConverterAttribute.cs TypeListConverter.cs 
Added Files:
        IComNativeDescriptorHandler.cs ImmutableObjectAttribute.cs 
        MergablePropertyAttribute.cs 
        ParenthesizePropertyNameAttribute.cs 
Log Message:


Improve signature compatibility of the System.ComponentModel classes.


--- NEW FILE ---
/*
 * IComNativeDescriptorHandler.cs - Implementation of the
 *              "System.ComponentModel.IComNativeDescriptorHandler" interface.
 *
 * 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;

public interface IComNativeDescriptorHandler
{
        AttributeCollection GetAttributes(Object component);
        String GetClassName(Object component);
        TypeConverter GetConverter(Object component);
        EventDescriptor GetDefaultEvent(Object component);
        PropertyDescriptor GetDefaultProperty(Object component);
        Object GetEditor(Object component, Type baseEditorType);
        EventDescriptorCollection GetEvents(Object component);
        EventDescriptorCollection GetEvents
                        (Object component, Attribute[] attributes);
        String GetName(Object component);
        PropertyDescriptorCollection GetProperties
                        (Object component, Attribute[] attributes);
        Object GetPropertyValue
                        (Object component, int dispid, ref bool success);
        Object GetPropertyValue
                        (Object component, String propertyName, ref bool 
success);

}; // interface IComNativeDescriptorHandler

#endif // CONFIG_COMPONENT_MODEL

}; // namespace System.ComponentModel

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

using System;

[AttributeUsage(AttributeTargets.All)]
public sealed class ImmutableObjectAttribute : Attribute
{
        // Internal state.
        private bool immutable;

        // Builtin attribute values.
        public static readonly ImmutableObjectAttribute Default
                        = new ImmutableObjectAttribute(false);
        public static readonly ImmutableObjectAttribute No
                        = new ImmutableObjectAttribute(false);
        public static readonly ImmutableObjectAttribute Yes
                        = new ImmutableObjectAttribute(true);

        // Constructor.
        public ImmutableObjectAttribute(bool immutable)
                        {
                                this.immutable = immutable;
                        }

        // Determine if the installer should be run.
        public bool Immutable
                        {
                                get
                                {
                                        return immutable;
                                }
                        }

        // Determine if two object are equal.
        public override bool Equals(Object obj)
                        {
                                ImmutableObjectAttribute other =
                                        (obj as ImmutableObjectAttribute);
                                if(other != null)
                                {
                                        return (other.immutable == immutable);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get the hash code for this object.
        public override int GetHashCode()
                        {
                                return (immutable ? 1 : 0);
                        }

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

}; // class ImmutableObjectAttribute

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * MergablePropertyAttribute.cs - Implementation of the
 *                      "System.ComponentModel.MergablePropertyAttribute" 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

[AttributeUsage(AttributeTargets.All)]
public sealed class MergablePropertyAttribute : Attribute
{
        // Internal state.
        private bool allowMerge;

        // Pre-defined attribute values.
        public static readonly MergablePropertyAttribute Default
                        = new MergablePropertyAttribute(false);
        public static readonly MergablePropertyAttribute No
                        = new MergablePropertyAttribute(false);
        public static readonly MergablePropertyAttribute Yes
                        = new MergablePropertyAttribute(true);

        // Constructor.
        public MergablePropertyAttribute(bool allowMerge)
                        {
                                this.allowMerge = allowMerge;
                        }

        // Get the attribute's value.
        public bool AllowMerge
                        {
                                get
                                {
                                        return allowMerge;
                                }
                        }

        // Determine if two objects are equal.
        public override bool Equals(Object obj)
                        {
                                MergablePropertyAttribute other =
                                        (obj as MergablePropertyAttribute);
                                if(other != null)
                                {
                                        return (allowMerge == other.allowMerge);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get the hash code for this object.
        public override int GetHashCode()
                        {
                                return (allowMerge ? 1 : 0);
                        }

        // Determine if this attribute has the default value.
        public override bool IsDefaultAttribute()
                        {
                                return !allowMerge;
                        }

}; // class MergablePropertyAttribute

#endif // CONFIG_COMPONENT_MODEL

}; // namespace System.ComponentModel

--- NEW FILE ---
/*
 * ParenthesizePropertyNameAttribute.cs - Implementation of the
 *                      
"System.ComponentModel.ParenthesizePropertyNameAttribute" 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

[AttributeUsage(AttributeTargets.All)]
public sealed class ParenthesizePropertyNameAttribute : Attribute
{
        // Internal state.
        private bool needParenthesis;

        // Pre-defined attribute values.
        public static readonly ParenthesizePropertyNameAttribute Default
                        = new ParenthesizePropertyNameAttribute();

        // Constructors.
        public ParenthesizePropertyNameAttribute() {}
        public ParenthesizePropertyNameAttribute(bool needParenthesis)
                        {
                                this.needParenthesis = needParenthesis;
                        }

        // Get the attribute's value.
        public bool NeedParenthesis
                        {
                                get
                                {
                                        return needParenthesis;
                                }
                        }

        // Determine if two objects are equal.
        public override bool Equals(Object obj)
                        {
                                ParenthesizePropertyNameAttribute other =
                                        (obj as 
ParenthesizePropertyNameAttribute);
                                if(other != null)
                                {
                                        return (needParenthesis == 
other.needParenthesis);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get the hash code for this object.
        public override int GetHashCode()
                        {
                                return (needParenthesis ? 1 : 0);
                        }

        // Determine if this attribute has the default value.
        public override bool IsDefaultAttribute()
                        {
                                return !needParenthesis;
                        }

}; // class ParenthesizePropertyNameAttribute

#endif // CONFIG_COMPONENT_MODEL

}; // namespace System.ComponentModel

Index: AmbientValueAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/AmbientValueAttribute.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** AmbientValueAttribute.cs    29 May 2003 05:38:17 -0000      1.2
--- AmbientValueAttribute.cs    8 Aug 2003 05:52:47 -0000       1.3
***************
*** 3,7 ****
   *                    "System.ComponentModel.AmbientValueAttribute" 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.AmbientValueAttribute" class.
   *
!  * Copyright (C) 2002, 2003  Southern Storm Software, Pty Ltd.
   *
   * This program is free software; you can redistribute it and/or modify
***************
*** 72,81 ****
                                obj = value;
                        }
-       [TODO]
        public AmbientValueAttribute(Type type, String value)
                        {
!                               // TODO: find a converter for the type and then
!                               // convert the string using it.
!                               obj = value;
                        }
  
--- 72,86 ----
                                obj = value;
                        }
        public AmbientValueAttribute(Type type, String value)
                        {
!                               try
!                               {
!                                       obj = TypeDescriptor.GetConverter(type)
!                                                       
.ConvertFromInvariantString(value);
!                               }
!                               catch(Exception)
!                               {
!                                       // Ignore exceptions during type 
conversion.
!                               }
                        }
  

Index: AttributeCollection.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/AttributeCollection.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** AttributeCollection.cs      29 May 2003 05:38:17 -0000      1.3
--- AttributeCollection.cs      8 Aug 2003 05:52:47 -0000       1.4
***************
*** 54,58 ****
                                coll.CopyTo(array, index);
                        }
!       public int Count
                        {
                                get
--- 54,58 ----
                                coll.CopyTo(array, index);
                        }
!       int ICollection.Count
                        {
                                get
***************
*** 61,65 ****
                                }
                        }
!       public bool IsSynchronized
                        {
                                get
--- 61,65 ----
                                }
                        }
!       bool ICollection.IsSynchronized
                        {
                                get
***************
*** 68,72 ****
                                }
                        }
!       public Object SyncRoot
                        {
                                get
--- 68,72 ----
                                }
                        }
!       Object ICollection.SyncRoot
                        {
                                get
***************
*** 77,85 ****
  
        // Implement the IEnumerable interface.
!       public IEnumerator GetEnumerator()
                        {
                                return coll.GetEnumerator();
                        }
  
        // Get an element from this collection, by index.
        public virtual Attribute this[int index]
--- 77,94 ----
  
        // Implement the IEnumerable interface.
!       IEnumerator IEnumerable.GetEnumerator()
                        {
                                return coll.GetEnumerator();
                        }
  
+       // Get the number of elements in this collection.
+       public int Count
+                       {
+                               get
+                               {
+                                       return coll.Count;
+                               }
+                       }
+ 
        // Get an element from this collection, by index.
        public virtual Attribute this[int index]
***************
*** 151,154 ****
--- 160,169 ----
                                        }
                                }
+                       }
+ 
+       // Get an enumerator for this collection.
+       public IEnumerator GetEnumerator()
+                       {
+                               return coll.GetEnumerator();
                        }
  

Index: Component.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/Component.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** Component.cs        29 May 2003 05:38:17 -0000      1.5
--- Component.cs        8 Aug 2003 05:52:47 -0000       1.6
***************
*** 27,30 ****
--- 27,31 ----
  using System;
  
+ [DesignerCategory("Component")]
  public class Component : MarshalByRefObject, IComponent, IDisposable
  {
***************
*** 44,47 ****
--- 45,50 ----
  
        // Get this component's container.
+       
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+       [Browsable(false)]
        public IContainer Container
                        {
***************
*** 60,63 ****
--- 63,68 ----
  
        // Determine if this component is in "design mode".
+       
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+       [Browsable(false)]
        protected bool DesignMode
                        {
***************
*** 92,95 ****
--- 97,102 ----
  
        // Get or set the site associated with this component.
+       
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+       [Browsable(false)]
        public virtual ISite Site
                        {
***************
*** 105,108 ****
--- 112,117 ----
  
        // Event that is raised when a component is disposed.
+       [EditorBrowsable(EditorBrowsableState.Advanced)]
+       [Browsable(false)]
        public event EventHandler Disposed
                        {

Index: DefaultValueAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/DefaultValueAttribute.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** DefaultValueAttribute.cs    29 May 2003 05:38:17 -0000      1.2
--- DefaultValueAttribute.cs    8 Aug 2003 05:52:47 -0000       1.3
***************
*** 72,81 ****
                                obj = value;
                        }
-       [TODO]
        public DefaultValueAttribute(Type type, String value)
                        {
!                               // TODO: find a converter for the type and then
!                               // convert the string using it.
!                               obj = value;
                        }
  
--- 72,86 ----
                                obj = value;
                        }
        public DefaultValueAttribute(Type type, String value)
                        {
!                               try
!                               {
!                                       obj = TypeDescriptor.GetConverter(type)
!                                                       
.ConvertFromInvariantString(value);
!                               }
!                               catch(Exception)
!                               {
!                                       // Ignore exceptions during type 
conversion.
!                               }
                        }
  

Index: DescriptionAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/DescriptionAttribute.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** DescriptionAttribute.cs     29 May 2003 05:38:17 -0000      1.2
--- DescriptionAttribute.cs     8 Aug 2003 05:52:47 -0000       1.3
***************
*** 31,34 ****
--- 31,38 ----
        private String desc;
  
+       // Default description value.
+       public static readonly DescriptionAttribute Default
+                       = new DescriptionAttribute();
+ 
        // Constructor.
        public DescriptionAttribute()
***************
*** 49,53 ****
                                }
                        }
!       protected virtual String DescriptionValue
                        {
                                get
--- 53,57 ----
                                }
                        }
!       protected String DescriptionValue
                        {
                                get

Index: DesignOnlyAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/DesignOnlyAttribute.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DesignOnlyAttribute.cs      29 May 2003 05:38:17 -0000      1.3
--- DesignOnlyAttribute.cs      8 Aug 2003 05:52:47 -0000       1.4
***************
*** 26,29 ****
--- 26,30 ----
  {
  #if CONFIG_COMPONENT_MODEL
+       [AttributeUsage(AttributeTargets.All)]
        public sealed class DesignOnlyAttribute: Attribute
        {

Index: DesignTimeVisibleAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/DesignTimeVisibleAttribute.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DesignTimeVisibleAttribute.cs       29 May 2003 05:38:17 -0000      1.3
--- DesignTimeVisibleAttribute.cs       8 Aug 2003 05:52:47 -0000       1.4
***************
*** 27,30 ****
--- 27,31 ----
  
  #if CONFIG_COMPONENT_MODEL
+       [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
        public sealed class DesignTimeVisibleAttribute: Attribute
        {

Index: DesignerAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/DesignerAttribute.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** DesignerAttribute.cs        29 May 2003 05:38:17 -0000      1.2
--- DesignerAttribute.cs        8 Aug 2003 05:52:47 -0000       1.3
***************
*** 88,91 ****
--- 88,104 ----
                                }
                        }
+       public override Object TypeId
+                       {
+                               get
+                               {
+                                       String type = baseType;
+                                       int index = type.IndexOf(',');
+                                       if(index != -1)
+                                       {
+                                               type = type.Substring(0, index);
+                                       }
+                                       return GetType().FullName + type;
+                               }
+                       }
  
        // Determine if two instances of this class are equal.

Index: DesignerCategoryAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/DesignerCategoryAttribute.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** DesignerCategoryAttribute.cs        29 May 2003 05:38:17 -0000      1.2
--- DesignerCategoryAttribute.cs        8 Aug 2003 05:52:47 -0000       1.3
***************
*** 25,29 ****
  #if CONFIG_COMPONENT_MODEL
  
! [AttributeUsage(AttributeTargets.Class)]
  public sealed class DesignerCategoryAttribute : Attribute
  {
--- 25,29 ----
  #if CONFIG_COMPONENT_MODEL
  
! [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
  public sealed class DesignerCategoryAttribute : Attribute
  {
***************
*** 34,37 ****
--- 34,39 ----
        public static readonly DesignerCategoryAttribute Component =
                        new DesignerCategoryAttribute("Component");
+       public static readonly DesignerCategoryAttribute Default =
+                       new DesignerCategoryAttribute();
        public static readonly DesignerCategoryAttribute Form =
                        new DesignerCategoryAttribute("Form");

Index: DesignerSerializationVisibilityAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/DesignerSerializationVisibilityAttribute.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** DesignerSerializationVisibilityAttribute.cs 29 May 2003 05:38:17 -0000      
1.3
--- DesignerSerializationVisibilityAttribute.cs 8 Aug 2003 05:52:47 -0000       
1.4
***************
*** 26,29 ****
--- 26,30 ----
  {
  #if CONFIG_COMPONENT_MODEL || CONFIG_EXTENDED_DIAGNOSTICS
+       [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)]
        public sealed class DesignerSerializationVisibilityAttribute: Attribute
        {

Index: EditorAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/EditorAttribute.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** EditorAttribute.cs  29 May 2003 05:38:17 -0000      1.4
--- EditorAttribute.cs  8 Aug 2003 05:52:47 -0000       1.5
***************
*** 25,29 ****
  #if CONFIG_COMPONENT_MODEL || CONFIG_EXTENDED_DIAGNOSTICS
  
! [AttributeUsage(AttributeTargets.All)]
  public sealed class EditorAttribute : Attribute
  {
--- 25,29 ----
  #if CONFIG_COMPONENT_MODEL || CONFIG_EXTENDED_DIAGNOSTICS
  
! [AttributeUsage(AttributeTargets.All, AllowMultiple=true, Inherited=true)]
  public sealed class EditorAttribute : Attribute
  {

Index: EventHandlerList.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/EventHandlerList.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** EventHandlerList.cs 29 May 2003 05:38:17 -0000      1.2
--- EventHandlerList.cs 8 Aug 2003 05:52:47 -0000       1.3
***************
*** 115,119 ****
  
        // Implement the IDisposable interface.
!       void IDisposable.Dispose()
                        {
                                list = null;
--- 115,119 ----
  
        // Implement the IDisposable interface.
!       public void Dispose()
                        {
                                list = null;

Index: IComponent.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/IComponent.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** IComponent.cs       29 May 2003 05:38:17 -0000      1.2
--- IComponent.cs       8 Aug 2003 05:52:47 -0000       1.3
***************
*** 26,32 ****
--- 26,46 ----
  
  using System;
+ using System.ComponentModel.Design;
+ using System.ComponentModel.Design.Serialization;
  using System.Runtime.InteropServices;
  
  [ComVisible(true)]
+ //TODO: [TypeConverter(typeof(ComponentConverter))]
+ #if CONFIG_COMPONENT_MODEL_DESIGN
+ [Designer
+       ("System.Windows.Forms.Design.ComponentDocumentDesigner, System.Design",
+        typeof(IRootDesigner))]
+ [Designer
+       ("System.Windows.Forms.Design.ComponentDocumentDesigner, System.Design",
+        typeof(IDesigner))]
+ [RootDesignerSerializer
+       ("System.ComponentModel.Design.Serialization.RootCodeDomSerializer, 
System.Design",
+        "System.ComponentModel.Design.Serialization.CodeDomSerializer, 
System.Design", true)]
+ #endif
  public interface IComponent : IDisposable
  {

Index: ITypeDescriptorContext.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/ITypeDescriptorContext.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** ITypeDescriptorContext.cs   29 May 2003 05:38:17 -0000      1.4
--- ITypeDescriptorContext.cs   8 Aug 2003 05:52:47 -0000       1.5
***************
*** 27,31 ****
--- 27,33 ----
  using System;
  using System.Globalization;
+ using System.Runtime.InteropServices;
  
+ [ComVisible(true)]
  public interface ITypeDescriptorContext : IServiceProvider
  {
***************
*** 43,47 ****
  
        // Method that is called when the component is about to change.
!       void OnComponentChanging();
  
  }; // interface ITypeDescriptorContext
--- 45,49 ----
  
        // Method that is called when the component is about to change.
!       bool OnComponentChanging();
  
  }; // interface ITypeDescriptorContext

Index: InvalidEnumArgumentException.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/InvalidEnumArgumentException.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** InvalidEnumArgumentException.cs     5 Jul 2003 05:07:10 -0000       1.5
--- InvalidEnumArgumentException.cs     8 Aug 2003 05:52:47 -0000       1.6
***************
*** 55,76 ****
                        }
  
-       // Get the exception message.
-       public override String Message
-                       {
-                               get
-                               {
-                                       if(enumClass != null)
-                                       {
-                                               return 
String.Format(S._("Exception_InvalidEnumValue"),
-                                                                               
         invalidValue.ToString(),
-                                                                               
         ParamName, enumClass.ToString());
-                                       }
-                                       else
-                                       {
-                                               return base.Message;
-                                       }
-                               }
-                       }
- 
  }; // class InvalidEnumArgumentException
  
--- 55,58 ----

Index: ListBindableAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/ListBindableAttribute.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** ListBindableAttribute.cs    29 May 2003 05:38:17 -0000      1.4
--- ListBindableAttribute.cs    8 Aug 2003 05:52:47 -0000       1.5
***************
*** 25,30 ****
  #if CONFIG_COMPONENT_MODEL
  
! [AttributeUsage(AttributeTargets.All,
!                               AllowMultiple=false, Inherited=true)]
  public sealed class ListBindableAttribute : Attribute
  {
--- 25,29 ----
  #if CONFIG_COMPONENT_MODEL
  
! [AttributeUsage(AttributeTargets.All)]
  public sealed class ListBindableAttribute : Attribute
  {

Index: LocalizableAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/LocalizableAttribute.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** LocalizableAttribute.cs     29 May 2003 05:38:17 -0000      1.4
--- LocalizableAttribute.cs     8 Aug 2003 05:52:47 -0000       1.5
***************
*** 25,29 ****
  #if CONFIG_COMPONENT_MODEL
  
! [AttributeUsage(AttributeTargets.Property)]
  public sealed class LocalizableAttribute : Attribute
  {
--- 25,29 ----
  #if CONFIG_COMPONENT_MODEL
  
! [AttributeUsage(AttributeTargets.All)]
  public sealed class LocalizableAttribute : Attribute
  {
***************
*** 32,35 ****
--- 32,37 ----
  
        // Pre-defined attribute values.
+       public static readonly LocalizableAttribute Default
+                       = new LocalizableAttribute(false);
        public static readonly LocalizableAttribute No
                        = new LocalizableAttribute(false);
***************
*** 50,53 ****
--- 52,81 ----
                                        return localizable;
                                }
+                       }
+ 
+       // Determine if two objects are equal.
+       public override bool Equals(Object obj)
+                       {
+                               LocalizableAttribute other = (obj as 
LocalizableAttribute);
+                               if(other != null)
+                               {
+                                       return (localizable == 
other.localizable);
+                               }
+                               else
+                               {
+                                       return false;
+                               }
+                       }
+ 
+       // Get the hash code for this object.
+       public override int GetHashCode()
+                       {
+                               return (localizable ? 1 : 0);
+                       }
+ 
+       // Determine if this attribute has the default value.
+       public override bool IsDefaultAttribute()
+                       {
+                               return !localizable;
                        }
  

Index: MarshalByValueComponent.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/MarshalByValueComponent.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** MarshalByValueComponent.cs  26 Jun 2003 23:57:42 -0000      1.4
--- MarshalByValueComponent.cs  8 Aug 2003 05:52:47 -0000       1.5
***************
*** 1,5 ****
  /*
!  * MarshalByValueComponent.cs - 
!  *            Implementation of "MarshalByValueComponent" class. 
   *
   * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
--- 1,5 ----
  /*
!  * MarshalByValueComponent.cs - Implementation of the
!  *            "System.ComponentModel.MarshalByValueComponent" class.
   *
   * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
***************
*** 20,102 ****
   */
  
- using System;
- 
  namespace System.ComponentModel
  {
  #if CONFIG_COMPONENT_MODEL
  
!       public class MarshalByValueComponent :  IServiceProvider, 
!                                                                               
        IDisposable, 
!                                                                               
        IComponent
!       {
!               [TODO]
!               public MarshalByValueComponent()
!               {
!               }
  
!               [TODO]
!               public void Dispose()
!               {
!                       throw new NotImplementedException("Dispose");
!               }
  
!               [TODO]
!               protected virtual void Dispose(bool disposing)
!               {
!                       throw new NotImplementedException("Dispose");
!               }
  
!               [TODO]
!               ~MarshalByValueComponent()
!               {
!                       throw new NotImplementedException("Finalize");
!               }
  
!               [TODO]
!               public virtual Object GetService(Type service)
!               {
!                       throw new NotImplementedException("GetService");
!               }
  
!               public virtual IContainer Container 
!               { 
!                       get
                        {
!                               throw new NotImplementedException("Container");
                        }
-               }
  
!               public virtual bool DesignMode 
!               { 
!                       get
                        {
!                               throw new NotImplementedException("DesignMode");
                        }
-               }
  
!               protected EventHandlerList Events 
!               { 
!                       get
                        {
!                               throw new NotImplementedException("Events");
                        }
-               }
  
!               public virtual ISite Site 
!               { 
!                       get
                        {
!                               throw new NotImplementedException("Site");
                        }
!                       set
                        {
!                               throw new NotImplementedException("Site");
                        }
-               }
  
!               public event EventHandler Disposed;
  
!       }
  
  #endif // CONFIG_COMPONENT_MODEL
! }//namespace System.ComponentModel
--- 20,195 ----
   */
  
  namespace System.ComponentModel
  {
+ 
  #if CONFIG_COMPONENT_MODEL
  
! using System;
! using System.ComponentModel.Design;
  
! [DesignerCategory("Component")]
! // TODO: [TypeConverter(typeof(ComponentConverter))]
! #if CONFIG_COMPONENT_MODEL_DESIGN
! [Designer
!       ("System.Windows.Forms.Design.ComponentDocumentDesigner, System.Design",
!        typeof(IRootDesigner))]
! #endif
! public class MarshalByValueComponent
!       : IComponent, IDisposable, IServiceProvider
! {
!       // Internal state.
!       private static readonly Object disposedId = new Object();
!       private EventHandlerList events;
!       private ISite site;
  
!       // Constructor.
!       public MarshalByValueComponent() {}
  
!       // Destructor.
!       ~MarshalByValueComponent()
!                       {
!                               Dispose(false);
!                       }
  
!       // Get this component's container.
!       
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
!       [Browsable(false)]
!       public virtual IContainer Container
!                       {
!                               get
!                               {
!                                       if(site != null)
!                                       {
!                                               return site.Container;
!                                       }
!                                       else
!                                       {
!                                               return null;
!                                       }
!                               }
!                       }
  
!       // Determine if this component is in "design mode".
!       
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
!       [Browsable(false)]
!       public virtual bool DesignMode
                        {
!                               get
!                               {
!                                       if(site != null)
!                                       {
!                                               return site.DesignMode;
!                                       }
!                                       else
!                                       {
!                                               return false;
!                                       }
!                               }
                        }
  
!       // Get the event handler list for this component.
!       protected EventHandlerList Events
                        {
!                               get
!                               {
!                                       lock(this)
!                                       {
!                                               if(events == null)
!                                               {
!                                                       events = new 
EventHandlerList();
!                                               }
!                                               return events;
!                                       }
!                               }
                        }
  
!       // Get or set the site associated with this component.
!       
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
!       [Browsable(false)]
!       public virtual ISite Site
                        {
!                               get
!                               {
!                                       return site;
!                               }
!                               set
!                               {
!                                       site = value;
!                               }
                        }
  
!       // Event that is raised when a component is disposed.
!       public event EventHandler Disposed
                        {
!                               add
!                               {
!                                       Events.AddHandler(disposedId, value);
!                               }
!                               remove
!                               {
!                                       Events.RemoveHandler(disposedId, value);
!                               }
                        }
! 
!       // Implement the IDisposable interface.
!       public void Dispose()
                        {
!                               Dispose(true);
!                               GC.SuppressFinalize(this);
                        }
  
!       // Dispose this component.
!       protected virtual void Dispose(bool disposing)
!                       {
!                               if(disposing)
!                               {
!                                       lock(this)
!                                       {
!                                               EventHandler dispose;
!                                               if(site != null && 
site.Container != null)
!                                               {
!                                                       
site.Container.Remove(this);
!                                               }
!                                               if(events != null)
!                                               {
!                                                       dispose = 
(EventHandler)(events[disposedId]);
!                                                       if(dispose != null)
!                                                       {
!                                                               dispose(this, 
EventArgs.Empty);
!                                                       }
!                                               }
!                                       }
!                               }
!                       }
  
!       // Get a service that is implemented by this component.
!       public virtual Object GetService(Type service)
!                       {
!                               if(site != null)
!                               {
!                                       return site.GetService(service);
!                               }
!                               else
!                               {
!                                       return null;
!                               }
!                       }
! 
!       // Convert this object into a string.
!       public override String ToString()
!                       {
!                               if(site != null)
!                               {
!                                       return site.Name + "[" + 
GetType().ToString() + "]";
!                               }
!                               else
!                               {
!                                       return GetType().ToString();
!                               }
!                       }
! 
! }; // class MarshalByValueComponent
  
  #endif // CONFIG_COMPONENT_MODEL
! 
! }; // namespace System.ComponentModel

Index: RefreshPropertiesAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/RefreshPropertiesAttribute.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** RefreshPropertiesAttribute.cs       29 May 2003 05:38:17 -0000      1.4
--- RefreshPropertiesAttribute.cs       8 Aug 2003 05:52:47 -0000       1.5
***************
*** 25,30 ****
  #if CONFIG_COMPONENT_MODEL
  
! [AttributeUsage(AttributeTargets.All,
!                               AllowMultiple=false, Inherited=true)]
  public sealed class RefreshPropertiesAttribute : Attribute
  {
--- 25,29 ----
  #if CONFIG_COMPONENT_MODEL
  
! [AttributeUsage(AttributeTargets.All)]
  public sealed class RefreshPropertiesAttribute : Attribute
  {

Index: RunInstallerAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/RunInstallerAttribute.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** RunInstallerAttribute.cs    7 Aug 2003 06:34:30 -0000       1.1
--- RunInstallerAttribute.cs    8 Aug 2003 05:52:47 -0000       1.2
***************
*** 34,37 ****
--- 34,39 ----
  
        // Builtin attribute values.
+       public static readonly RunInstallerAttribute Default
+                       = new RunInstallerAttribute(false);
        public static readonly RunInstallerAttribute No
                        = new RunInstallerAttribute(false);

Index: TypeConverterAttribute.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/TypeConverterAttribute.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** TypeConverterAttribute.cs   29 May 2003 05:38:17 -0000      1.3
--- TypeConverterAttribute.cs   8 Aug 2003 05:52:47 -0000       1.4
***************
*** 28,35 ****
--- 28,40 ----
  using System.Globalization;
  
+ [AttributeUsage(AttributeTargets.All)]
  public sealed class TypeConverterAttribute : Attribute
  {
        // Internal state.
        private String typeName;
+ 
+       // Pre-defined attribute values.
+       public static readonly TypeConverterAttribute Default
+                       = new TypeConverterAttribute();
  
        // Constructors.

Index: TypeListConverter.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/TypeListConverter.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** TypeListConverter.cs        8 Aug 2003 02:56:50 -0000       1.1
--- TypeListConverter.cs        8 Aug 2003 05:52:47 -0000       1.2
***************
*** 30,34 ****
  using System.ComponentModel.Design.Serialization;
  
! public class TypeListConverter : TypeConverter
  {
        // Internal state.
--- 30,34 ----
  using System.ComponentModel.Design.Serialization;
  
! public abstract class TypeListConverter : TypeConverter
  {
        // Internal state.
***************
*** 36,40 ****
  
        // Constructor.
!       public TypeListConverter(Type[] types)
                        {
                                this.types = types;
--- 36,40 ----
  
        // Constructor.
!       protected TypeListConverter(Type[] types)
                        {
                                this.types = types;





reply via email to

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