Пример #1
0
        private void TopologyGeneralPropertyPage_Load(object sender, EventArgs e)
        {
            ISchemaLock         @lock          = this.itopology_0 as ISchemaLock;
            IEnumSchemaLockInfo schemaLockInfo = null;

            @lock.GetCurrentSchemaLocks(out schemaLockInfo);
            schemaLockInfo.Reset();
            if (schemaLockInfo.Next() == null)
            {
                this.txtName.Properties.ReadOnly             = true;
                this.txtClusterTolerance.Properties.ReadOnly = true;
            }
            this.txtName.Text             = (this.itopology_0 as IDataset).Name;
            this.txtClusterTolerance.Text = this.itopology_0.ClusterTolerance.ToString();
            this.bool_0 = true;
            switch (this.itopology_0.State)
            {
            case esriTopologyState.esriTSUnanalyzed:
                this.lblTopoError1.Text = "没有校验";
                this.lblTopoError2.Text = "在拓扑中存在一个或多个脏区。脏区是指被编辑过的区域";
                break;

            case esriTopologyState.esriTSAnalyzedWithErrors:
                this.lblTopoError1.Text = "已经校验 - 存在错误";
                this.lblTopoError2.Text = "所有编辑过的拓扑已经被校验过。有一个或多个拓扑错误存在";
                break;

            case esriTopologyState.esriTSAnalyzedWithoutErrors:
                this.lblTopoError1.Text = "已经校验 - 没有错误误";
                this.lblTopoError2.Text = "所有编辑过的拓扑已经被校验过。没有拓扑错误存在";
                break;
            }
        }
        public bool IsFeatureClassLockable(IFeatureClass checkFeatureClass)
        {
            IObjectClass objectClass = checkFeatureClass as IObjectClass;

            if (objectClass == null)
            {
                return(false);
            }

            ISchemaLock schemaLock = (ISchemaLock)objectClass;

            if (schemaLock == null)
            {
                return(false);
            }

            // Get an enumerator over the current schema locks.
            IEnumSchemaLockInfo enumSchemaLockInfo = null;

            schemaLock.GetCurrentSchemaLocks(out enumSchemaLockInfo);

            // Iterate through the locks.
            ISchemaLockInfo schemaLockInfo = null;
            int             lockCount      = 0;

            while ((schemaLockInfo = enumSchemaLockInfo.Next()) != null)
            {
                lockCount++;
                Trace.WriteLine(string.Format("{0} : {1} : {2}", schemaLockInfo.TableName,
                                              schemaLockInfo.UserName, schemaLockInfo.SchemaLockType));
            }

            // Note: 1 sharedLock for this process is normal, so we test for > 1 lock
            return(lockCount < 2);
        }
Пример #3
0
 void ESRI.ArcGIS.Geodatabase.ISchemaLock.GetCurrentSchemaLocks(out IEnumSchemaLockInfo schemaLockInfo)
 {
     schemaLockInfo = null;
 }