Mercurial > postarc > postarc
comparison Postarc/Postarc/Geodatabase/FieldInfo.cs @ 0:1aca3d413885 tip
Initial import of Postarc
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 05 Oct 2012 23:55:06 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1aca3d413885 |
---|---|
1 using System; | |
2 using System.Collections.Generic; | |
3 using System.Linq; | |
4 using System.Text; | |
5 using ESRI.ArcGIS.Geodatabase; | |
6 using ESRI.ArcGIS.esriSystem; | |
7 | |
8 namespace Postarc.Geodatabase | |
9 { | |
10 public class FieldInfo : IFieldInfo | |
11 { | |
12 protected string alias = null; | |
13 protected INumberFormat numberFormat = null; | |
14 protected bool visible = true; | |
15 | |
16 public static IFieldInfo Create(IField field) | |
17 { | |
18 return new FieldInfo(field); | |
19 } | |
20 | |
21 protected FieldInfo(IField field) | |
22 { | |
23 Alias = field.AliasName; | |
24 switch (field.Type) | |
25 { | |
26 case esriFieldType.esriFieldTypeInteger: | |
27 case esriFieldType.esriFieldTypeSmallInteger: | |
28 this.numberFormat = new NumericFormatClass(); | |
29 break; | |
30 } | |
31 } | |
32 | |
33 public string Alias | |
34 { | |
35 get | |
36 { | |
37 return this.alias; | |
38 } | |
39 set | |
40 { | |
41 this.alias = value; | |
42 } | |
43 } | |
44 | |
45 public INumberFormat NumberFormat | |
46 { | |
47 get | |
48 { | |
49 return this.numberFormat; | |
50 } | |
51 set | |
52 { | |
53 this.numberFormat = value; | |
54 } | |
55 } | |
56 | |
57 public bool Visible | |
58 { | |
59 get | |
60 { | |
61 return this.visible; | |
62 } | |
63 set | |
64 { | |
65 this.visible = value; | |
66 } | |
67 } | |
68 | |
69 public string get_AsString(object value) | |
70 { | |
71 if (value == null) | |
72 { | |
73 return "<NULL>"; | |
74 } | |
75 else | |
76 { | |
77 return value.ToString(); | |
78 } | |
79 } | |
80 } | |
81 } |