예제 #1
0
 /// <summary>
 /// 通过json设置属性
 /// </summary>
 /// <param name="attributes"></param>
 public static void SetAttrsByJson(this IRowBuffer buffer, JObject attrs)
 {
     for (int i = 0; i < buffer.Fields.FieldCount; i++)
     {
         if (buffer.Fields.Field[i].Editable)
         {
             string name = buffer.Fields.Field[i].Name;
             if (name == "SHAPE" || name == "SHAPE_Area" || name == "SHAPE_Length" || name == "OBJECTID" || name == "GLOBALID" || name == "FID")
             {
                 continue;
             }
             buffer._SetAttrByJson(i, attrs.GetValue(name));
         }
     }
 }
예제 #2
0
        /// <summary>
        /// 通过json设置属性
        /// </summary>
        /// <param name="attributes"></param>
        public static void SetAttrByJson(this IRowBuffer buffer, string name, JToken token)
        {
            int index = buffer.Fields.FindField(name);

            buffer._SetAttrByJson(index, token);
        }