Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,178 @@
//
// System.Windows.Forms.Design.AnchorEditor.cs
//
//
// For creating type editors see the *great* tutorial:
// "Walkthrough: implement a UI Type Editor"
//
// Author:
// Dennis Hayes
// Miguel de Icaza (miguel@novell.com)
// (C) 2006 Novell, Inc. http://www.ximian.com
//
//
// 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.
//
using System;
using System.Drawing;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms;
namespace System.Windows.Forms.Design
{
public sealed class AnchorEditor : UITypeEditor
{
#region Public Instance Constructors
public AnchorEditor()
{
}
#endregion Public Instance Constructors
#region Override implementation of UITypeEditor
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value)
{
IWindowsFormsEditorService editor_service = null;
if (provider != null){
editor_service = provider.GetService (typeof (IWindowsFormsEditorService))
as IWindowsFormsEditorService;
}
if (editor_service != null){
AnchorSelector anchor_selector = new AnchorSelector (editor_service, (AnchorStyles) value);
editor_service.DropDownControl (anchor_selector);
value = anchor_selector.AnchorStyles;
}
return value;
}
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
#endregion Override implementation of UITypeEditor
}
internal class AnchorSelector : UserControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.SuspendLayout();
this.Name = "AnchorSelector";
this.Size = new System.Drawing.Size (150, 120);
this.ResumeLayout(false);
}
public AnchorStyles AnchorStyles {
get {
return styles;
}
}
AnchorStyles styles;
public AnchorSelector (IWindowsFormsEditorService editor_service, AnchorStyles startup)
{
styles = startup;
InitializeComponent();
BackColor = Color.White;
}
void PaintState(Graphics g, int x1, int y1, int x2, int y2, AnchorStyles v)
{
if ((styles & v) != 0)
g.DrawLine(SystemPens.MenuText, x1, y1, x2, y2);
else {
int xf = (x1 == x2) ? 10 : 0;
int yf = (y1 == y2) ? 10 : 0;
g.DrawBezier(SystemPens.MenuText,
new Point(x1, y1),
new Point((x1+x2)/2+xf, (y1+y2)/2-yf),
new Point((x1+x2)/2-xf, (y1+y2)/2+yf),
new Point(x2, y2));
}
}
protected override void OnPaint (PaintEventArgs e)
{
Graphics g = e.Graphics;
int w3 = Width / 3;
int h3 = Height / 3;
int w2 = Width/2;
int h2 = Height/2;
g.FillRectangle(Brushes.Black, new Rectangle(w3, h3, w3, h3));
PaintState (g, 0, h2, w3, h2, AnchorStyles.Left);
PaintState (g, w3 * 2, h2, Width, h2, AnchorStyles.Right);
PaintState (g, w2, 0, w2, h3, AnchorStyles.Top);
PaintState (g, w2, h3 * 2, w2, Height, AnchorStyles.Bottom);
}
protected override void OnClick (EventArgs ee)
{
Point e = PointToClient (MousePosition);
int w3 = Width / 3;
int h3 = Height / 3;
if (e.X <= w3 && e.Y > h3 && e.Y < h3 * 2)
styles = styles ^ AnchorStyles.Left;
else if (e.Y < h3 && e.X > w3 && e.X < w3 * 2)
styles = styles ^ AnchorStyles.Top;
else if (e.X > w3 * 2 && e.Y > h3 && e.Y < h3 * 2)
styles = styles ^ AnchorStyles.Right;
else if (e.Y > h3 * 2 && e.X > w3 && e.X < w3 * 2)
styles = styles ^ AnchorStyles.Bottom;
else
base.OnClick(ee);
Invalidate();
}
protected override void OnDoubleClick (EventArgs ee)
{
OnClick (ee);
}
}
}

View File

@@ -0,0 +1,174 @@
//
// System.Windows.Forms.Design.AxImporter.cs
//
// Author:
// Dennis Hayes (dennish@raytek.com)
// (C) 2002 Ximian, Inc. http://www.ximian.com
//
//
// 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.
//
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
namespace System.Windows.Forms.Design
{
[MonoTODO]
public class AxImporter
{
#region Public Instance Constructors
[MonoTODO]
public AxImporter (AxImporter.Options options)
{
this.options = options;
}
#endregion Public Instance Constructors
#region Public Instance Properties
[MonoTODO]
public string[] GeneratedAssemblies
{
get
{
throw new NotImplementedException ();
}
}
[MonoTODO]
public string[] GeneratedSources
{
get
{
throw new NotImplementedException ();
}
}
#endregion Public Instance Properties
#region Public Instance Methods
[MonoTODO]
public TYPELIBATTR[] GeneratedTypeLibAttributes
{
get
{
throw new NotImplementedException ();
}
}
[MonoTODO]
public string GenerateFromFile (FileInfo file)
{
throw new NotImplementedException ();
}
[MonoTODO]
public string GenerateFromTypeLibrary (UCOMITypeLib typeLib)
{
throw new NotImplementedException ();
}
[MonoTODO]
public string GenerateFromTypeLibrary (UCOMITypeLib typeLib, Guid clsid)
{
throw new NotImplementedException ();
}
#endregion Public Instance Methods
#region Public Static Methods
[MonoTODO]
public static string GetFileOfTypeLib (ref TYPELIBATTR tlibattr)
{
throw new NotImplementedException ();
}
#endregion Public Static Methods
#region Internal Instance Fields
internal AxImporter.Options options;
#endregion Internal Instance Fields
public sealed class Options
{
#region Public Instance Constructors
public Options ()
{
}
#endregion Public Instance Constructors
#region Public Instance Fields
[MonoTODO]
public bool delaySign;
[MonoTODO]
public bool genSources;
[MonoTODO]
public string keyContainer;
[MonoTODO]
public string keyFile;
[MonoTODO]
public StrongNameKeyPair keyPair;
[MonoTODO]
public bool noLogo;
[MonoTODO]
public string outputDirectory;
[MonoTODO]
public string outputName;
[MonoTODO]
public bool overwriteRCW;
[MonoTODO]
public byte[] publicKey;
[MonoTODO]
public AxImporter.IReferenceResolver references;
[MonoTODO]
public bool silentMode;
[MonoTODO]
public bool verboseMode;
#if NET_2_0
[MonoTODO]
public bool msBuildErrors;
#endif
#endregion Public Instance Fields
}
public interface IReferenceResolver
{
string ResolveActiveXReference (UCOMITypeLib typeLib);
string ResolveComReference (AssemblyName name);
string ResolveComReference (UCOMITypeLib typeLib);
string ResolveManagedReference (string assemName);
}
}
}

View File

@@ -0,0 +1,139 @@
//
// System.Windows.Forms.Design.AxParameterData.cs
//
// Author:
// Gert Driesen (drieseng@users.sourceforge.net)
//
// (C) 2004 Novell
//
//
// 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.
//
using System.CodeDom;
using System.Reflection;
namespace System.Windows.Forms.Design
{
public class AxParameterData
{
[MonoTODO]
public AxParameterData (ParameterInfo info) : this (info, false)
{
}
[MonoTODO]
public AxParameterData (ParameterInfo info, bool ignoreByRefs)
{
throw new NotImplementedException ();
}
[MonoTODO]
public AxParameterData (string inname, string typeName)
{
throw new NotImplementedException ();
}
[MonoTODO]
public AxParameterData (string inname, Type type)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static AxParameterData[] Convert (ParameterInfo[] infos)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static AxParameterData[] Convert (ParameterInfo[] infos, bool ignoreByRefs)
{
throw new NotImplementedException ();
}
public FieldDirection Direction {
get {
if (this.IsOut)
return FieldDirection.Out;
if (this.IsByRef)
return FieldDirection.Ref;
return FieldDirection.In;
}
}
public bool IsByRef {
get {
return isByRef;
}
}
public bool IsIn {
get {
return isIn;
}
}
public bool IsOptional {
get {
return isOptional;
}
}
public bool IsOut {
get {
return isOut;
}
}
public string Name {
get {
return name;
}
[MonoTODO]
set {
throw new NotImplementedException ();
}
}
public Type ParameterType {
get {
return type;
}
}
[MonoTODO]
public string TypeName {
get {
throw new NotImplementedException ();
}
}
private bool isByRef;
private bool isIn;
private bool isOptional;
private bool isOut;
private string name;
private Type type;
private string typeName;
}
}

View File

@@ -0,0 +1,46 @@
//
// System.Windows.Forms.Design.AxWrapperGen.cs
//
// Author:
// Gert Driesen (drieseng@users.sourceforge.net)
//
// (C) 2004 Novell
//
//
// 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.
//
using System.Collections;
namespace System.Windows.Forms.Design
{
public class AxWrapperGen
{
[MonoTODO]
public AxWrapperGen (Type axType)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ArrayList GeneratedSources = new ArrayList ();
}
}

View File

@@ -0,0 +1,62 @@
//
// System.Windows.Forms.Design.BorderSidesEditor.cs
//
// Author:
// Atsushi Enomoto (atsushi@ximian.com)
//
// 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;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing.Design;
using System.Security.Permissions;
namespace System.Windows.Forms.Design
{
[SecurityPermission (SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public class BorderSidesEditor : UITypeEditor
{
public BorderSidesEditor ()
{
}
[MonoTODO]
public override object EditValue (ITypeDescriptorContext context, IServiceProvider provider, object value)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override UITypeEditorEditStyle GetEditStyle (ITypeDescriptorContext context)
{
throw new NotImplementedException ();
}
}
}
#endif

View File

@@ -0,0 +1,260 @@
2009-09-10 Ivan N. Zlatev <contact@i-nz.net>
* DocumentDesigner.cs: Changing the ISelectionService at run time was a
bad idea, so wrap it inside the extended UISelectionService instead.
2009-09-10 Ivan N. Zlatev <contact@i-nz.net>
* DocumentDesigner.cs: If there is already a ISelectionService registered
in the ServiceContainer but it's not an IUISelectionService (WinForms
specific) then replace it with one.
[Fixes bug #538037]
2009-09-09 Ivan N. Zlatev <contact@i-nz.net>
* ParentControlDesigner.cs, ControlDesigner.cs, UISelectionService.cs,
IUISelectionService.cs: Support IToolboxService control creation via
point-(resize)-click.
[Fixes part of bug #537604]
2008-10-15 Ivan N. Zlatev <contact@i-nz.net>
* StringCollectionEditor.cs: Minor fixes.
Patch by Andy Hume.
2008-09-01 Ivan N. Zlatev <contact@i-nz.net>
* ParentControlDesigner.cs: Be nice with Components that are no
Controls in CreateToolCore.
2008-05-30 Ivan N. Zlatev <contact@i-nz.net>
* ControlBindingsConverter.cs: Fix 1.1 build.
2008-05-30 Ivan N. Zlatev <contact@i-nz.net>
* ControlBindingsConverter.cs: Implementated just enough to avoid
the circular dependency in the MWF PropertyGrid.
2008-05-12 Ivan N. Zlatev <contact@i-nz.net>
* StringCollectionEditor.cs: Handle String.Empty as a valid
edited value.
2008-03-01 Ivan N. Zlatev <contact@i-nz.net>
* ControlDesigner.cs: Ignore the first WM_MOUSEMOVE after
WM_MOUSEDOWN as it is sent just after it.
* ParentControlDesigner.cs: Monitor Component Remove events
and fire ComponentChanging/ed events for the Parent of the removed
Control. Helps the UndoEngine to serialize parent changes.
* ControlDesigner.cs: Set the Control.Text to be the component name.
* FormDocumentDesigner.cs: Added.
* PanelDesigner.cs: Added.
* UISelectionService.cs: Set Parent through the TypeDescriptor, so
that component change notifications get fired.
* DefaultMenuCommands.cs: Implement Cut, Copy, Paste
* DocumentDesigner:
- Drop Form specific code.
- Add menu commands.
2008-02-29 Ivan N. Zlatev <contact@i-nz.net>
* StringCollectionEditor.cs:
- Split the lines not based on Environment.NewLine as this is
not what is used by MWF on Windows.
- Ignore last empty line.
[Fixes bug #365948]
2008-02-11 Ivan N. Zlatev <contact@i-nz.net>
* AnchorEditor.cs: More sensible default width.
2008-01-24 Ivan N. Zlatev <contact@i-nz.net>
* DockEditor.cs: ITypeDescriptorContext.Instance doesn't
contain the current value. It could contain the owner.
Use the initial value parameter.
2008-01-04 Ivan N. Zlatev <contact@i-nz.net>
* ParentControlDesigner.cs: Create a Transaction when adding a
component.
2007-10-09 Atsushi Enomoto <atsushi@ximian.com>
* BorderSidesEditor.cs, DesignerOptions.cs,
ImageListCodeDomSerializer.cs, ImageListImageEditor.cs,
MaskDescriptor.cs, ShortcutKeysEditor.cs,
WindowsFormsDesignerOptionService.cs : new stubs.
* AxImporter.cs, ComponentTray.cs, ControlDesigner.cs,
DocumentDesigner.cs, MenuCommands.cs, ParentControlDesigner.cs:
2.0 updates.
2007-10-02 Atsushi Enomoto <atsushi@ximian.com>
* ControlDesigner.cs : added BehaviorService.
2007-09-15 Ivan N. Zlatev <contact@i-nz.net>
* ParentControlDesigner.cs: Binary compatibility fixes.
* SplitContainerDesigner.cs: Binary compatibility fixes.
* DocumentDesigner.cs: Binary compatibility fixes.
* ControlDataObject.cs: Binary compatibility fixes.
* ControlDesigner.cs: Binary compatibility fixes.
2007-08-29 Ivan N. Zlatev <contact@i-nz.net>
* CodeDomComponentSerializationService.cs: implemented.
* CollectionCodeDomSerializer.cs: implemented.
* CodeDomDesignerLoader.cs: implemented.
* CodeDomSerializationProvider.cs: implemented.
* ComponentCodeDomSerializer.cs: implemented.
* RootContext.cs: implemented.
* BasicDesignerLoader.cs: implemented.
* DesignerSerializationManager.cs: implemented.
* EnumCodeDomSerializer.cs: implemented.
* SerializeAbsoluteContext.cs: implemented.
* MemberCodeDomSerializer.cs: implemented.
* PrimitiveCodeDomSerializer.cs: implemented.
* CodeDomSerializerBase.cs: implemented.
* CodeDomSerializer.cs: implemented.
* ExpressionContext.cs: implemented.
* EventCodeDomSerializer.cs: implemented.
* TypeCodeDomSerializer.cs: implemented.
* ObjectStatementCollection.cs: implemented.
* RootCodeDomSerializer.cs: implemented.
* PropertyCodeDomSerializer.cs: implemented.
* StatementContext.cs: implemented.
2007-08-27 Ivan N. Zlatev <contact@i-nz.net>
* DataMemberFieldEditor.cs: stubbed.
* DataMemberListEditor.cs: stubbed.
* FormatStringEditor.cs: stubbed.
* StringCollectionEditor.cs: implemented.
* StringArrayEditor.cs: implemented.
* TabPageCollectionEditor.cs: implemented.
* ListControlStringCollectionEditor.cs: implemented.
2007-08-15 Ivan N. Zlatev <contact@i-nz.net>
* ImageIndexEditor.cs: empty class to prevent propertygrid crash.
2006-12-28 Raja R Harinath <harinath@gmail.com>
* ControlDesigner.cs: Merge with Miguel's version.
2006-12-19 Chris Toshok <toshok@ximian.com>
* DataMemberFieldConverter.cs: another empty stub class.
* DataSourceConverter.cs: new empty stub class to keep
ControlInspector from crashing.
2006-12-06 Chris Toshok <toshok@ximian.com>
* ImageCollectionEditor.cs: new file, stubbed just to get it so we
can make an ImageList the selected object in a propertygrid.
2005-06-29 Jonathan Chambers <jonathan.chambers@ansys.com>
* ControlBindingsConverter.cs: Fix namespace
2006-04-28 Peter Dennis Bartok <pbartok@novell.com>
* ControlBindingsConverter.cs: Added
2006-04-25 Miguel de Icaza <miguel@novell.com>
* 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 <jonathan.chambers@ansys.com>
* DockEditor.cs: Use context information
2005-06-18 Jonathan Chambers <jonathan.chambers@ansys.com>
* DockEditor.cs: Implemented class
2004-06-11 Gert Driesen <drieseng@users.sourceforge.net>
* ComponentEditorForm.cs: CRLF to LF
* ControlDesigner.cs: API signature fix
* DocumentDesigner.cs: API signature fixes, CRLF to LF
2004-06-11 Gert Driesen <drieseng@users.sourceforge.net>
* AxParameterData.cs: stubbed
* AxWrapperGen.cs: stubbed
* DockEditor.cs: stubbed
* EventHandlerService.cs: stubbed
2004-05-16 Gert Driesen (drieseng@users.sourceforge.net)
* IMenuEditorService.cs: fixed signature
2004-05-16 Gert Driesen (drieseng@users.sourceforge.net)
* DocumentDesigner.cs: stubbed
* ParentControlDesigner.cs: stubbed
* ScrollableControlDesigner.cs: stubbed
2004-05-16 Gert Driesen (drieseng@users.sourceforge.net)
* ControlDesigner.cs: stubbed
2004-05-16 Gert Driesen (drieseng@users.sourceforge.net)
* ISelectionUIHandler.cs: converted linefeeds to unix
2004-05-16 Gert Driesen (drieseng@users.sourceforge.net)
* ISelectionUIHandler.cs: added
* ComponentTray.cs: stubbed
2004-05-15 Gert Driesen (drieseng@users.sourceforge.net)
* AnchorEditor.cs: fixed public API, line endings to LF
* AxImporter.cs: fixed public API, line endings to LF
* ComponentDocumentDesigner.cs: fixed public API, line endings
to CRLF
* SelectionRules.cs: implementation
2004-05-15 Gert Driesen (drieseng@users.sourceforge.net)
* FileNameEditor.cs: code formatting
* FolderNameEditor.cs: code formatting
* MenuCommands.cs: code formatting
2004-05-15 Gert Driesen (drieseng@users.sourceforge.net)
* MenuCommands.cs: added impl
* MenusCommands.cs: removed, wrong name
2004-05-15 Gert Driesen (drieseng@users.sourceforge.net)
* FolderNameEditor.cs: converted to unix linefeeds, marked
class TODO, added Flags, attribute to FolderBrowserStyles enum
* FileNameEditor.cs: completed stubs
2004-05-15 Gert Driesen (drieseng@users.sourceforge.net)
* FolderNameEditor.cs: added stub
2003-07-07 Martin Willemoes Hansen <mwh@sysrq.dk>
* AnchorEditor.cs
AxImporter.cs
ComponentDocumentDesigner.cs
ComponentTray.cs
ControlDesigner.cs
DocumentDesigner.cs
FileNameEditor.cs
IMenuEditorService.cs
MenusCommands.cs
ParentControlDesigner.cs
ScrollableControlDesigner.cs
SelectionRules.cs: Moved here from System.Windows.Forms assembly

View File

@@ -0,0 +1,215 @@
//
// System.Windows.Forms.Design.ComponentDocumentDesigner.cs
//
// Author:
// Dennis Hayes (dennish@raytek.com)
// (C) 2002 Ximian, Inc. http://www.ximian.com
//
//
// 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.
//
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing.Design;
using System.Windows.Forms;
namespace System.Windows.Forms.Design
{
public class ComponentDocumentDesigner : ComponentDesigner, IRootDesigner, IToolboxUser, ITypeDescriptorFilterService, IOleDragClient
{
#region Public Instance Constructors
[MonoTODO]
public ComponentDocumentDesigner ()
{
}
#endregion Public Instance Constructors
#region Implementation of IRootDesigner
ViewTechnology[] IRootDesigner.SupportedTechnologies
{
get
{
ViewTechnology[] array1 = new ViewTechnology[1];
array1[0] = ViewTechnology.WindowsForms;
return array1;
}
}
[MonoTODO]
object IRootDesigner.GetView (ViewTechnology technology)
{
throw new NotImplementedException ();
}
#endregion Implementation of IRootDesigner
#region Implementation of IToolboxUser
bool IToolboxUser.GetToolSupported (ToolboxItem tool)
{
return true;
}
[MonoTODO]
void IToolboxUser.ToolPicked (ToolboxItem tool)
{
throw new NotImplementedException ();
}
#endregion Implementation of IToolboxUser
#region Implementation of ITypeDescriptorFilterService
[MonoTODO]
bool ITypeDescriptorFilterService.FilterAttributes (IComponent component, IDictionary attributes)
{
throw new NotImplementedException ();
}
[MonoTODO]
bool ITypeDescriptorFilterService.FilterEvents (IComponent component, IDictionary events)
{
throw new NotImplementedException ();
}
[MonoTODO]
bool ITypeDescriptorFilterService.FilterProperties (IComponent component, IDictionary properties)
{
throw new NotImplementedException ();
}
#endregion Implementation of ITypeDescriptorFilterService
#region Implementation of IOleDragClient
[MonoTODO]
bool IOleDragClient.AddComponent (IComponent component, string name, bool firstAdd)
{
throw new NotImplementedException ();
}
bool IOleDragClient.CanModifyComponents
{
get
{
return true;
}
}
[MonoTODO]
Control IOleDragClient.GetControlForComponent (object component)
{
throw new NotImplementedException ();
}
[MonoTODO]
Control IOleDragClient.GetDesignerControl ()
{
throw new NotImplementedException ();
}
[MonoTODO]
bool IOleDragClient.IsDropOk (IComponent component)
{
return true;
}
[MonoTODO]
IComponent IOleDragClient.Component
{
get
{
throw new NotImplementedException ();
}
}
#endregion Implementation of IOleDragClient
#region Public Instance Properties
[MonoTODO]
public Control Control
{
get
{
throw new NotImplementedException ();
}
}
public bool TrayAutoArrange
{
get
{
throw new NotImplementedException ();
}
set
{
throw new NotImplementedException ();
}
}
public bool TrayLargeIcon
{
get
{
throw new NotImplementedException ();
}
set
{
throw new NotImplementedException ();
}
}
#endregion Public Instance Properties
[MonoTODO]
public override void Initialize (IComponent component)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override void Dispose (bool disposing)
{
throw new NotImplementedException ();
}
protected virtual bool GetToolSupported (ToolboxItem tool)
{
return true;
}
#region Override implementation of ComponentDesigner
[MonoTODO]
protected override void PreFilterProperties (IDictionary properties)
{
throw new NotImplementedException ();
}
#endregion Override implementation of ComponentDesigner
}
}

View File

@@ -0,0 +1,256 @@
//
// System.Windows.Forms.Design.ComponentTray
//
// Authors:
// Ivan N. Zlatev (contact i-nZ.net)
//
// (C) 2006-2007 Ivan N. Zlatev
//
// 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.
//
// STUBS ONLY!!!
//
//
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Design;
using System.Collections;
namespace System.Windows.Forms.Design
{
[DesignTimeVisible (false)]
[ToolboxItem (false)]
[ProvideProperty ("Location", typeof (IComponent))]
public class ComponentTray : ScrollableControl, IExtenderProvider
{
private IServiceProvider _serviceProvider;
private IDesigner _mainDesigner = null;
private bool _showLargeIcons = false;
private bool _autoArrange = false;
public ComponentTray (IDesigner mainDesigner, IServiceProvider serviceProvider)
{
if (mainDesigner == null) {
throw new ArgumentNullException ("mainDesigner");
}
if (serviceProvider == null) {
throw new ArgumentNullException ("serviceProvider");
}
_mainDesigner = mainDesigner;
_serviceProvider = serviceProvider;
}
public bool AutoArrange {
get { return _autoArrange; }
set { _autoArrange = value; }
}
[MonoTODO]
public int ComponentCount {
get { return 0; }
}
public bool ShowLargeIcons {
get { return _showLargeIcons; }
set { _showLargeIcons = value; }
}
[MonoTODO]
public virtual void AddComponent (IComponent component)
{
}
protected virtual bool CanCreateComponentFromTool (ToolboxItem tool)
{
return true;
}
protected virtual bool CanDisplayComponent (IComponent component)
{
return false;
}
[MonoTODO]
public void CreateComponentFromTool (ToolboxItem tool)
{
}
[MonoTODO]
protected void DisplayError (Exception e)
{
}
protected override void Dispose (bool disposing)
{
}
#if NET_2_0
[Browsable (false)]
[Category ("Layout")]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[DesignOnly (true)]
[Localizable (false)]
#endif
[MonoTODO]
public Point GetLocation (IComponent receiver)
{
return new Point (0,0);
}
[MonoTODO]
public void SetLocation (IComponent receiver, Point location)
{
}
#if NET_2_0
[MonoTODO]
public IComponent GetNextComponent (IComponent component, bool forward)
{
throw new NotImplementedException ();
}
[Browsable (false)]
[Category ("Layout")]
[DesignOnly (true)]
[Localizable (false)]
[MonoTODO]
public Point GetTrayLocation (IComponent receiver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public bool IsTrayComponent (IComponent comp)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void SetTrayLocation (IComponent receiver, Point location)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override void OnMouseDoubleClick (MouseEventArgs e)
{
}
#else
[MonoTODO]
protected override void OnDoubleClick (EventArgs e)
{
}
#endif
[MonoTODO]
protected override void OnDragDrop (DragEventArgs de)
{
}
[MonoTODO]
protected override void OnDragEnter (DragEventArgs de)
{
}
[MonoTODO]
protected override void OnDragLeave (EventArgs e)
{
}
[MonoTODO]
protected override void OnDragOver (DragEventArgs de)
{
}
[MonoTODO]
protected override void OnGiveFeedback (GiveFeedbackEventArgs gfevent)
{
}
[MonoTODO]
protected override void OnLayout (LayoutEventArgs levent)
{
}
[MonoTODO]
protected virtual void OnLostCapture ()
{
}
[MonoTODO]
protected override void OnMouseDown (MouseEventArgs e)
{
}
[MonoTODO]
protected override void OnMouseMove (MouseEventArgs e)
{
}
[MonoTODO]
protected override void OnMouseUp (MouseEventArgs e)
{
}
[MonoTODO]
protected override void OnPaint (PaintEventArgs pe)
{
}
[MonoTODO]
protected virtual void OnSetCursor ()
{
}
[MonoTODO]
public virtual void RemoveComponent (IComponent component)
{
}
[MonoTODO]
protected override void WndProc (ref Message m)
{
base.WndProc (ref m);
}
bool IExtenderProvider.CanExtend (object component)
{
return false;
}
protected override object GetService (Type service)
{
if (_serviceProvider != null) {
return _serviceProvider.GetService (service);
}
return null;
}
}
}

View File

@@ -0,0 +1,152 @@
// 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. (http://www.novell.com)
//
// Authors:
// Peter Dennis Bartok (pbartok@novell.com)
// Ivan N. Zlatev (contact i-nz.net)
//
//
// NOT COMPLETE
using System.ComponentModel;
using System.Windows.Forms;
namespace System.Windows.Forms.Design
{
internal class ControlBindingsConverter : TypeConverter
{
public ControlBindingsConverter()
{
}
// TODO: Should create some sort of a special PropertyDescriptor and handle the data binding
//
[MonoTODO]
public override PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context,
object value, Attribute[] attributes)
{
PropertyDescriptorCollection properties = new PropertyDescriptorCollection (new PropertyDescriptor[0]);
ControlBindingsCollection collection = value as ControlBindingsCollection;
#if NET_2_0
object bindableComponent = collection.BindableComponent;
#else
object bindableComponent = collection.Control;
#endif
if (collection != null && bindableComponent != null) {
foreach (PropertyDescriptor property in
TypeDescriptor.GetProperties (bindableComponent, attributes)) {
if (((BindableAttribute) property.Attributes[typeof (BindableAttribute)]).Bindable)
properties.Add (new DataBindingPropertyDescriptor (property, attributes, true));
}
}
return properties;
}
public override bool GetPropertiesSupported (ITypeDescriptorContext context)
{
return true;
}
public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof (string))
return true;
return base.CanConvertTo (context, destinationType);
}
public override object ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture,
object value, Type destinationType)
{
if (destinationType == typeof (string))
return String.Empty;
return base.ConvertTo (context, culture, value, destinationType);
}
[MonoTODO]
private class DataBindingPropertyDescriptor : PropertyDescriptor
{
bool _readOnly;
[MonoTODO]
public DataBindingPropertyDescriptor (PropertyDescriptor property, Attribute [] attrs, bool readOnly)
: base (property.Name, attrs)
{
_readOnly = readOnly;
}
[MonoTODO]
public override object GetValue (object component)
{
// throw new NotImplementedException ();
return null;
}
[MonoTODO]
public override void SetValue (object component, object value)
{
// throw new NotImplementedException ();
}
[MonoTODO]
public override void ResetValue (object component)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override bool CanResetValue (object component)
{
// throw new NotImplementedException ();
return false;
}
public override bool ShouldSerializeValue (object component)
{
return false;
}
[MonoTODO]
public override Type PropertyType {
get {
// throw new NotImplementedException ();
return typeof (DataBindingPropertyDescriptor);
}
}
[MonoTODO]
public override TypeConverter Converter {
get {
// throw new NotImplementedException ();
return null;
}
}
public override Type ComponentType {
get { return typeof (ControlBindingsCollection); }
}
public override bool IsReadOnly {
get { return _readOnly; }
}
}
}
}

View File

@@ -0,0 +1,84 @@
//
// System.Windows.Forms.Design.ControlCodeDomSerializaer
//
// Authors:
// Ivan N. Zlatev (contact i-nZ.net)
//
// (C) 2007 Ivan N. Zlatev
//
// 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;
using System.Collections;
using System.Reflection;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.ComponentModel.Design.Serialization;
using System.CodeDom;
using System.Windows.Forms;
namespace System.Windows.Forms.Design
{
internal class ControlCodeDomSerializer : ComponentCodeDomSerializer
{
public ControlCodeDomSerializer ()
{
}
public override object Serialize (IDesignerSerializationManager manager, object value)
{
if (value == null)
throw new ArgumentNullException ("value");
if (manager == null)
throw new ArgumentNullException ("manager");
if (!(value is Control))
throw new InvalidOperationException ("value is not a Control");
object serialized = base.Serialize (manager, value);
CodeStatementCollection statements = serialized as CodeStatementCollection;
if (statements != null) { // the root control is serialized to CodeExpression
ICollection childControls = TypeDescriptor.GetProperties (value)["Controls"].GetValue (value) as ICollection;
if (childControls.Count > 0) {
CodeExpression componentRef = base.GetExpression (manager, value);
CodeStatement statement = new CodeExpressionStatement (
new CodeMethodInvokeExpression (componentRef, "SuspendLayout"));
statement.UserData["statement-order"] = "begin";
statements.Add (statement);
statement = new CodeExpressionStatement (
new CodeMethodInvokeExpression (componentRef, "ResumeLayout",
new CodeExpression[] {
new CodePrimitiveExpression (false) }));
statement.UserData["statement-order"] = "end";
statements.Add (statement);
serialized = statements;
}
}
return serialized;
}
}
}
#endif

View File

@@ -0,0 +1,51 @@
//
// System.Windows.Forms.Design.ControlCollectionCodeDomSerializaer
//
// Authors:
// Ivan N. Zlatev (contact i-nZ.net)
//
// (C) 2007 Ivan N. Zlatev
//
// 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;
using System.Collections;
using System.Reflection;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.ComponentModel.Design.Serialization;
using System.CodeDom;
using System.Windows.Forms;
namespace System.Windows.Forms.Design
{
internal class ControlCollectionCodeDomSerializaer : CollectionCodeDomSerializer
{
public ControlCollectionCodeDomSerializaer ()
{
}
}
}
#endif

View File

@@ -0,0 +1,120 @@
using System;
using System.Windows.Forms;
namespace System.Windows.Forms.Design
{
// A IDataObject that supports Control and Control[] format
//
internal class ControlDataObject : IDataObject
{
private object _data = null;
private string _format = null;
public ControlDataObject ()
{
_data = null;
_format = null;
}
public ControlDataObject (Control control)
{
SetData (control);
}
public ControlDataObject (Control[] controls)
{
SetData (controls);
}
public object GetData (Type format)
{
return this.GetData (format.ToString ());
}
public object GetData (string format)
{
return this.GetData (format, true);
}
public object GetData (string format, bool autoConvert)
{
if (format == _format) {
return _data;
}
return null;
}
public bool GetDataPresent (Type format)
{
return this.GetDataPresent (format.ToString());
}
public bool GetDataPresent (string format)
{
return this.GetDataPresent (format, true);
}
public bool GetDataPresent (string format, bool autoConvert)
{
if (format == _format) {
return true;
}
return false;
}
public string[] GetFormats ()
{
return this.GetFormats (true);
}
public string[] GetFormats (bool autoConvert)
{
string[] formats = new string[2];
formats[0] = typeof (Control).ToString ();
formats[1] = typeof (Control[]).ToString ();
return formats;
}
public void SetData (object data)
{
if (data is Control)
this.SetData (typeof (Control), data);
else if (data is Control[])
this.SetData (typeof (Control[]), data);
}
public void SetData (Type format, object data)
{
this.SetData (format.ToString (), data);
}
public void SetData (string format, object data)
{
this.SetData (format, true, data);
}
public void SetData (string format, bool autoConvert, object data)
{
if (ValidateFormat (format)) {
_data = data;
_format = format;
}
}
private bool ValidateFormat (string format)
{
bool valid = false;
string[] formats = GetFormats ();
foreach (string f in formats) {
if (f == format) {
valid = true;
break;
}
}
return valid;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
//
// System.Windows.Forms.Design.DataMemberFieldConverter.cs
//
// (C) 2006 Novell, Inc. http://www.novell.com
//
//
// 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.
//
using System;
using System.ComponentModel;
namespace System.Windows.Forms.Design {
// XXX this is just a stub class to keep things from crashing when a property grid is used on a control.
internal class DataMemberFieldConverter : TypeConverter {
}
}

View File

@@ -0,0 +1,47 @@
//
// System.Windows.Forms.Design.DataMemberFieldEditor
//
// Author:
// Ivan N. Zlatev <contact@i-nz.net>
//
// (C) 2007 Ivan N. Zlatev
//
//
// 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.
//
using System;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace System.Windows.Forms.Design
{
[MonoTODO]
internal sealed class DataMemberFieldEditor : UITypeEditor
{
public DataMemberFieldEditor ()
{
}
}
}

View File

@@ -0,0 +1,47 @@
//
// System.Windows.Forms.Design.DataMemberListEditor
//
// Author:
// Ivan N. Zlatev <contact@i-nz.net>
//
// (C) 2007 Ivan N. Zlatev
//
//
// 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.
//
using System;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace System.Windows.Forms.Design
{
[MonoTODO]
internal sealed class DataMemberListEditor : UITypeEditor
{
public DataMemberListEditor ()
{
}
}
}

View File

@@ -0,0 +1,37 @@
//
// System.Windows.Forms.Design.DataSourceConverter.cs
//
// (C) 2006 Novell, Inc. http://www.novell.com
//
//
// 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.
//
using System;
using System.ComponentModel;
namespace System.Windows.Forms.Design {
// XXX this is just a stub class to keep things from crashing when a property grid is used on a control.
internal class DataSourceConverter : TypeConverter {
}
}

View File

@@ -0,0 +1,277 @@
//
// System.ComponentModel.Design.DefaultMenuCommands.cs
//
// Author:
// Ivan N. Zlatev <contact@i-nz.net>
//
// (C) 2008 Ivan N. Zlatev
//
//
// 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.
//
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.ComponentModel.Design.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Design;
using System.Collections;
using System.IO;
namespace System.Windows.Forms.Design
{
internal sealed class DefaultMenuCommands
{
private IServiceProvider _serviceProvider;
private const string DT_DATA_FORMAT = "DT_DATA_FORMAT";
public DefaultMenuCommands (IServiceProvider serviceProvider)
{
if (serviceProvider == null)
throw new ArgumentNullException ("serviceProvider");
_serviceProvider = serviceProvider;
}
public void AddTo (IMenuCommandService commands)
{
commands.AddCommand (new MenuCommand (Copy, StandardCommands.Copy));
commands.AddCommand (new MenuCommand (Cut, StandardCommands.Cut));
commands.AddCommand (new MenuCommand (Paste, StandardCommands.Paste));
commands.AddCommand (new MenuCommand (Delete, StandardCommands.Delete));
commands.AddCommand (new MenuCommand (SelectAll, StandardCommands.SelectAll));
}
private object _clipboard = null;
private void Copy (object sender, EventArgs args)
{
IDesignerSerializationService stateSerializer = GetService (typeof (IDesignerSerializationService)) as IDesignerSerializationService;
IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost;
ISelectionService selection = GetService (typeof (ISelectionService)) as ISelectionService;
if (host == null || stateSerializer == null || selection == null)
return;
// copy selected components and their associated components
ICollection selectedComponents = selection.GetSelectedComponents ();
ArrayList toCopy = new ArrayList ();
foreach (object component in selectedComponents) {
if (component == host.RootComponent)
continue;
toCopy.Add (component);
ComponentDesigner designer = host.GetDesigner ((IComponent)component) as ComponentDesigner;
if (designer != null && designer.AssociatedComponents != null)
toCopy.AddRange (designer.AssociatedComponents);
}
object stateData = stateSerializer.Serialize (toCopy);
_clipboard = stateData;
// Console.WriteLine ("Copied components: ");
// foreach (object c in toCopy)
// Console.WriteLine (((IComponent)c).Site.Name);
//
// TODO: MWF X11 doesn't seem to support custom clipboard formats - bug #357642
//
// MemoryStream stream = new MemoryStream ();
// new BinaryFormatter().Serialize (stream, stateData);
// stream.Seek (0, SeekOrigin.Begin);
// byte[] serializedData = stream.GetBuffer ();
// Clipboard.SetDataObject (new DataObject (DT_DATA_FORMAT, serializedData));
}
// Reminder: We set control.Parent so that it gets serialized for Undo/Redo
//
private void Paste (object sender, EventArgs args)
{
IDesignerSerializationService stateSerializer = GetService (typeof (IDesignerSerializationService)) as IDesignerSerializationService;
ISelectionService selection = GetService (typeof (ISelectionService)) as ISelectionService;
IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost;
IComponentChangeService changeService = GetService (typeof (IComponentChangeService)) as IComponentChangeService;
if (host == null || stateSerializer == null)
return;
//
// TODO: MWF X11 doesn't seem to support custom clipboard formats - bug #357642
//
// IDataObject dataObject = Clipboard.GetDataObject ();
// byte[] data = dataObject == null ? null : dataObject.GetData (DT_DATA_FORMAT) as byte[];
// if (data != null) {
// MemoryStream stream = new MemoryStream (data);
// stateSerializer.Deserialize (new BinaryFormatter().Deserialize (stream));
// .....
// }
//
if (_clipboard == null)
return;
DesignerTransaction transaction = host.CreateTransaction ("Paste");
ICollection components = stateSerializer.Deserialize (_clipboard);
// Console.WriteLine ("Pasted components: ");
// foreach (object c in components)
// Console.WriteLine (((IComponent)c).Site.Name);
foreach (object component in components) {
Control control = component as Control;
if (control == null)
continue; // pure Components are added to the ComponentTray by the DocumentDesigner
PropertyDescriptor parentProperty = TypeDescriptor.GetProperties (control)["Parent"];
if (control.Parent != null) {
// Already parented during deserialization?
// In that case explicitly raise component changing/ed for the Parent property,
// so it get's cought by the UndoEngine
if (changeService != null) {
changeService.OnComponentChanging (control, parentProperty);
changeService.OnComponentChanged (control, parentProperty, null, control.Parent);
}
} else {
ParentControlDesigner parentDesigner = null;
if (selection != null && selection.PrimarySelection != null)
parentDesigner = host.GetDesigner ((IComponent)selection.PrimarySelection) as ParentControlDesigner;
if (parentDesigner == null)
parentDesigner = host.GetDesigner (host.RootComponent) as DocumentDesigner;
if (parentDesigner != null && parentDesigner.CanParent (control))
parentProperty.SetValue (control, parentDesigner.Control);
}
}
_clipboard = null;
transaction.Commit ();
((IDisposable)transaction).Dispose ();
}
private void Cut (object sender, EventArgs args)
{
IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost;
if (host == null)
return;
using (DesignerTransaction transaction = host.CreateTransaction ("Cut")) {
Copy (this, EventArgs.Empty);
Delete (this, EventArgs.Empty);
transaction.Commit ();
}
}
private void Delete (object sender, EventArgs args)
{
IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost;
ISelectionService selection = GetService (typeof (ISelectionService)) as ISelectionService;
if (host == null || selection == null)
return;
ICollection selectedComponents = selection.GetSelectedComponents ();
string description = "Delete " +
(selectedComponents.Count > 1 ? (selectedComponents.Count.ToString () + " controls") :
((IComponent)selection.PrimarySelection).Site.Name);
DesignerTransaction transaction = host.CreateTransaction (description);
foreach (object component in selectedComponents) {
if (component != host.RootComponent) {
ComponentDesigner designer = host.GetDesigner ((IComponent)component) as ComponentDesigner;
if (designer != null && designer.AssociatedComponents != null) {
foreach (object associatedComponent in designer.AssociatedComponents)
host.DestroyComponent ((IComponent)associatedComponent);
}
host.DestroyComponent ((IComponent)component);
}
}
#if NET_2_0
selection.SetSelectedComponents (selectedComponents, SelectionTypes.Remove);
#else
selection.SetSelectedComponents (selectedComponents);
#endif
transaction.Commit ();
}
private void SelectAll (object sender, EventArgs args)
{
IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost;
ISelectionService selection = GetService (typeof (ISelectionService)) as ISelectionService;
if (host != null && selection != null)
selection.SetSelectedComponents (host.Container.Components, SelectionTypes.Replace);
}
// * StandardCommands
// o AlignBottom
// o AlignHorizontalCenters
// o AlignLeft
// o AlignRight
// o AlignToGrid
// o AlignTop
// o AlignVerticalCenters
// o BringToFront
// o CenterHorizontally
// o CenterVertically
// -o Copy
// -o Cut
// -o Delete
// o HorizSpaceConcatenate
// o HorizSpaceDecrease
// o HorizSpaceIncrease
// o HorizSpaceMakeEqual
// -o Paste
// -o SelectAll
// o SendToBack
// o SizeToControl
// o SizeToControlHeight
// o SizeToControlWidth
// o SizeToGrid
// o SnapToGrid
// o TabOrder
// o VertSpaceConcatenate
// o VertSpaceDecrease
// o VertSpaceIncrease
// o VertSpaceMakeEqual
// o ShowGrid
// o LockControls
//
// * MenuCommands
// o KeyDefaultAction
// o KeySelectNext
// o KeySelectPrevious
// o KeyMoveLeft
// o KeySizeWidthDecrease
// o KeyMoveRight
// o KeySizeWidthIncrease
// o KeyMoveUp
// o KeySizeHeightIncrease
// o KeyMoveDown
// o KeySizeHeightDecrease
// o KeyCancel
// o KeyNudgeLeft
// o KeyNudgeDown
// o KeyNudgeRight
// o KeyNudgeUp
// o KeyNudgeHeightIncrease
// o KeyNudgeHeightDecrease
// o KeyNudgeWidthDecrease
// o KeyNudgeWidthIncrease
// o DesignerProperties
// o KeyReverseCancel
private object GetService (Type serviceType)
{
if (_serviceProvider != null)
return _serviceProvider.GetService (serviceType);
return null;
}
}
}

View File

@@ -0,0 +1,96 @@
//
// System.Windows.Forms.Design.DesignerOptions.cs
//
// Author:
// Atsushi Enomoto (atsushi@ximian.com)
//
// 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;
using System.ComponentModel;
using System.Drawing;
namespace System.Windows.Forms.Design
{
public class DesignerOptions
{
public DesignerOptions ()
{
}
[MonoTODO]
[Browsable (false)]
public virtual bool EnableInSituEditing {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
[MonoTODO]
public virtual Size GridSize {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
[MonoTODO]
public virtual bool ObjectBoundSmartTagAutoShow {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
[MonoTODO]
public virtual bool ShowGrid {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
[MonoTODO]
public virtual bool SnapToGrid {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
[MonoTODO]
public virtual bool UseOptimizedCodeGeneration {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
[MonoTODO]
public virtual bool UseSmartTags {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
[MonoTODO]
public virtual bool UseSnapLines {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
}
}
#endif

View File

@@ -0,0 +1,226 @@
//
// System.Windows.Forms.Design.DockEditor.cs
//
// Author:
// Gert Driesen (drieseng@users.sourceforge.net)
//
// (C) 2004-2008 Novell
//
//
// 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.
//
using System.ComponentModel;
using System.Drawing.Design;
namespace System.Windows.Forms.Design
{
public sealed class DockEditor : UITypeEditor
{
public DockEditor ()
{
}
public override object EditValue (ITypeDescriptorContext context, IServiceProvider provider, object value)
{
if (context != null && provider != null)
{
IWindowsFormsEditorService editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (editorService != null)
{
// Create the UI editor control
DockEditorControl dockEditorControl = new DockEditorControl(editorService);
dockEditorControl.DockStyle = (DockStyle) value;
editorService.DropDownControl(dockEditorControl);
return dockEditorControl.DockStyle;
}
}
return base.EditValue(context, provider, value);
}
public override UITypeEditorEditStyle GetEditStyle (ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
private class DockEditorControl : System.Windows.Forms.UserControl
{
private System.Windows.Forms.CheckBox buttonNone;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.CheckBox buttonBottom;
private System.Windows.Forms.CheckBox buttonTop;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.CheckBox buttonLeft;
private System.Windows.Forms.CheckBox buttonRight;
private System.Windows.Forms.CheckBox buttonFill;
private IWindowsFormsEditorService editorService;
private DockStyle dockStyle;
public DockEditorControl(IWindowsFormsEditorService editorService)
{
buttonNone = new System.Windows.Forms.CheckBox();
panel1 = new System.Windows.Forms.Panel();
buttonBottom = new System.Windows.Forms.CheckBox();
buttonTop = new System.Windows.Forms.CheckBox();
panel2 = new System.Windows.Forms.Panel();
buttonLeft = new System.Windows.Forms.CheckBox();
buttonRight = new System.Windows.Forms.CheckBox();
buttonFill = new System.Windows.Forms.CheckBox();
panel1.SuspendLayout();
panel2.SuspendLayout();
SuspendLayout();
buttonNone.Appearance = Appearance.Button;
buttonNone.Dock = System.Windows.Forms.DockStyle.Bottom;
buttonNone.Location = new System.Drawing.Point(0, 92);
buttonNone.Size = new System.Drawing.Size(150, 23);
buttonNone.TabIndex = 5;
buttonNone.Text = "None";
buttonNone.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
buttonNone.Click += new System.EventHandler(buttonClick);
panel1.Controls.Add(panel2);
panel1.Controls.Add(buttonTop);
panel1.Controls.Add(buttonBottom);
panel1.Dock = System.Windows.Forms.DockStyle.Fill;
panel1.Location = new System.Drawing.Point(0, 0);
panel1.Name = "panel1";
panel1.Size = new System.Drawing.Size(150, 92);
panel1.TabStop = false;
buttonBottom.Appearance = Appearance.Button;
buttonBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
buttonBottom.Location = new System.Drawing.Point(0, 69);
buttonBottom.Name = "buttonBottom";
buttonBottom.Size = new System.Drawing.Size(150, 23);
buttonBottom.TabIndex = 5;
buttonBottom.Click += new System.EventHandler(buttonClick);
buttonTop.Appearance = Appearance.Button;
buttonTop.Dock = System.Windows.Forms.DockStyle.Top;
buttonTop.Location = new System.Drawing.Point(0, 0);
buttonTop.Name = "buttonTop";
buttonTop.Size = new System.Drawing.Size(150, 23);
buttonTop.TabIndex = 1;
buttonTop.Click += new System.EventHandler(buttonClick);
panel2.Controls.Add(buttonFill);
panel2.Controls.Add(buttonRight);
panel2.Controls.Add(buttonLeft);
panel2.Dock = System.Windows.Forms.DockStyle.Fill;
panel2.Location = new System.Drawing.Point(0, 23);
panel2.Size = new System.Drawing.Size(150, 46);
panel2.TabIndex = 2;
panel2.TabStop = false;
buttonLeft.Appearance = Appearance.Button;
buttonLeft.Dock = System.Windows.Forms.DockStyle.Left;
buttonLeft.Location = new System.Drawing.Point(0, 0);
buttonLeft.Size = new System.Drawing.Size(24, 46);
buttonLeft.TabIndex = 2;
buttonLeft.Click += new System.EventHandler(buttonClick);
buttonRight.Appearance = Appearance.Button;
buttonRight.Dock = System.Windows.Forms.DockStyle.Right;
buttonRight.Location = new System.Drawing.Point(126, 0);
buttonRight.Size = new System.Drawing.Size(24, 46);
buttonRight.TabIndex = 4;
buttonRight.Click += new System.EventHandler(buttonClick);
buttonFill.Appearance = Appearance.Button;
buttonFill.Dock = System.Windows.Forms.DockStyle.Fill;
buttonFill.Location = new System.Drawing.Point(24, 0);
buttonFill.Size = new System.Drawing.Size(102, 46);
buttonFill.TabIndex = 3;
buttonFill.Click += new System.EventHandler(buttonClick);
Controls.Add(panel1);
Controls.Add(buttonNone);
Size = new System.Drawing.Size(150, 115);
panel1.ResumeLayout(false);
panel2.ResumeLayout(false);
ResumeLayout(false);
this.editorService = editorService;
dockStyle = DockStyle.None;
}
private void buttonClick(object sender, System.EventArgs e)
{
if (sender == buttonNone)
dockStyle = DockStyle.None;
else if (sender == buttonFill)
dockStyle = DockStyle.Fill;
else if (sender == buttonLeft)
dockStyle = DockStyle.Left;
else if (sender == buttonRight)
dockStyle = DockStyle.Right;
else if (sender == buttonTop)
dockStyle = DockStyle.Top;
else if (sender == buttonBottom)
dockStyle = DockStyle.Bottom;
editorService.CloseDropDown();
}
public DockStyle DockStyle
{
get
{
return dockStyle;
}
set
{
dockStyle = value;
buttonNone.Checked = false;
buttonBottom.Checked = false;
buttonTop.Checked = false;
buttonLeft.Checked = false;
buttonRight.Checked = false;
buttonFill.Checked = false;
switch (DockStyle)
{
case DockStyle.Fill:
buttonFill.CheckState = CheckState.Checked;
break;
case DockStyle.None:
buttonNone.CheckState = CheckState.Checked;
break;
case DockStyle.Left:
buttonLeft.CheckState = CheckState.Checked;
break;
case DockStyle.Right:
buttonRight.CheckState = CheckState.Checked;
break;
case DockStyle.Top:
buttonTop.CheckState = CheckState.Checked;
break;
case DockStyle.Bottom:
buttonBottom.CheckState = CheckState.Checked;
break;
}
}
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More