Esempio n. 1
0
        public AoField this[string name] {
            get {
                foreach (AoField f in m_fields)
                {
                    if (f.Name == name)
                    {
                        return(f);
                    }
                }

                return(null);
            }
            set {
                AoField existing = null;
                int     i        = 0;
                for (i = 0; i < m_fields.Count; i++)
                {
                    if (m_fields[i].Name == name)
                    {
                        existing = m_fields[i];
                        break;
                    }
                }
                if (existing == null)
                {
                    m_fields.Add(value);
                    return;
                }

                m_fields[i] = value;
            }
        }
Esempio n. 2
0
        public static AoField Shape(string nm,
                                    esriGeometryType g,
                                    ISpatialReference spref)
        {
            AoField r = new AoField(nm, esriFieldType.esriFieldTypeGeometry);

            IGeometryDefEdit geom = new GeometryDefClass() as IGeometryDefEdit;

            geom.GeometryType_2     = g;
            geom.SpatialReference_2 = (spref == null ? null : (spref as IClone).Clone() as ISpatialReference);
            r.Ed.GeometryDef_2      = geom;
            return(r);
        }