* Mono.Cairo/Cairo.cs (cairo_set_target_drawable): Not available anymore, removed.
[mono.git] / mcs / class / System.Drawing.Design / System.Drawing.Design / ColorEditor.cs
1 //
2 // System.Drawing.Design.ColorEditor.cs
3 // 
4 // Authors:
5 //  Martin Willemoes Hansen (mwh@sysrq.dk)
6 //  Andreas Nahr (ClassDevelopment@A-SoftTech.com)
7 // 
8 // (C) 2003 Martin Willemoes Hansen
9 // (C) 2003 Andreas Nahr
10 // 
11 using System;
12 using System.Drawing;
13 using System.ComponentModel;
14 namespace System.Drawing.Design
15 {
16         public class ColorEditor : UITypeEditor
17         {
18
19                 public ColorEditor()
20                 {
21                 }
22
23                 [MonoTODO]
24                 public override object EditValue (ITypeDescriptorContext context,
25                         IServiceProvider provider, object value)
26                 {
27                         // TODO IMPLEMENT
28                         return value;
29                 }
30
31                 public override UITypeEditorEditStyle GetEditStyle (
32                         ITypeDescriptorContext context)
33                 {
34                         return UITypeEditorEditStyle.DropDown;
35                 }
36
37                 public override bool GetPaintValueSupported (
38                         ITypeDescriptorContext context)
39                 {
40                         return true;
41                 }
42
43                 public override void PaintValue (PaintValueEventArgs e)
44                 {
45                         Graphics G = e.Graphics;
46                         if (e.Value != null)
47                         {
48                                 Color C = (Color) e.Value;
49                                 G.FillRectangle(new SolidBrush (C), e.Bounds);
50                         }
51                         G.DrawRectangle (Pens.Black, e.Bounds);
52                 }
53         }
54 }