Procházet zdrojové kódy

2007-09-27 Atsushi Enomoto <[email protected]>

	* System.dll.sources : added ITypeDiscoveryService.cs.

	* ITypeDiscoveryService.cs : new.
	* DesignerTransactionCloseEventArgs.cs : added [Obsolete].
	* DesignerVerb.cs : added Description. ToString() contains " : ".
	* StandardCommands.cs : added DocumentOutline and ViewCode.
	* HelpKeywordAttribute.cs : implemented .ctor(Type).
	* ComponentChangedEventHandler.cs, ComponentRenameEventHandler.cs,
	  ActiveDesignerEventHandler.cs, HelpKeywordType.cs,
	  DesignerEventHandler.cs, ComponentEventHandler.cs,
	  DesignerTransactionCloseEventHandler.cs, HelpContextType.cs
	  ComponentChangingEventHandler.cs : [Serializable] is extra in 2.0.
	* ServiceContainer.cs : some members became virtual in 2.0.
	  Removed finalizer. Added DefaultServices.
	* DesignerOptionService.cs : it is abstract. Added attributes.
	* CheckoutException.cs : added more 2.0 constructors.
	* MenuCommand.cs : added Properties property.
	* DesignerTransaction.cs : Fixed .ctor() (public->protected)


svn path=/trunk/mcs/; revision=86532
Atsushi Eno před 18 roky
rodič
revize
884e4acbfc
22 změnil soubory, kde provedl 174 přidání a 20 odebrání
  1. 4 0
      mcs/class/System/ChangeLog
  2. 2 0
      mcs/class/System/System.ComponentModel.Design/ActiveDesignerEventHandler.cs
  3. 19 0
      mcs/class/System/System.ComponentModel.Design/Changelog
  4. 17 0
      mcs/class/System/System.ComponentModel.Design/CheckoutException.cs
  5. 2 0
      mcs/class/System/System.ComponentModel.Design/ComponentChangedEventHandler.cs
  6. 2 0
      mcs/class/System/System.ComponentModel.Design/ComponentChangingEventHandler.cs
  7. 2 0
      mcs/class/System/System.ComponentModel.Design/ComponentEventHandler.cs
  8. 2 0
      mcs/class/System/System.ComponentModel.Design/ComponentRenameEventHandler.cs
  9. 2 0
      mcs/class/System/System.ComponentModel.Design/DesignerEventHandler.cs
  10. 4 2
      mcs/class/System/System.ComponentModel.Design/DesignerOptionService.cs
  11. 2 2
      mcs/class/System/System.ComponentModel.Design/DesignerTransaction.cs
  12. 3 0
      mcs/class/System/System.ComponentModel.Design/DesignerTransactionCloseEventArgs.cs
  13. 2 0
      mcs/class/System/System.ComponentModel.Design/DesignerTransactionCloseEventHandler.cs
  14. 13 6
      mcs/class/System/System.ComponentModel.Design/DesignerVerb.cs
  15. 2 0
      mcs/class/System/System.ComponentModel.Design/HelpContextType.cs
  16. 3 1
      mcs/class/System/System.ComponentModel.Design/HelpKeywordAttribute.cs
  17. 2 0
      mcs/class/System/System.ComponentModel.Design/HelpKeywordType.cs
  18. 44 0
      mcs/class/System/System.ComponentModel.Design/ITypeDiscoveryService.cs
  19. 14 0
      mcs/class/System/System.ComponentModel.Design/MenuCommand.cs
  20. 23 9
      mcs/class/System/System.ComponentModel.Design/ServiceContainer.cs
  21. 9 0
      mcs/class/System/System.ComponentModel.Design/StandardCommands.cs
  22. 1 0
      mcs/class/System/System.dll.sources

+ 4 - 0
mcs/class/System/ChangeLog

@@ -1,3 +1,7 @@
+2007-09-27  Atsushi Enomoto  <[email protected]>
+
+	* System.dll.sources : added ITypeDiscoveryService.cs.
+
 2007-09-25  Jonathan Pobst  <[email protected]>
 
 	* System_test.dll.sources: Added AsyncOperationManagerTest.cs.

+ 2 - 0
mcs/class/System/System.ComponentModel.Design/ActiveDesignerEventHandler.cs

@@ -31,6 +31,8 @@ using System.Runtime.Serialization;
 
 namespace System.ComponentModel.Design
 {
+#if !NET_2_0
 	[Serializable]
+#endif
 	public delegate void ActiveDesignerEventHandler (object sender, ActiveDesignerEventArgs e);
 }

+ 19 - 0
mcs/class/System/System.ComponentModel.Design/Changelog

@@ -1,3 +1,22 @@
+2007-09-27  Atsushi Enomoto  <[email protected]>
+
+	* ITypeDiscoveryService.cs : new.
+	* DesignerTransactionCloseEventArgs.cs : added [Obsolete].
+	* DesignerVerb.cs : added Description. ToString() contains " : ".
+	* StandardCommands.cs : added DocumentOutline and ViewCode.
+	* HelpKeywordAttribute.cs : implemented .ctor(Type).
+	* ComponentChangedEventHandler.cs, ComponentRenameEventHandler.cs,
+	  ActiveDesignerEventHandler.cs, HelpKeywordType.cs,
+	  DesignerEventHandler.cs, ComponentEventHandler.cs,
+	  DesignerTransactionCloseEventHandler.cs, HelpContextType.cs
+	  ComponentChangingEventHandler.cs : [Serializable] is extra in 2.0.
+	* ServiceContainer.cs : some members became virtual in 2.0.
+	  Removed finalizer. Added DefaultServices.
+	* DesignerOptionService.cs : it is abstract. Added attributes.
+	* CheckoutException.cs : added more 2.0 constructors.
+	* MenuCommand.cs : added Properties property.
+	* DesignerTransaction.cs : Fixed .ctor() (public->protected)
+
 2007-08-29  Ivan N. Zlatev  <[email protected]>
 
 	* DefaultSerializationProviderAttribute.cs: implemented.

+ 17 - 0
mcs/class/System/System.ComponentModel.Design/CheckoutException.cs

@@ -30,10 +30,15 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System;
 using System.Runtime.InteropServices;
+using System.Runtime.Serialization;
 
 namespace System.ComponentModel.Design
 {
+#if NET_2_0
+	[Serializable]
+#endif
 	public class CheckoutException : ExternalException
 	{
 		public static readonly CheckoutException Canceled = new CheckoutException ();
@@ -52,5 +57,17 @@ namespace System.ComponentModel.Design
 			: base (message, errorCode)
 		{
 		}
+
+#if NET_2_0
+		public CheckoutException (string message, Exception innerException)
+			: base (message, innerException)
+		{
+		}
+
+		protected CheckoutException (SerializationInfo info, StreamingContext context)
+			: base (info, context)
+		{
+		}
+#endif
 	}
 }

+ 2 - 0
mcs/class/System/System.ComponentModel.Design/ComponentChangedEventHandler.cs

@@ -32,7 +32,9 @@ using System.Runtime.InteropServices;
 
 namespace System.ComponentModel.Design
 {
+#if !NET_2_0
 	[Serializable]
+#endif
 	[ComVisible(true)]
         public delegate void ComponentChangedEventHandler (object sender,
 							   ComponentChangedEventArgs e);

+ 2 - 0
mcs/class/System/System.ComponentModel.Design/ComponentChangingEventHandler.cs

@@ -32,7 +32,9 @@ using System.Runtime.InteropServices;
 
 namespace System.ComponentModel.Design
 {
+#if !NET_2_0
 	[Serializable]
+#endif
 	[ComVisible(true)]
         public delegate void ComponentChangingEventHandler (object sender,
 							    ComponentChangingEventArgs e);

+ 2 - 0
mcs/class/System/System.ComponentModel.Design/ComponentEventHandler.cs

@@ -32,7 +32,9 @@ using System.Runtime.InteropServices;
 
 namespace System.ComponentModel.Design
 {
+#if !NET_2_0
 	[Serializable]
+#endif
 	[ComVisible(true)]
         public delegate void ComponentEventHandler (object sender,
 						    ComponentEventArgs e);

+ 2 - 0
mcs/class/System/System.ComponentModel.Design/ComponentRenameEventHandler.cs

@@ -32,7 +32,9 @@ using System.Runtime.InteropServices;
 
 namespace System.ComponentModel.Design
 {
+#if !NET_2_0
 	[Serializable]
+#endif
 	[ComVisible(true)]
         public delegate void ComponentRenameEventHandler (object sender,
 							  ComponentRenameEventArgs e);

+ 2 - 0
mcs/class/System/System.ComponentModel.Design/DesignerEventHandler.cs

@@ -30,7 +30,9 @@
 
 namespace System.ComponentModel.Design
 {
+#if !NET_2_0
 	[Serializable]
+#endif
         public delegate void DesignerEventHandler (object sender,
 						   DesignerEventArgs e);
 }

+ 4 - 2
mcs/class/System/System.ComponentModel.Design/DesignerOptionService.cs

@@ -37,9 +37,11 @@ using System.ComponentModel;
 namespace System.ComponentModel.Design
 {
 
-	public class DesignerOptionService : IDesignerOptionService
+	public abstract class DesignerOptionService : IDesignerOptionService
 	{
-		
+		[MonoTODO ("implement own TypeConverter")]
+		[TypeConverter (typeof (TypeConverter))]
+		[Editor ("", "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
 		public sealed class DesignerOptionCollection : IList, ICollection, IEnumerable
 		{
 			// PropertyDescriptor objects are taken directly from the value passed to the CreateOptionCollection method

+ 2 - 2
mcs/class/System/System.ComponentModel.Design/DesignerTransaction.cs

@@ -37,12 +37,12 @@ namespace System.ComponentModel.Design
 		private bool committed;
 		private bool canceled;
 
-		public DesignerTransaction () 
+		protected DesignerTransaction () 
 			: this ("")
 		{
 		}
 
-		public DesignerTransaction (string description)
+		protected DesignerTransaction (string description)
 		{
 			this.description = description;
 			this.committed = false;

+ 3 - 0
mcs/class/System/System.ComponentModel.Design/DesignerTransactionCloseEventArgs.cs

@@ -47,6 +47,9 @@ namespace System.ComponentModel.Design
 			last_transaction = lastTransaction;
 		}
 		
+#if NET_2_0
+		[Obsolete ("Use another constructor that indicates lastTransaction")]
+#endif
 		public DesignerTransactionCloseEventArgs (bool commit) : this (commit, false)
 		{
 		}

+ 2 - 0
mcs/class/System/System.ComponentModel.Design/DesignerTransactionCloseEventHandler.cs

@@ -31,7 +31,9 @@ using System.Runtime.InteropServices;
 
 namespace System.ComponentModel.Design
 {
+#if !NET_2_0
 	[Serializable]
+#endif
 	[ComVisible(true)]
 	public delegate void DesignerTransactionCloseEventHandler (object sender, DesignerTransactionCloseEventArgs e);
 }

+ 13 - 6
mcs/class/System/System.ComponentModel.Design/DesignerVerb.cs

@@ -37,8 +37,10 @@ namespace System.ComponentModel.Design
 	[ComVisible(true)]
 	public class DesignerVerb : MenuCommand
 	{
-
+		private string text;
+#if NET_2_0
 		private string description;
+#endif
 
 		public DesignerVerb (string text, EventHandler handler) 
 			: this (text, handler, StandardCommands.VerbFirst)
@@ -47,18 +49,23 @@ namespace System.ComponentModel.Design
 
 		public DesignerVerb (string text, EventHandler handler, CommandID startCommandID) 
 			: base (handler, startCommandID) {
-			this.description = text;
+			this.text = text;
 		}
 
 		public string Text {
-			get {
-				return this.description;
-			}
+			get { return text; }
+		}
+
+#if NET_2_0
+		public string Description {
+			get { return description; }
+			set { description = value; }
 		}
+#endif
 
 		public override string ToString()
 		{
-			return string.Concat (description, base.ToString ());
+			return string.Concat (text, " : ", base.ToString ());
 		}
 	}	
 }

+ 2 - 0
mcs/class/System/System.ComponentModel.Design/HelpContextType.cs

@@ -30,7 +30,9 @@
 
 namespace System.ComponentModel.Design
 {
+#if !NET_2_0
 	[Serializable]
+#endif
 	public enum HelpContextType
 	{
 		Ambient = 0,

+ 3 - 1
mcs/class/System/System.ComponentModel.Design/HelpKeywordAttribute.cs

@@ -47,9 +47,11 @@ namespace System.ComponentModel.Design {
 			this.keyword = keyword;
 		}
 
-		[MonoTODO("Not Implemented")]
 		public HelpKeywordAttribute (Type t)
 		{
+			if (t == null)
+				throw new ArgumentNullException ("t");
+			this.keyword = t.FullName;
 		}
 
 		public override bool Equals (object other)

+ 2 - 0
mcs/class/System/System.ComponentModel.Design/HelpKeywordType.cs

@@ -30,7 +30,9 @@
 
 namespace System.ComponentModel.Design
 {
+#if !NET_2_0
 	[Serializable]
+#endif
 	public enum HelpKeywordType
 	{
 		F1Keyword = 0,

+ 44 - 0
mcs/class/System/System.ComponentModel.Design/ITypeDiscoveryService.cs

@@ -0,0 +1,44 @@
+//
+// ITypeDiscoveryService.cs
+//
+// Author:
+//	Atsushi Enomoto  <[email protected]>
+//
+// Copyright (C) 2007 Novell, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System.Collections;
+using System.Runtime.InteropServices;
+
+namespace System.ComponentModel.Design
+{
+        public interface ITypeDiscoveryService
+	{
+		ICollection GetTypes (Type baseType, bool excludeGlobalTypes);
+	}
+}
+
+#endif

+ 14 - 0
mcs/class/System/System.ComponentModel.Design/MenuCommand.cs

@@ -30,6 +30,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.Collections;
 using System.Runtime.InteropServices;
 
 namespace System.ComponentModel.Design
@@ -44,6 +45,9 @@ namespace System.ComponentModel.Design
 		private bool enabled = true;
 		private bool issupported = true;
 		private bool visible = true;
+#if NET_2_0
+		private Hashtable properties;
+#endif
 
 		public MenuCommand (EventHandler handler, CommandID command)
 		{
@@ -91,6 +95,16 @@ namespace System.ComponentModel.Design
 			}		
 		}
 
+#if NET_2_0
+		public virtual IDictionary Properties {
+			get {
+				if (properties == null)
+					properties = new Hashtable ();
+				return properties;
+			}
+		}
+#endif
+
 		public virtual bool Supported {
 			get {
 				return issupported; 

+ 23 - 9
mcs/class/System/System.ComponentModel.Design/ServiceContainer.cs

@@ -70,7 +70,12 @@ namespace System.ComponentModel.Design
 			AddService (serviceType, callback, false);
 		}
 
-		public void AddService (Type serviceType, 
+#if NET_2_0
+		public virtual
+#else
+		public
+#endif
+		void AddService (Type serviceType, 
 					object serviceInstance,
 					bool promote)
 		{
@@ -85,7 +90,12 @@ namespace System.ComponentModel.Design
 			services.Add (serviceType, serviceInstance);
 		}
 
-		public void AddService (Type serviceType,
+#if NET_2_0
+		public virtual
+#else
+		public
+#endif
+		void AddService (Type serviceType,
 					ServiceCreatorCallback callback,
 					bool promote)
 		{
@@ -120,7 +130,12 @@ namespace System.ComponentModel.Design
 				services.Remove (serviceType);
 		}
 
-		public object GetService (Type serviceType)
+#if NET_2_0
+		public virtual
+#else
+		public
+#endif
+		object GetService (Type serviceType)
 		{
 			object result = services[serviceType];
 			if (result == null && parentProvider != null){
@@ -137,7 +152,11 @@ namespace System.ComponentModel.Design
 			return result;
 		}
 
-#if NET_2_0		
+#if NET_2_0
+		protected virtual Type [] DefaultServices {
+			get { return new Type [] { typeof (IServiceContainer), typeof (ServiceContainer)}; }
+		}
+
 		public void Dispose ()
 		{
 			this.Dispose (true);
@@ -160,11 +179,6 @@ namespace System.ComponentModel.Design
 				_disposed = true;
 			}
 		}
-
-		~ServiceContainer ()
-		{
-			Dispose (false);
-		}
 #endif
 		
 	}

+ 9 - 0
mcs/class/System/System.ComponentModel.Design/StandardCommands.cs

@@ -87,6 +87,10 @@ namespace System.ComponentModel.Design
 		public static readonly CommandID VertSpaceIncrease;
 		public static readonly CommandID VertSpaceMakeEqual;
 		public static readonly CommandID ViewGrid;
+#if NET_2_0
+		public static readonly CommandID DocumentOutline;
+		public static readonly CommandID ViewCode;
+#endif
 
 		static StandardCommands()
 		{
@@ -170,6 +174,11 @@ namespace System.ComponentModel.Design
 			VertSpaceMakeEqual = new CommandID (guidA, 49);
 
 			ViewGrid = new CommandID (guidA, 125);
+
+#if NET_2_0
+			DocumentOutline = new CommandID (guidA, 239);
+			ViewCode = new CommandID (guidA, 333);
+#endif
 		}
 
 		public StandardCommands()

+ 1 - 0
mcs/class/System/System.dll.sources

@@ -256,6 +256,7 @@ System.ComponentModel.Design/ISelectionService.cs
 System.ComponentModel.Design/IServiceContainer.cs
 System.ComponentModel.Design/ITreeDesigner.cs
 System.ComponentModel.Design/ITypeDescriptorFilterService.cs
+System.ComponentModel.Design/ITypeDiscoveryService.cs
 System.ComponentModel.Design/ITypeResolutionService.cs
 System.ComponentModel.Design/MenuCommand.cs
 System.ComponentModel/DesignOnlyAttribute.cs