Beispiel #1
0
        //public GeometryFieldType GeometryFieldType
        //{
        //    get
        //    {
        //        return _geomDef.GeometryFieldType;
        //    }
        //}
        #endregion

        #region IRefreshable Member

        public void RefreshFrom(object obj)
        {
            if (!(obj is SqlFDBFeatureClass))
            {
                return;
            }

            SqlFDBFeatureClass fc = (SqlFDBFeatureClass)obj;

            if (fc.Name != this.Name)
            {
                return;
            }

            this.Envelope         = fc.Envelope;
            this.SpatialReference = fc.SpatialReference;
            this.IDFieldName      = fc.IDFieldName;
            this.ShapeFieldName   = fc.ShapeFieldName;

            _geomDef.GeometryType = fc.GeometryType;
            _geomDef.HasZ         = fc.HasZ;
            _geomDef.HasM         = fc.HasM;

            Fields fields = new Fields(fc.Fields);

            if (fields != null)
            {
                fields.PrimaryDisplayField = m_fields.PrimaryDisplayField;
            }

            m_fields = fields;
        }
Beispiel #2
0
        async static public Task <SqlFDBFeatureClass> Create(SqlFDB fdb, IDataset dataset, GeometryDef geomDef, BinarySearchTree tree)
        {
            var fc = await SqlFDBFeatureClass.Create(fdb, dataset, geomDef);

            fc._searchTree = tree;

            return(fc);
        }
Beispiel #3
0
        async static public Task <SqlFDBFeatureClass> Create(SqlFDB fdb, IDataset dataset, GeometryDef geomDef)
        {
            var fc = new SqlFDBFeatureClass();

            fc._fdb = fdb;

            fc._dataset = dataset;
            fc._geomDef = (geomDef != null) ? geomDef : new GeometryDef();

            if (fc._geomDef != null && fc._geomDef.SpatialReference == null && dataset is IFeatureDataset)
            {
                fc._geomDef.SpatialReference = await((IFeatureDataset)dataset).GetSpatialReference();
            }

            fc.m_fields = new Fields();

            return(fc);
        }
Beispiel #4
0
        void SqlFDB_TableAltered(string table)
        {
            if (_layers == null) return;

            foreach (IDatasetElement element in _layers)
            {
                if (element.Class is SqlFDBFeatureClass &&
                    ((SqlFDBFeatureClass)element.Class).Name == table)
                {
                    List<IField> fields = _fdb.FeatureClassFields(this._dsID, table);

                    SqlFDBFeatureClass fc = element.Class as SqlFDBFeatureClass;
                    ((Fields)fc.Fields).Clear();

                    foreach (IField field in fields)
                    {
                        ((Fields)fc.Fields).Add(field);
                    }
                }
            }
        }