Free cookie consent management tool by TermsFeed Policy Generator

source: tags/3.3.11/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/PropertySystem/Descriptors/ControlDescriptor.cs @ 13398

Last change on this file since 13398 was 4068, checked in by swagner, 14 years ago

Sorted usings and removed unused usings in entire solution (#1094)

File size: 1.1 KB
Line 
1using System;
2using System.Drawing;
3namespace Netron.Diagramming.Core {
4  /// <summary>
5  /// Descriptor for <see cref="SimpleShapeBase"/> derived classes (i.e. most of the simple drawing elements like the <see cref="SimpleRectangle"/> shape).
6  /// </summary>
7  class ControlDescriptor : DescriptorBase {
8
9    protected override void GetValue(object sender, PropertyEventArgs e) {
10      switch (e.Name) {
11        case "BackColor":
12          e.Value = (e.Component as DiagramControlBase).BackColor;
13          break;
14        default:
15          base.GetValue(sender, e);
16          break;
17      }
18    }
19
20    protected override void SetValue(object sender, PropertyEventArgs e) {
21      switch (e.Name) {
22        case "BackColor":
23          (e.Component as DiagramControlBase).BackColor = (Color)e.Value;
24          break;
25        default:
26          base.SetValue(sender, e);
27          break;
28      }
29    }
30
31    public ControlDescriptor(ControlProvider provider, Type type)
32      : base(provider, type) {
33      this.AddProperty("BackColor", typeof(Color));
34    }
35
36
37  }
38}
Note: See TracBrowser for help on using the repository browser.