File: StandardValuesTypeConverter.cs

package info (click to toggle)
graphviz 2.26.3-5%2Bsqueeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 63,032 kB
  • ctags: 25,930
  • sloc: ansic: 212,134; sh: 20,316; cpp: 7,239; makefile: 4,211; yacc: 3,335; xml: 2,450; tcl: 1,900; cs: 1,890; objc: 1,149; perl: 829; lex: 363; awk: 171; python: 41; ruby: 35; php: 26
file content (41 lines) | stat: -rwxr-xr-x 1,056 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections;
using System.ComponentModel;
using System.Text;

namespace Graphviz
{
	public class StandardValuesTypeConverter : TypeConverter
	{
		public class Attribute : System.Attribute
		{
			public StandardValuesCollection Values
			{
				get { return _values; }
			}
			
			public Attribute(ICollection values)
			{
				_values = new StandardValuesCollection(values);
			}
			
			private readonly StandardValuesCollection _values;
		}
		
		public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
		{
			Attribute attribute = (Attribute)context.PropertyDescriptor.Attributes[typeof(Attribute)];
			return attribute == null ? null : attribute.Values;
		}
		
		public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
		{
			return false;
		}
		
		public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
		{
			return (Attribute)context.PropertyDescriptor.Attributes[typeof(Attribute)] != null;
		}
	}
}