ArcGIS Pro多线程

 protected async void SetActiveRecord()
    {
      #region Set the active record
          await QueuedTask.Run(async () =>
          {
            var layers = MapView.Active.Map.GetLayersAsFlattenedList();
            var myParcelFabricLayer = layers.FirstOrDefault(l => l is ParcelLayer) as ParcelLayer;
            var recordsLayer = layers.FirstOrDefault(l => l.Name == "Records" && l is FeatureLayer);
            string sExistingRecord = "MyRecordName";
            
            var pFeatClass = (recordsLayer as FeatureLayer).GetFeatureClass();
            QueryFilter queryFilter = new QueryFilter
            {
              WhereClause = "Name = '" + sExistingRecord + "'"
            };
            Guid guid = new Guid();
            long lOID = -1;

            using (RowCursor rowCursor = pFeatClass.Search(queryFilter, false))
            {
              while (rowCursor.MoveNext())
              {
                using (Row row = rowCursor.Current)
                {
                  guid = row.GetGlobalID();
                  long oid = row.GetObjectID();
                }
              }
            }

            var parcelRecord=new ParcelRecord(myParcelFabricLayer.Map, sExistingRecord, guid, lOID);
            await myParcelFabricLayer.SetActiveRecord(parcelRecord);
          });
      #endregion
    }

 

上一篇:Oracle的SYS_GUID()在子查询时展现出不同的“神奇”现象


下一篇:How SAP CRM One Order item category group is read out