コード例 #1
0
ファイル: AnnotationLayer.cs プロジェクト: hy1314200/HyDM
        /// <summary>
        /// ����ע��ʵ��
        /// </summary>
        /// <param name="entinyNode">VCTע��ʵ��ڵ�</param>
        public override FeatureEntity CreateFeatureEntity(EntityNode entinyNode)
        {
            try
            {
                if (entinyNode is AnnotationNode)
                {
                    m_AnnotationEntity = new AnnotationEntity();
                    m_AnnotationEntity.SetFeatureKeyFieldName(m_strEntityFieldName, m_strSYDMFieldName);
                    m_AnnotationEntity.CreateFeature(this.Table, entinyNode);

                    return m_AnnotationEntity;
                }
                else
                    return null;
            }
            catch(Exception ex)
            {
                LogAPI.WriteErrorLog(ex);
                return null;
            }
        }
コード例 #2
0
ファイル: AnnotationLayer.cs プロジェクト: zj8487/HyDM
		/// <summary>
		/// 创建注记实体
		/// </summary>
		/// <param name="entinyNode">VCT注记实体节点</param>
		public override FeatureEntity CreateFeatureEntity(EntityNode entinyNode)
        {
            try
            {
                if (entinyNode is AnnotationNode)
                {
                    m_AnnotationEntity = new AnnotationEntity();
                    m_AnnotationEntity.SetFeatureKeyFieldName(m_strEntityFieldName, m_strSYDMFieldName);
                    m_AnnotationEntity.CreateFeature(this.Table, entinyNode);

                    return m_AnnotationEntity;
                }
                else
                    return null;
            }
            catch(Exception ex)
            {
                LogAPI.WriteErrorLog(ex);
                return null;
            }
		}
コード例 #3
0
ファイル: AnnotationLayer.cs プロジェクト: zj8487/HyDM
        /// <summary>
        /// 获取实体集合
        /// </summary>
        public override List<FeatureEntity> GetFeatureEntitys()
        {
            try
            {
                IFeatureClass pFeatureCls = this.Table as IFeatureClass;
                IFeatureCursor pCursor = pFeatureCls.Search(null,false);
                IFeature pFeature=  pCursor.NextFeature();
                List<FeatureEntity> listFeatureEnty = new List<FeatureEntity>();//保存FeatureEntity
                while (pFeature!=null)
                {
                    AnnotationEntity pAnnotationEntity = new AnnotationEntity();
                    pAnnotationEntity.Feature = pFeature;
                    ///初始化相关数据
                    //pAnnotationEntity.GetEntityNode();
                    pAnnotationEntity.FeatureCode = this.FeatureCode;


                    int nEntityIDIndex = -1;
                    nEntityIDIndex = pFeature.Fields.FindField(m_strEntityFieldName);
                    if (nEntityIDIndex != -1)
                        pAnnotationEntity.EntityID = Convert.ToInt32(pFeature.get_Value(nEntityIDIndex));

                    ///获取标识码和要素代码字段
                    pAnnotationEntity.SetFeatureKeyFieldName(m_strEntityFieldName, m_strSYDMFieldName);

                    listFeatureEnty.Add(pAnnotationEntity);
                    pFeature = pCursor.NextFeature();
                }
                m_FeatureEntys = listFeatureEnty;
                return listFeatureEnty;
            }
            catch(Exception ex)
            {
                LogAPI.WriteErrorLog(ex);
                return null;
            }
        }
コード例 #4
0
ファイル: AnnotationLayer.cs プロジェクト: hy1314200/HyDM
        /// <summary>
        /// ��ȡʵ�弯��
        /// </summary>
        public override List<FeatureEntity> GetFeatureEntitys()
        {
            try
            {
                IFeatureClass pFeatureCls = this.Table as IFeatureClass;
                IFeatureCursor pCursor = pFeatureCls.Search(null,false);
                IFeature pFeature=  pCursor.NextFeature();
                List<FeatureEntity> listFeatureEnty = new List<FeatureEntity>();//����FeatureEntity
                while (pFeature!=null)
                {
                    AnnotationEntity pAnnotationEntity = new AnnotationEntity();
                    pAnnotationEntity.Feature = pFeature;
                    ///��ʼ���������
                    //pAnnotationEntity.GetEntityNode();
                    pAnnotationEntity.FeatureCode = this.FeatureCode;

                    int nEntityIDIndex = -1;
                    nEntityIDIndex = pFeature.Fields.FindField(m_strEntityFieldName);
                    if (nEntityIDIndex != -1)
                        pAnnotationEntity.EntityID = Convert.ToInt32(pFeature.get_Value(nEntityIDIndex));

                    ///��ȡ��ʶ���Ҫ�ش����ֶ�
                    pAnnotationEntity.SetFeatureKeyFieldName(m_strEntityFieldName, m_strSYDMFieldName);

                    listFeatureEnty.Add(pAnnotationEntity);
                    pFeature = pCursor.NextFeature();
                }
                m_FeatureEntys = listFeatureEnty;
                return listFeatureEnty;
            }
            catch(Exception ex)
            {
                LogAPI.WriteErrorLog(ex);
                return null;
            }
        }