diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Postarc/Postarc/Geodatabase/FieldInfo.cs	Fri Oct 05 23:55:06 2012 +0200
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using ESRI.ArcGIS.Geodatabase;
+using ESRI.ArcGIS.esriSystem;
+
+namespace Postarc.Geodatabase
+{
+    public class FieldInfo : IFieldInfo
+    {
+        protected string alias = null;
+        protected INumberFormat numberFormat = null;
+        protected bool visible = true;
+
+        public static IFieldInfo Create(IField field)
+        {
+            return new FieldInfo(field);
+        }
+
+        protected FieldInfo(IField field)
+        {
+            Alias = field.AliasName;
+            switch (field.Type)
+            {
+                case esriFieldType.esriFieldTypeInteger:
+                case esriFieldType.esriFieldTypeSmallInteger:
+                    this.numberFormat = new NumericFormatClass();
+                    break;
+            }
+        }
+
+        public string Alias
+        {
+            get
+            {
+                return this.alias;
+            }
+            set
+            {
+                this.alias = value;
+            }
+        }
+
+        public INumberFormat NumberFormat
+        {
+            get
+            {
+                return this.numberFormat;
+            }
+            set
+            {
+                this.numberFormat = value;
+            }
+        }
+
+        public bool Visible
+        {
+            get
+            {
+                return this.visible;
+            }
+            set
+            {
+                this.visible = value;
+            }
+        }
+
+        public string get_AsString(object value)
+        {
+            if (value == null)
+            {
+                return "<NULL>";
+            }
+            else
+            {
+                return value.ToString();
+            }
+        }
+    }
+}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)