Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/SharpVectorRuntime/SvgLink.cs @ 14052

Last change on this file since 14052 was 12762, checked in by aballeit, 9 years ago

#2283 GUI updates, Tree-chart, MCTS Version 2 (prune leaves)

File size: 5.7 KB
Line 
1using System;
2using System.Text;
3using System.Collections.Generic;
4
5using System.Windows;
6
7namespace SharpVectors.Runtime
8{
9    public enum SvgLinkAction
10    {
11        LinkNone    = 0,
12        LinkPage    = 1,
13        LinkHtml    = 2,
14        LinkTooltip = 3
15    }
16
17    public sealed class SvgLink : DependencyObject
18    {
19        #region Public Fields
20
21        public static readonly DependencyProperty ColorProperty =
22            DependencyProperty.RegisterAttached("Color", typeof(String), typeof(SvgLink),
23            new FrameworkPropertyMetadata(String.Empty, FrameworkPropertyMetadataOptions.None));
24
25        public static readonly DependencyProperty PartsIdProperty =
26            DependencyProperty.RegisterAttached("PartsId", typeof(String), typeof(SvgLink),
27            new FrameworkPropertyMetadata(String.Empty, FrameworkPropertyMetadataOptions.None));
28
29        public static readonly DependencyProperty TypeProperty =
30            DependencyProperty.RegisterAttached("Type", typeof(String), typeof(SvgLink),
31            new FrameworkPropertyMetadata(String.Empty, FrameworkPropertyMetadataOptions.None));
32
33        public static readonly DependencyProperty NumberProperty =
34            DependencyProperty.RegisterAttached("Number", typeof(String), typeof(SvgLink),
35            new FrameworkPropertyMetadata(String.Empty, FrameworkPropertyMetadataOptions.None));
36
37        public static readonly DependencyProperty PinProperty =
38            DependencyProperty.RegisterAttached("Pin", typeof(String), typeof(SvgLink),
39            new FrameworkPropertyMetadata(String.Empty, FrameworkPropertyMetadataOptions.None));
40
41        public static readonly DependencyProperty LineIdProperty =
42            DependencyProperty.RegisterAttached("LineId", typeof(String), typeof(SvgLink),
43            new FrameworkPropertyMetadata(String.Empty, FrameworkPropertyMetadataOptions.None));
44       
45        //----------------------------------------------------------------------------------------------------
46
47        public static readonly DependencyProperty KeyProperty =
48            DependencyProperty.RegisterAttached("Key", typeof(String), typeof(SvgLink),
49            new FrameworkPropertyMetadata(String.Empty, FrameworkPropertyMetadataOptions.None));
50
51        public static readonly DependencyProperty LocationProperty =
52            DependencyProperty.RegisterAttached("Location", typeof(String), typeof(SvgLink),
53            new FrameworkPropertyMetadata(String.Empty, FrameworkPropertyMetadataOptions.None));
54
55        public static readonly DependencyProperty ActionProperty =
56            DependencyProperty.RegisterAttached("Action", typeof(SvgLinkAction), typeof(SvgLink),
57            new FrameworkPropertyMetadata(SvgLinkAction.LinkNone, FrameworkPropertyMetadataOptions.None));
58
59        #endregion
60
61        #region Public Methods
62
63        public static void SetColor(DependencyObject element, string value)
64        {
65            element.SetValue(ColorProperty, value);
66        }
67
68        public static string GetColor(DependencyObject element)
69        {
70            return (string)element.GetValue(ColorProperty);
71        }
72
73        public static void SetPartsId(DependencyObject element, string value)
74        {
75            element.SetValue(PartsIdProperty, value);
76        }
77
78        public static string GetPartsId(DependencyObject element)
79        {
80            return (string)element.GetValue(PartsIdProperty);
81        }
82
83        public static void SetType(DependencyObject element, string value)
84        {
85            element.SetValue(TypeProperty, value);
86        }
87
88        public static string GetType(DependencyObject element)
89        {
90            return (string)element.GetValue(TypeProperty);
91        }
92
93        public static void SetNumber(DependencyObject element, string value)
94        {
95            element.SetValue(NumberProperty, value);
96        }
97
98        public static string GetNumber(DependencyObject element)
99        {
100            return (string)element.GetValue(NumberProperty);
101        }
102
103        public static void SetPin(DependencyObject element, string value)
104        {
105            element.SetValue(PinProperty, value);
106        }
107
108        public static string GetPin(DependencyObject element)
109        {
110            return (string)element.GetValue(PinProperty);
111        }
112
113        public static void SetLineId(DependencyObject element, string value)
114        {
115            element.SetValue(LineIdProperty, value);
116        }
117
118        public static string GetLineId(DependencyObject element)
119        {
120            return (string)element.GetValue(LineIdProperty);
121        }
122
123        //----------------------------------------------------------------------------------------------------
124
125        public static void SetKey(DependencyObject element, string value)
126        {
127            element.SetValue(KeyProperty, value);
128        }
129
130        public static string GetKey(DependencyObject element)
131        {
132            return (string)element.GetValue(KeyProperty);
133        }
134
135        public static void SetLocation(DependencyObject element, string value)
136        {
137            element.SetValue(LocationProperty, value);
138        }
139
140        public static string GetLocation(DependencyObject element)
141        {
142            return (string)element.GetValue(LocationProperty);
143        }
144
145        public static void SetAction(DependencyObject element, SvgLinkAction value)
146        {
147            element.SetValue(ActionProperty, value);
148        }
149
150        public static SvgLinkAction GetAction(DependencyObject element)
151        {
152            return (SvgLinkAction)element.GetValue(ActionProperty);
153        }
154
155        #endregion
156    }
157}
Note: See TracBrowser for help on using the repository browser.