Jelajahi Sumber

* ControlDesigner.cs: Merge with Miguel's version.

svn path=/trunk/mcs/; revision=70152
Raja R Harinath 19 tahun lalu
induk
melakukan
b0cbcf5f67

+ 0 - 1
mcs/class/Managed.Windows.Forms/Makefile

@@ -7,7 +7,6 @@ LIB_MCS_FLAGS = /unsafe \
 	/r:$(corlib) /r:System.dll /r:System.Xml.dll \
 	/r:System.Drawing.dll /r:Accessibility.dll \
 	/r:System.Data.dll /r:Mono.Posix.dll \
-	/r:System.Design.dll	\
 	@System.Windows.Forms.dll.resources \
 	-debug
 

+ 0 - 56
mcs/class/Managed.Windows.Forms/System.Windows.Forms.Design/ControlDesigner.cs

@@ -1,56 +0,0 @@
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2006 Novell, Inc.
-//
-// Authors:
-//    Miguel de Icaza ([email protected])
-//
-
-using System.Drawing;
-using System.ComponentModel;
-using System.ComponentModel.Design;
-
-namespace System.Windows.Forms.Design {
-	
-	public class ControlDesigner : ComponentDesigner {
-		Control designed_control;
-		
-		public ControlDesigner () : base ()
-		{
-		}
-		
-		public override void Initialize (IComponent component)
-		{
-			if (component == null)
-				throw new ArgumentNullException ("component");
-
-			designed_control = component as Control;
-			
-			if (designed_control == null)
-				throw new ArgumentException ("component", "Must derive from Control class");
-		}
-
-		public virtual Control Control {
-			get {
-				return designed_control;
-			}
-		}
-	}
-}

+ 0 - 1
mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources

@@ -16,7 +16,6 @@ System.Windows.Forms.Design/PropertyTab.cs
 System.Windows.Forms.Design/ToolStripItemDesignerAvailability.cs
 System.Windows.Forms.Design/ToolStripItemDesignerAvailabilityAttribute.cs
 System.Windows.Forms.Design/WindowsFormsComponentEditor.cs
-System.Windows.Forms.Design/ControlDesigner.cs
 System.Windows.Forms.RTF/Charcode.cs
 System.Windows.Forms.RTF/Charset.cs
 System.Windows.Forms.RTF/CharsetFlags.cs

+ 8 - 4
mcs/class/System.Design/System.Windows.Forms.Design/ChangeLog

@@ -1,3 +1,7 @@
+2006-12-28  Raja R Harinath  <[email protected]>
+
+	* ControlDesigner.cs: Merge with Miguel's version.
+
 2006-12-19  Chris Toshok  <[email protected]>
 
 	* DataMemberFieldConverter.cs: another empty stub class.
@@ -12,21 +16,21 @@
 
 2005-06-29  Jonathan Chambers <[email protected]>
 
-	* ControlBindingsConverter.cs: Fix namespace 
+	* ControlBindingsConverter.cs: Fix namespace
 
 2006-04-28  Peter Dennis Bartok  <[email protected]>
 
-	* ControlBindingsConverter.cs: Added 
+	* ControlBindingsConverter.cs: Added
 
 2006-04-25  Miguel de Icaza  <[email protected]>
 
-	* AnchorEditor.cs: Implement the anchor editor.   
+	* AnchorEditor.cs: Implement the anchor editor.
 
 	Two thoughts: I love the "Walkthrough" to implement UI editors
 	from the documentation.
 
 	And Visual Studio 2005 was really nice to use to write this code.
-	
+
 2005-06-21  Jonathan Chambers <[email protected]>
 	* DockEditor.cs: Use context information 
 

+ 53 - 89
mcs/class/System.Design/System.Windows.Forms.Design/ControlDesigner.cs

@@ -1,9 +1,12 @@
 //
 // System.Windows.Forms.Design.ComponentEditorForm.cs
 //
-// Author:
-//   Dennis Hayes ([email protected])
+// Authors:
+//    Dennis Hayes ([email protected])
+//    Miguel de Icaza ([email protected])
+//
 // (C) 2002 Ximian, Inc.  http://www.ximian.com
+// Copyright (c) 2006 Novell, Inc.
 //
 
 //
@@ -35,23 +38,22 @@ using System.Drawing;
 using System.Runtime.InteropServices;
 
 namespace System.Windows.Forms.Design {
+
 	public class ControlDesigner : ComponentDesigner
 	{
 		#region Public Instance Constructors
 
-		[MonoTODO]
-		public ControlDesigner()
+		public ControlDesigner () : base ()
 		{
-			throw new NotImplementedException ();
 		}
 
 		#endregion Public Instance Constructors
 
 		#region Static Constructor
 
-		static ControlDesigner()
+		static ControlDesigner ()
 		{
-			ControlDesigner.InvalidPoint = new Point(int.MinValue, int.MinValue);
+			ControlDesigner.InvalidPoint = new Point (int.MinValue, int.MinValue);
 		}
 
 		#endregion Static Constructor
@@ -59,13 +61,13 @@ namespace System.Windows.Forms.Design {
 		#region Public Instance Methods
 
 		[MonoTODO]
-		public virtual bool CanBeParentedTo(IDesigner parentDesigner)
+		public virtual bool CanBeParentedTo (IDesigner parentDesigner)
 		{
 			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
-		public override void OnSetComponentDefaults()
+		public override void OnSetComponentDefaults ()
 		{
 			throw new NotImplementedException ();
 		}
@@ -75,25 +77,25 @@ namespace System.Windows.Forms.Design {
 		#region Protected Instance Methods
 
 		[MonoTODO]
-		protected void BaseWndProc(ref Message m)
+		protected void BaseWndProc (ref Message m)
 		{
 			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
-		protected void DefWndProc(ref Message m)
+		protected void DefWndProc (ref Message m)
 		{
 			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
-		protected void DisplayError(Exception e)
+		protected void DisplayError (Exception e)
 		{
 			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
-		protected void EnableDragDrop(bool value)
+		protected void EnableDragDrop (bool value)
 		{
 			throw new NotImplementedException ();
 		}
@@ -141,7 +143,7 @@ namespace System.Windows.Forms.Design {
 		}
 
 		[MonoTODO]
-		protected virtual void OnDragOver(DragEventArgs de)
+		protected virtual void OnDragOver (DragEventArgs de)
 		{
 			throw new NotImplementedException ();
 		}
@@ -222,10 +224,15 @@ namespace System.Windows.Forms.Design {
 			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
 		public override void Initialize (IComponent component)
 		{
-			throw new NotImplementedException ();
+			if (component == null)
+				throw new ArgumentNullException ("component");
+
+			designed_control = component as Control;
+			
+			if (designed_control == null)
+				throw new ArgumentException ("component", "Must derive from Control class");
 		}
 
 		[MonoTODO]
@@ -241,12 +248,8 @@ namespace System.Windows.Forms.Design {
 		}
 
 		[MonoTODO]
-		public override ICollection AssociatedComponents
-		{
-			get
-			{
-				throw new NotImplementedException ();
-			}
+		public override ICollection AssociatedComponents {
+			get { throw new NotImplementedException (); }
 		}
 
 		#endregion Override implementation of ComponentDesigner
@@ -264,21 +267,12 @@ namespace System.Windows.Forms.Design {
 		}
 
 		[MonoTODO]
-		public virtual SelectionRules SelectionRules 
-		{
-			get
-			{
-				throw new NotImplementedException ();
-			}
+		public virtual SelectionRules SelectionRules {
+			get { throw new NotImplementedException (); }
 		}
 
-		[MonoTODO]
-		public virtual Control Control
-		{
-			get
-			{
-				throw new NotImplementedException ();
-			}
+		public virtual Control Control {
+			get { return designed_control; }
 		}
 
 		#endregion Public Instance Properties
@@ -286,12 +280,8 @@ namespace System.Windows.Forms.Design {
 		#region Protected Instance Properties
 
 		[MonoTODO]
-		protected virtual bool EnableDragRect
-		{
-			get
-			{
-				throw new NotImplementedException ();
-			}
+		protected virtual bool EnableDragRect {
+			get { throw new NotImplementedException (); }
 		}
 
 		#endregion Protected Instance Properties
@@ -303,6 +293,12 @@ namespace System.Windows.Forms.Design {
 
 		#endregion Protected Static Fields
 
+		#region Private Instance Fields
+
+		Control designed_control;
+
+		#endregion Private Instance Fields
+
 		[ComVisibleAttribute(true)]
 		public class ControlDesignerAccessibleObject : AccessibleObject
 		{
@@ -345,75 +341,43 @@ namespace System.Windows.Forms.Design {
 			}
 
 			[MonoTODO]
-			public override Rectangle Bounds 
-			{ 
-				get
-				{
-					throw new NotImplementedException ();
-				}
+			public override Rectangle Bounds { 
+				get { throw new NotImplementedException (); }
 			}
 
 			[MonoTODO]
-			public override string DefaultAction
-			{
-				get
-				{
-					throw new NotImplementedException ();
-				}
+			public override string DefaultAction {
+				get { throw new NotImplementedException (); }
 			}
 
 			[MonoTODO]
-			public override string Description
-			{
-				get
-				{
-					throw new NotImplementedException ();
-				}
+			public override string Description {
+				get { throw new NotImplementedException (); }
 			}
 
 			[MonoTODO]
-			public override string Name
-			{
-				get
-				{
-					throw new NotImplementedException ();
-				}
+			public override string Name {
+				get { throw new NotImplementedException (); }
 			}
 
 			[MonoTODO]
-			public override AccessibleObject Parent
-			{
-				get
-				{
-					throw new NotImplementedException ();
-				}
+			public override AccessibleObject Parent {
+				get { throw new NotImplementedException (); }
 			}
 
 			[MonoTODO]
-			public override AccessibleRole Role
-			{
-				get
-				{
-					throw new NotImplementedException ();
-				}
+			public override AccessibleRole Role {
+				get { throw new NotImplementedException (); }
 			}
 
 			[MonoTODO]
-			public override AccessibleStates State
-			{
-				get
-				{
-					throw new NotImplementedException ();
-				}
+			public override AccessibleStates State {
+				get { throw new NotImplementedException (); }
 			}
 
 			[MonoTODO]
-			public override string Value
-			{
-				get
-				{
-					throw new NotImplementedException ();
-				}
+			public override string Value {
+				get { throw new NotImplementedException (); }
 			}
 
 			#endregion Override implementation of AccessibleObject