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,60 @@
//
// AssemblyInfo.cs
//
// Author:
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 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.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Diagnostics;
// General Information about the System.Drawing.Design assembly
[assembly: AssemblyTitle ("System.Drawing.Design.dll")]
[assembly: AssemblyDescription ("System.Drawing.Design.dll")]
[assembly: AssemblyDefaultAlias ("System.Drawing.Design.dll")]
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: SatelliteContractVersion (Consts.FxVersion)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComVisible (false)]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]

View File

@@ -0,0 +1,14 @@
2008-04-23 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* AssemblyInfo.cs: New format, fix attribute
2008-04-09 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* AssemblyInfo.cs: Added missing 2.0 attributes
2003-07-21 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* AssemblyInfo.cs: Added
* ChangeLog: Added
* Locale.cs: Added
* TODOAttribute.cs: Added

View File

@@ -0,0 +1,19 @@
2007-05-30 Sebastien Pouliot <sebastien@ximian.com>
* System.Drawing.Design.dll.sources: Add Toolbox* 2.0 classes.
2003-07-21 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* System.Drawing.Design.dll.sources: Added AssemblyInfo.cs, Locale.cs, TODOAttribute.cs
2003-06-17 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* Added System.Windows.Forms to makefile.gnu
2003-04-07 Martin Willemoes Hansen <mwh@sysrq.dk>
* Stubed rest of System.Drawing.Design
2003-03-31 Martin Willemoes Hansen <mwh@sysrq.dk>
* Initialized this assembly and made stubs for System.Drawing.Design

View File

@@ -0,0 +1,9 @@
thisdir = class/System.Drawing.Design
SUBDIRS =
include ../../build/rules.make
LIBRARY = System.Drawing.Design.dll
LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll /r:System.Drawing.dll /r:System.Windows.Forms.dll
NO_TEST = yes
include ../../build/library.make

View File

@@ -0,0 +1,16 @@
Assembly/AssemblyInfo.cs
../../build/common/Consts.cs
../../build/common/Locale.cs
../../build/common/MonoTODOAttribute.cs
System.Drawing.Design/BitmapEditor.cs
System.Drawing.Design/ColorEditor.cs
System.Drawing.Design/ContentAlignmentEditor.cs
System.Drawing.Design/CursorEditor.cs
System.Drawing.Design/FontEditor.cs
System.Drawing.Design/FontNameEditor.cs
System.Drawing.Design/IconEditor.cs
System.Drawing.Design/ImageEditor.cs
System.Drawing.Design/MetafileEditor.cs
System.Drawing.Design/ToolboxItemCreator.cs
System.Drawing.Design/ToolboxItemContainer.cs
System.Drawing.Design/ToolboxService.cs

View File

@@ -0,0 +1,61 @@
//
// System.Drawing.Design.BitmapEditor.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Martin Willemoes Hansen
// (C) 2003 Andreas Nahr
//
//
// 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.Drawing;
namespace System.Drawing.Design
{
public class BitmapEditor : ImageEditor
{
public BitmapEditor()
{
}
protected override string[] GetExtensions()
{
return new string[] {"*.bmp", "*.gif", "*.jpg", "*.jpeg", "*.png", "*.ico"};
}
protected override string GetFileDialogDescription()
{
return Locale.GetText ("All bitmap files");
}
protected override Image LoadFromStream (Stream stream)
{
return new Bitmap (stream);
}
}
}

View File

@@ -0,0 +1,112 @@
2008-06-03 Ivan N. Zlatev <contact@i-nz.net>
* FontNameEditor.cs: PaintEventArgs.Value is string containing
the font name and not a Font.
Based on a patch by Andy Hume <andyhume32@yahoo.co.uk>
[Fixes bug #396631]
2008-04-01 Ivan N. Zlatev <contact@i-nz.net>
* ColorEditor.cs: Cache the editor contorl instead of creating
it each time.
2008-02-08 Ivan N. Zlatev <contact@i-nz.net>
* ColorEditor.cs: Fix Height to include the last 8th row.
2008-02-05 Ivan N. Zlatev <contact@i-nz.net>
* ColorEditor.cs: Set the Height to match the custom colors tab
Height.
[Fixes bug #356527]
2008-02-04 Ivan N. Zlatev <contact@i-nz.net>
* ColorEditor.cs: Perfom action in OnMouseUp only if in client.
[Fixes bug #358444]
2007-11-13 Atsushi Enomoto <atsushi@ximian.com>
* ToolboxItemCreator.cs, ToolboxService.cs, ToolboxItemContainer.cs:
couple of 2.0 API fixes.
2007-05-30 Sebastien Pouliot <sebastien@ximian.com>
* CursorEditor.cs: Add new (2.0) IsDropDownResizable property.
* ImageEditor.cs: Add new (2.0) GetImageExtenders method.
* ToolboxItemContainer.cs: New. Stub to reduce MoMA missing report.
* ToolboxItemCreator.cs: New. Stub to reduce MoMA missing report.
* ToolboxService.cs: New. Stub to reduce MoMA missing report.
2006-10-25 Chris Toshok <toshok@ximian.com>
* IconEditor.cs: the value we're painting isn't an Image, it's an
Icon. use Icon.ToBitmap to get something we can actually draw.
2006-10-13 Chris Toshok <toshok@ximian.com>
* ColorEditor.cs: we also need to make sure we set selected_color
and color_chosen initially.
2006-10-13 Chris Toshok <toshok@ximian.com>
* ColorEditor.cs: windows allows a null to be passed in to
EditValue (indeed, the property grid when showing a merged view
requires it). Also, if no change is made we need to return the
initial value (so, if you pass null in, and don't make a change,
null should be returned.
2006-07-31 Jonathan Chambers <joncham@gmail.com>
* ColorEditor.cs: Add custom color picker tab.
2006-04-27 Jonathan Chambers <jonathan.chambers@ansys.com>
* ColorEditor.cs: Make into a drop down editor
and begin work on editor.
2006-04-26 Alexander Olk <alex.olk@googlemail.com>
* ColorEditor.cs: Dispose the SolidBrush that fills the color
rectangle and don't draw a border which uglifys
PropertyGrid
2004-02-24 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* BitmapEditor.cs
* FontEditor.cs
* FontNameEditor.cs
* IconEditor.cs
* ImageEditor.cs
* MetafileEditor.cs
* ColorEditor.cs: beautifications
* ContentAlignmentEditor.cs
* CursorEditor.cs: Implemented a simple UI
* ColorEditor.cs: Implemented a simple UI
2003-07-23 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* IconEditor.cs: Tiny fix to improve created image
2003-07-21 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* BitmapEditor.cs
* IconEditor.cs
* ImageEditor.cs
* MetafileEditor.cs: Added localization support
* FontNameEditor.cs: Improved implementation
2003-06-17 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* BitmapEditor.cs
* FontEditor.cs
* FontNameEditor.cs
* IconEditor.cs
* ImageEditor.cs
* MetafileEditor.cs: Implemented
* ColorEditor.cs
* ContentAlignmentEditor.cs
* CursorEditor.cs: Partially implemented

View File

@@ -0,0 +1,378 @@
//
// System.Drawing.Design.ColorEditor.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
// Jonathan Chambers (joncham@gmail.com)
//
// (C) 2003 Martin Willemoes Hansen
// (C) 2003 Andreas Nahr
// (C) 2006 Jonathan Chambers
//
//
// 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.Drawing.Design;
using System.ComponentModel;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace System.Drawing.Design
{
public class ColorEditor : UITypeEditor
{
private IWindowsFormsEditorService editorService;
private Color selected_color;
private bool color_chosen;
private Control editor_control = null;
public ColorEditor()
{
}
public override object EditValue (ITypeDescriptorContext context,
IServiceProvider provider, object value)
{
if (context != null && provider != null) {
editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (editorService != null) {
if (editor_control == null)
editor_control = GetEditorControl (value);
editorService.DropDownControl(editor_control);
if (color_chosen)
return selected_color;
else
return null;
}
}
return base.EditValue(context, provider, value);
}
private Control GetEditorControl (object value)
{
TabControl tab_control = new TabControl();
tab_control.Dock = DockStyle.Fill;
TabPage custom_tab = new TabPage("Custom");
TabPage web_tab = new TabPage("Web");
TabPage system_tab = new TabPage("System");
ColorListBox web_listbox = new ColorListBox();
ColorListBox system_listbox = new ColorListBox();
web_listbox.Dock = DockStyle.Fill;
system_listbox.Dock = DockStyle.Fill;
web_tab.Controls.Add(web_listbox);
system_tab.Controls.Add(system_listbox);
SystemColorCompare system_compare = new SystemColorCompare();
System.Collections.ArrayList color_list = new System.Collections.ArrayList();
foreach (System.Reflection.PropertyInfo property in typeof(SystemColors).GetProperties(System.Reflection.BindingFlags.Public |System.Reflection.BindingFlags.Static)) {
Color clr = (Color)property.GetValue(null,null);
color_list.Add(clr);
}
color_list.Sort(system_compare);
system_listbox.Items.AddRange(color_list.ToArray());
system_listbox.MouseUp+=new MouseEventHandler(HandleMouseUp);
system_listbox.SelectedValueChanged+=new EventHandler(HandleChange);
WebColorCompare web_compare = new WebColorCompare();
color_list = new System.Collections.ArrayList();
foreach (KnownColor known_color in Enum.GetValues(typeof(KnownColor)))
{
Color color = Color.FromKnownColor(known_color);
if (color.IsSystemColor)
continue;
color_list.Add(color);
}
color_list.Sort(web_compare);
web_listbox.Items.AddRange(color_list.ToArray());
web_listbox.MouseUp+=new MouseEventHandler(HandleMouseUp);
web_listbox.SelectedValueChanged+=new EventHandler(HandleChange);
CustomColorPicker custom_picker = new CustomColorPicker ();
custom_picker.Dock = DockStyle.Fill;
custom_picker.ColorChanged += new EventHandler (CustomColorPicked);
custom_tab.Controls.Add (custom_picker);
tab_control.TabPages.Add(custom_tab);
tab_control.TabPages.Add(web_tab);
tab_control.TabPages.Add(system_tab);
if (value != null) {
Color current_color = (Color)value;
if (current_color.IsSystemColor)
{
system_listbox.SelectedValue = current_color;
tab_control.SelectedTab = system_tab;
}
else if (current_color.IsKnownColor)
{
web_listbox.SelectedValue = current_color;
tab_control.SelectedTab = web_tab;
}
selected_color = current_color;
color_chosen = true;
}
tab_control.Height = 216; // the height of the custom colors tab
return tab_control;
}
private void HandleChange(object sender, EventArgs e)
{
selected_color = (Color)((ColorListBox)sender).Items[((ColorListBox)sender).SelectedIndex];
color_chosen = true;
}
private void CustomColorPicked (object sender, EventArgs e)
{
selected_color = (Color)sender;
color_chosen = true;
if (editorService != null)
editorService.CloseDropDown ();
}
private void HandleMouseUp(object sender, MouseEventArgs e)
{
if (editorService != null)
editorService.CloseDropDown();
}
public override UITypeEditorEditStyle GetEditStyle (ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
public override bool GetPaintValueSupported (ITypeDescriptorContext context)
{
return true;
}
public override void PaintValue (PaintValueEventArgs e)
{
Graphics G = e.Graphics;
if (e.Value != null)
{
Color C = (Color) e.Value;
using (SolidBrush sb = new SolidBrush (C))
G.FillRectangle (sb, e.Bounds);
}
}
class ColorListBox : ListBox {
public ColorListBox() {
this.DrawMode = DrawMode.OwnerDrawFixed;
this.Sorted = true;
this.ItemHeight = 14;
this.BorderStyle = BorderStyle.FixedSingle;
}
protected override void OnDrawItem(DrawItemEventArgs e) {
e.DrawBackground();
Color color = (Color)this.Items[e.Index];
using (System.Drawing.SolidBrush brush = new SolidBrush(color))
e.Graphics.FillRectangle(brush, 2,e.Bounds.Top+2,21,9);
e.Graphics.DrawRectangle(SystemPens.WindowText, 2,e.Bounds.Top+2,21,9);
e.Graphics.DrawString(color.Name, this.Font, SystemBrushes.WindowText, 26,e.Bounds.Top);
if ((e.State & DrawItemState.Selected) != 0)
e.DrawFocusRectangle();
base.OnDrawItem (e);
}
}
class SystemColorCompare : System.Collections.IComparer {
#region IComparer Members
public int Compare(object x, object y) {
Color c1 = (Color)x;
Color c2 = (Color)y;
return String.Compare(c1.Name, c2.Name);
}
#endregion
}
class WebColorCompare : System.Collections.IComparer
{
#region IComparer Members
public int Compare(object x, object y)
{
Color c1 = (Color)x;
Color c2 = (Color)y;
return String.Compare(c1.Name, c2.Name);
}
#endregion
}
class CustomColorPicker : UserControl
{
Color[,] colors;
bool highlighting;
int x, y;
public CustomColorPicker ()
{
colors = new Color[8, 8];
colors[0, 0] = Color.White;
colors[1, 0] = Color.FromArgb (224, 224, 224);
colors[2, 0] = Color.Silver;
colors[3, 0] = Color.Gray;
colors[4, 0] = Color.FromArgb (64, 64, 64);
colors[5, 0] = Color.Black;
colors[6, 0] = Color.White;
colors[7, 0] = Color.White;
colors[0, 1] = Color.FromArgb (255, 192, 192);
colors[1, 1] = Color.FromArgb (255, 128, 128);
colors[2, 1] = Color.Red;
colors[3, 1] = Color.FromArgb (192, 0, 0);
colors[4, 1] = Color.Maroon;
colors[5, 1] = Color.FromArgb (64, 0, 0);
colors[6, 1] = Color.White;
colors[7, 1] = Color.White;
colors[0, 2] = Color.FromArgb (255, 224, 192);
colors[1, 2] = Color.FromArgb (255, 192, 128);
colors[2, 2] = Color.FromArgb (255, 128, 0);
colors[3, 2] = Color.FromArgb (192, 64, 0);
colors[4, 2] = Color.FromArgb (128, 64, 0);
colors[5, 2] = Color.FromArgb (128, 64, 64);
colors[6, 2] = Color.White;
colors[7, 2] = Color.White;
colors[0, 3] = Color.FromArgb (255, 255, 192);
colors[1, 3] = Color.FromArgb (255, 255, 128);
colors[2, 3] = Color.Yellow;
colors[3, 3] = Color.FromArgb (192, 192, 0);
colors[4, 3] = Color.Olive;
colors[5, 3] = Color.FromArgb (64, 64, 0);
colors[6, 3] = Color.White;
colors[7, 3] = Color.White;
colors[0, 4] = Color.FromArgb (192, 255, 192);
colors[1, 4] = Color.FromArgb (128, 255, 128);
colors[2, 4] = Color.Lime;
colors[3, 4] = Color.FromArgb (0, 192, 0);
colors[4, 4] = Color.Green;
colors[5, 4] = Color.FromArgb (0, 64, 0);
colors[6, 4] = Color.White;
colors[7, 4] = Color.White;
colors[0, 5] = Color.FromArgb (192, 255, 255);
colors[1, 5] = Color.FromArgb (128, 255, 255);
colors[2, 5] = Color.Cyan;
colors[3, 5] = Color.FromArgb (0, 192, 192);
colors[4, 5] = Color.Teal;
colors[5, 5] = Color.FromArgb (0, 64, 64);
colors[6, 5] = Color.White;
colors[7, 5] = Color.White;
colors[0, 6] = Color.FromArgb (192, 192, 255);
colors[1, 6] = Color.FromArgb (128, 128, 255);
colors[2, 6] = Color.Blue;
colors[3, 6] = Color.FromArgb (0, 0, 192);
colors[4, 6] = Color.Navy;
colors[5, 6] = Color.FromArgb (0, 0, 64);
colors[6, 6] = Color.White;
colors[7, 6] = Color.White;
colors[0, 7] = Color.FromArgb (255, 192, 255);
colors[1, 7] = Color.FromArgb (255, 128, 255);
colors[2, 7] = Color.Fuchsia;
colors[3, 7] = Color.FromArgb (192, 0, 192);
colors[4, 7] = Color.Purple;
colors[5, 7] = Color.FromArgb (64, 0, 64);
colors[6, 7] = Color.White;
colors[7, 7] = Color.White;
}
public event EventHandler ColorChanged;
protected override void OnPaint (PaintEventArgs e)
{
for (int i = 0; i < 8; i++)
for (int j = 0; j < 8; j++) {
DrawRect (e.Graphics, colors[i, j], j * 24, i * 24);
}
if (highlighting) {
int i = x / 24;
int j = y / 24;
ControlPaint.DrawFocusRectangle (e.Graphics, new Rectangle (i * 24 - 2, j * 24 - 2, 24, 24));
}
base.OnPaint (e);
}
void DrawRect (Graphics g, Color color, int x, int y)
{
using (SolidBrush brush = new SolidBrush (color))
g.FillRectangle (brush, x, y, 20, 20);
ControlPaint.DrawBorder3D (g, x, y, 20, 20);
}
protected override void OnMouseDown (MouseEventArgs e)
{
if (e.X % 24 < 20 && e.Y % 24 < 20) {
x = e.X;
y = e.Y;
highlighting = true;
Invalidate ();
}
base.OnMouseDown (e);
}
protected override void OnMouseUp (MouseEventArgs e)
{
if (highlighting && this.ClientRectangle.Contains (e.X, e.Y)) {
if (ColorChanged != null)
ColorChanged (colors[y / 24, x / 24], EventArgs.Empty);
highlighting = false;
}
base.OnMouseUp (e);
}
protected override void OnMouseMove (MouseEventArgs e)
{
if (highlighting) {
int old_x = x;
int old_y = y;
x = e.X;
y = e.Y;
if ((old_x / 24 != x / 24 || old_y / 24 != y / 24) &&
x / 24 < 8 && y / 24 < 8) {
Region r = new Region ();
r.Union (new Rectangle (old_x - 2, old_y - 2, 24, 24));
r.Union (new Rectangle (x - 2, y - 2, 24, 24));
Invalidate (r);
}
}
base.OnMouseMove (e);
}
}
}
}

View File

@@ -0,0 +1,103 @@
//
// System.Drawing.Design.ContentAlignmentEditor.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Martin Willemoes Hansen
// (C) 2003 Andreas Nahr
//
//
// 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.Windows.Forms;
using System.Windows.Forms.Design;
namespace System.Drawing.Design
{
public class ContentAlignmentEditor : UITypeEditor
{
public ContentAlignmentEditor()
{
}
// TODO: Enhance (MS.Net has a nice graphical version)
private class AlignmentUI : ListBox
{
private object value;
private IWindowsFormsEditorService service;
public AlignmentUI (UITypeEditor host, IWindowsFormsEditorService service, object value)
{
this.service = service;
this.value = value;
base.Items.Add (ContentAlignment.TopLeft);
base.Items.Add (ContentAlignment.TopCenter);
base.Items.Add (ContentAlignment.TopRight);
base.Items.Add (ContentAlignment.MiddleLeft);
base.Items.Add (ContentAlignment.MiddleCenter);
base.Items.Add (ContentAlignment.MiddleRight);
base.Items.Add (ContentAlignment.BottomLeft);
base.Items.Add (ContentAlignment.BottomCenter);
base.Items.Add (ContentAlignment.BottomRight);
}
protected override void OnClick (EventArgs e)
{
base.OnClick (e);
value = base.SelectedItem;
service.CloseDropDown();
}
public object Value {
get { return value; }
}
}
public override object EditValue (ITypeDescriptorContext context,
IServiceProvider provider, object value)
{
if (provider == null)
return value;
IWindowsFormsEditorService service =
(IWindowsFormsEditorService)provider.GetService (typeof (IWindowsFormsEditorService));
if (service == null)
return value;
AlignmentUI ui = new AlignmentUI (this, service, value);
service.DropDownControl (ui);
return ui.Value;
}
public override UITypeEditorEditStyle GetEditStyle (ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
}
}

View File

@@ -0,0 +1,100 @@
//
// System.Drawing.Design.CursorEditor.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Martin Willemoes Hansen
// (C) 2003 Andreas Nahr
// Copyright (C) 2007 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.ComponentModel;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace System.Drawing.Design
{
public class CursorEditor : UITypeEditor
{
public CursorEditor()
{
}
// TODO: Enhance (MS.Net has a version with graphical cursor preview)
private class CursorUI : ListBox
{
private object value;
private IWindowsFormsEditorService service;
public CursorUI (UITypeEditor host, IWindowsFormsEditorService service, object value)
{
this.service = service;
this.value = value;
TypeConverter conv = TypeDescriptor.GetConverter (typeof (Cursor));
foreach (object o in conv.GetStandardValues())
base.Items.Add (o);
}
protected override void OnClick (EventArgs e)
{
base.OnClick (e);
value = base.SelectedItem;
service.CloseDropDown();
}
public object Value {
get { return value; }
}
}
public override object EditValue (ITypeDescriptorContext context,
IServiceProvider provider, object value)
{
if (provider == null)
return value;
IWindowsFormsEditorService service =
(IWindowsFormsEditorService)provider.GetService (typeof (IWindowsFormsEditorService));
if (service == null)
return value;
CursorUI ui = new CursorUI (this, service, value);
service.DropDownControl (ui);
return ui.Value;
}
public override UITypeEditorEditStyle GetEditStyle (ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
#if NET_2_0
public override bool IsDropDownResizable {
get { return true; }
}
#endif
}
}

View File

@@ -0,0 +1,73 @@
//
// System.Drawing.Design.FontEditor.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Martin Willemoes Hansen
// (C) 2003 Andreas Nahr
//
//
// 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.Windows.Forms;
namespace System.Drawing.Design
{
public class FontEditor : UITypeEditor
{
private FontDialog fontEdit;
public FontEditor()
{
}
public override object EditValue (ITypeDescriptorContext context,
IServiceProvider provider, object value)
{
fontEdit = new FontDialog ();
if (value is Font)
fontEdit.Font = (Font) value;
else
// Set default
fontEdit.Font = new Drawing.Font (FontFamily.GenericSansSerif, 12);
fontEdit.FontMustExist = true;
DialogResult result = fontEdit.ShowDialog();
if (result == DialogResult.OK)
return fontEdit.Font;
else
return value;
}
public override UITypeEditorEditStyle GetEditStyle (ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal;
}
}
}

View File

@@ -0,0 +1,71 @@
//
// System.Drawing.Design.FontNameEditor.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Martin Willemoes Hansen
// (C) 2003 Andreas Nahr
//
//
// 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;
namespace System.Drawing.Design
{
public class FontNameEditor : UITypeEditor
{
private const String PreviewString = "Ab";
public FontNameEditor()
{
}
public override bool GetPaintValueSupported (ITypeDescriptorContext context)
{
return true;
}
public override void PaintValue (PaintValueEventArgs e)
{
Graphics G = e.Graphics;
// Draw the background
G.FillRectangle (SystemBrushes.ActiveCaption, e.Bounds);
// Draw the sample string
string fontName = e.Value as string;
if (fontName != null && fontName.Length > 0) {
using (Font font = new Font (fontName, e.Bounds.Height, FontStyle.Regular, GraphicsUnit.Pixel)) {
G.DrawString (PreviewString, font, SystemBrushes.ActiveCaptionText, e.Bounds);
}
}
// Draw the border again to ensure it is not overlapped by the text
G.DrawRectangle (Pens.Black, e.Bounds);
}
}
}

View File

@@ -0,0 +1,141 @@
//
// System.Drawing.Design.IconEditor.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Martin Willemoes Hansen
// (C) 2003 Andreas Nahr
//
//
// 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.Text;
using System.IO;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;
namespace System.Drawing.Design
{
// LAMESPEC: Why isn't this class inherited from ImageEditor?
public class IconEditor : UITypeEditor
{
private OpenFileDialog openDialog;
public IconEditor()
{
}
protected static string CreateExtensionsString (string[] extensions, string sep)
{
if (extensions.Length > 0) {
StringBuilder sb = new StringBuilder();
sb.Append (extensions[0]);
for (int x = 1; x < extensions.Length - 1; x++) {
sb.Append (sep);
sb.Append (extensions[x]);
}
return sb.ToString();
}
else {
return string.Empty;
}
}
protected static string CreateFilterEntry (IconEditor e)
{
StringBuilder sb = new StringBuilder();
string ExtStr = CreateExtensionsString (e.GetExtensions(), ";");
sb.Append (e.GetFileDialogDescription());
sb.Append (" (" + ExtStr + ")" + "|");
sb.Append (ExtStr);
return sb.ToString();
}
public override object EditValue (ITypeDescriptorContext context,
IServiceProvider provider, object value)
{
openDialog = new OpenFileDialog();
openDialog.Title = Locale.GetText ("Open image file");
openDialog.CheckFileExists = true;
openDialog.CheckPathExists = true;
openDialog.Filter = CreateFilterEntry (this);
openDialog.Multiselect = false;
// Show the dialog
DialogResult result = openDialog.ShowDialog();
// Check the result and create a new image from the file
if (result == DialogResult.OK)
{
return LoadFromStream (openDialog.OpenFile());
}
else
return value;
}
public override UITypeEditorEditStyle GetEditStyle (ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal;
}
protected virtual string[] GetExtensions()
{
return new string[] {"*.ico"};
}
protected virtual string GetFileDialogDescription()
{
return Locale.GetText ("Icon files");
}
public override bool GetPaintValueSupported (ITypeDescriptorContext context)
{
return true;
}
protected virtual Icon LoadFromStream (Stream stream)
{
return new Icon (stream);
}
public override void PaintValue (PaintValueEventArgs e)
{
Graphics G = e.Graphics;
if (e.Value != null) {
Icon i = (Icon) e.Value;
Image img = i.ToBitmap ();
G.DrawImage (img, e.Bounds);
img.Dispose ();
}
G.DrawRectangle (Pens.Black, e.Bounds);
}
}
}

View File

@@ -0,0 +1,141 @@
//
// System.Drawing.Design.ImageEditor.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Martin Willemoes Hansen
// (C) 2003 Andreas Nahr
// Copyright (C) 2007 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.Text;
using System.IO;
using System.ComponentModel;
using System.Windows.Forms;
namespace System.Drawing.Design
{
public class ImageEditor : UITypeEditor
{
private OpenFileDialog openDialog;
public ImageEditor()
{
}
public override object EditValue (ITypeDescriptorContext context,
IServiceProvider provider, object value)
{
openDialog = new OpenFileDialog();
openDialog.Title = Locale.GetText ("Open image file");
openDialog.CheckFileExists = true;
openDialog.CheckPathExists = true;
openDialog.Filter = CreateFilterEntry (this);
openDialog.Multiselect = false;
// Show the dialog
DialogResult result = openDialog.ShowDialog();
// Check the result and create a new image from the file
if (result == DialogResult.OK) {
return LoadFromStream (openDialog.OpenFile());
}
else
return value;
}
public override UITypeEditorEditStyle GetEditStyle (ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal;
}
public override bool GetPaintValueSupported (ITypeDescriptorContext context)
{
return true;
}
public override void PaintValue (PaintValueEventArgs e)
{
Graphics G = e.Graphics;
if (e.Value != null) {
Image I = (Image) e.Value;
G.DrawImage (I, e.Bounds);
}
G.DrawRectangle (Pens.Black, e.Bounds);
}
protected static string CreateExtensionsString (string[] extensions, string sep)
{
if (extensions.Length > 0) {
StringBuilder sb = new StringBuilder();
sb.Append (extensions[0]);
for (int x = 1; x < extensions.Length - 1; x++) {
sb.Append (sep);
sb.Append (extensions[x]);
}
return sb.ToString();
}
else {
return string.Empty;
}
}
protected static string CreateFilterEntry (ImageEditor e)
{
StringBuilder sb = new StringBuilder();
string ExtStr = CreateExtensionsString (e.GetExtensions(), ";");
sb.Append (e.GetFileDialogDescription());
sb.Append (" (" + ExtStr + ")" + "|");
sb.Append (ExtStr);
return sb.ToString();
}
protected virtual string[] GetExtensions()
{
return new string[] {"*.bmp", "*.gif", "*.jpg", "*.jpeg", "*.png", "*.ico", "*.emf", "*.wmf"};
}
protected virtual string GetFileDialogDescription()
{
return Locale.GetText ("All image files");
}
protected virtual Image LoadFromStream (Stream stream)
{
return new Bitmap (stream);
}
#if NET_2_0
[MonoTODO]
protected virtual Type[] GetImageExtenders ()
{
throw new NotImplementedException ();
}
#endif
}
}

View File

@@ -0,0 +1,61 @@
//
// System.Drawing.Design.MetafileEditor.cs
//
// Authors:
// Martin Willemoes Hansen (mwh@sysrq.dk)
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Martin Willemoes Hansen
// (C) 2003 Andreas Nahr
//
//
// 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.Drawing.Imaging;
namespace System.Drawing.Design
{
public class MetafileEditor : ImageEditor
{
public MetafileEditor()
{
}
protected override string[] GetExtensions()
{
return new string[] {"*.emf", "*.wmf"};
}
protected override string GetFileDialogDescription()
{
return Locale.GetText ("All metafile files");
}
protected override Image LoadFromStream (Stream stream)
{
return new Metafile (stream);
}
}
}

View File

@@ -0,0 +1,120 @@
//
// System.Drawing.Design.ToolboxItemContainer
//
// Authors:
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2007 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.
//
#if NET_2_0
using System.Collections;
using System.Runtime.Serialization;
using System.Windows.Forms;
namespace System.Drawing.Design {
[Serializable]
public class ToolboxItemContainer : ISerializable {
[MonoTODO]
public ToolboxItemContainer (IDataObject data)
{
throw new NotImplementedException ();
}
[MonoTODO]
public ToolboxItemContainer (ToolboxItem item)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected ToolboxItemContainer (SerializationInfo info, StreamingContext context)
{
throw new NotImplementedException ();
}
[MonoTODO]
public bool IsCreated {
get { throw new NotImplementedException (); }
}
[MonoTODO]
public bool IsTransient {
get { throw new NotImplementedException (); }
}
[MonoTODO]
public virtual IDataObject ToolboxData {
get { throw new NotImplementedException (); }
}
[MonoTODO]
public override bool Equals (object obj)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override int GetHashCode ()
{
throw new NotImplementedException ();
}
[MonoTODO]
protected virtual void GetObjectData (SerializationInfo info, StreamingContext context)
{
throw new NotImplementedException ();
}
[MonoTODO]
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual ICollection GetFilter (ICollection creators)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual ToolboxItem GetToolboxItem (ICollection creators)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void UpdateFilter (ToolboxItem item)
{
throw new NotImplementedException ();
}
}
}
#endif

View File

@@ -0,0 +1,54 @@
//
// System.Drawing.Design.ToolboxItemCreator
//
// Authors:
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2007 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.
//
#if NET_2_0
using System.Windows.Forms;
namespace System.Drawing.Design {
public sealed class ToolboxItemCreator {
internal ToolboxItemCreator ()
{
}
[MonoTODO]
public ToolboxItem Create (IDataObject data)
{
throw new NotImplementedException ();
}
[MonoTODO]
public string Format {
get { throw new NotImplementedException (); }
}
}
}
#endif

View File

@@ -0,0 +1,308 @@
//
// System.Drawing.Design.ToolboxService
//
// Authors:
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2007 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.
//
#if NET_2_0
using System.Collections;
using System.ComponentModel.Design;
using System.Reflection;
using System.Windows.Forms;
namespace System.Drawing.Design {
public abstract class ToolboxService : IComponentDiscoveryService, IToolboxService {
[MonoTODO]
protected ToolboxService ()
{
throw new NotImplementedException ();
}
protected abstract CategoryNameCollection CategoryNames {
get;
}
protected abstract string SelectedCategory {
get;
set;
}
protected abstract ToolboxItemContainer SelectedItemContainer {
get;
set;
}
[MonoTODO]
protected virtual ToolboxItemContainer CreateItemContainer (IDataObject dataObject)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected virtual ToolboxItemContainer CreateItemContainer (ToolboxItem item, IDesignerHost link)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected virtual void FilterChanged ()
{
throw new NotImplementedException ();
}
protected abstract IList GetItemContainers ();
protected abstract IList GetItemContainers (string categoryName);
[MonoTODO]
protected virtual bool IsItemContainer (IDataObject dataObject, IDesignerHost host)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected bool IsItemContainerSupported (ToolboxItemContainer container, IDesignerHost host)
{
throw new NotImplementedException ();
}
protected abstract void Refresh ();
[MonoTODO]
protected virtual void SelectedItemContainerUsed ()
{
throw new NotImplementedException ();
}
[MonoTODO]
protected virtual bool SetCursor ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public static void UnloadToolboxItems ()
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ToolboxItem GetToolboxItem (Type toolType)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ToolboxItem GetToolboxItem (Type toolType, bool nonPublic)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ICollection GetToolboxItems (AssemblyName an)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ICollection GetToolboxItems (AssemblyName an, bool throwOnError)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ICollection GetToolboxItems (Assembly a, string newCodeBase)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static ICollection GetToolboxItems (Assembly a, string newCodeBase, bool throwOnError)
{
throw new NotImplementedException ();
}
// IComponentDiscoveryService
ICollection IComponentDiscoveryService.GetComponentTypes (IDesignerHost designerHost, Type baseType)
{
throw new NotImplementedException ();
}
// IToolboxService
CategoryNameCollection IToolboxService.CategoryNames {
get { throw new NotImplementedException (); }
}
string IToolboxService.SelectedCategory {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
void IToolboxService.AddCreator (ToolboxItemCreatorCallback creator, string format)
{
throw new NotImplementedException ();
}
void IToolboxService.AddCreator (ToolboxItemCreatorCallback creator, string format, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.AddLinkedToolboxItem (ToolboxItem toolboxItem, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.AddLinkedToolboxItem (ToolboxItem toolboxItem, string category, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.AddToolboxItem (ToolboxItem toolboxItem, String category)
{
throw new NotImplementedException ();
}
void IToolboxService.AddToolboxItem (ToolboxItem toolboxItem)
{
throw new NotImplementedException ();
}
ToolboxItem IToolboxService.DeserializeToolboxItem (object serializedObject)
{
throw new NotImplementedException ();
}
ToolboxItem IToolboxService.DeserializeToolboxItem (object serializedObject, IDesignerHost host)
{
throw new NotImplementedException ();
}
ToolboxItem IToolboxService.GetSelectedToolboxItem ()
{
throw new NotImplementedException ();
}
ToolboxItem IToolboxService.GetSelectedToolboxItem (IDesignerHost host)
{
throw new NotImplementedException ();
}
ToolboxItemCollection IToolboxService.GetToolboxItems ()
{
throw new NotImplementedException ();
}
ToolboxItemCollection IToolboxService.GetToolboxItems (IDesignerHost host)
{
throw new NotImplementedException ();
}
ToolboxItemCollection IToolboxService.GetToolboxItems (String category)
{
throw new NotImplementedException ();
}
ToolboxItemCollection IToolboxService.GetToolboxItems (String category, IDesignerHost host)
{
throw new NotImplementedException ();
}
bool IToolboxService.IsSupported (object serializedObject, ICollection filterAttributes)
{
throw new NotImplementedException ();
}
bool IToolboxService.IsSupported (object serializedObject, IDesignerHost host)
{
throw new NotImplementedException ();
}
bool IToolboxService.IsToolboxItem (object serializedObject)
{
throw new NotImplementedException ();
}
bool IToolboxService.IsToolboxItem (object serializedObject, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.Refresh ()
{
throw new NotImplementedException ();
}
void IToolboxService.RemoveCreator (string format)
{
throw new NotImplementedException ();
}
void IToolboxService.RemoveCreator (string format, IDesignerHost host)
{
throw new NotImplementedException ();
}
void IToolboxService.RemoveToolboxItem (ToolboxItem toolboxItem)
{
throw new NotImplementedException ();
}
void IToolboxService.RemoveToolboxItem (ToolboxItem toolboxItem, string category)
{
throw new NotImplementedException ();
}
void IToolboxService.SelectedToolboxItemUsed ()
{
throw new NotImplementedException ();
}
object IToolboxService.SerializeToolboxItem (ToolboxItem toolboxItem)
{
throw new NotImplementedException ();
}
bool IToolboxService.SetCursor ()
{
throw new NotImplementedException ();
}
void IToolboxService.SetSelectedToolboxItem (ToolboxItem toolboxItem)
{
throw new NotImplementedException ();
}
}
}
#endif