本文整理汇总了C#中IRecord.GetGeometry方法的典型用法代码示例。如果您正苦于以下问题:C# IRecord.GetGeometry方法的具体用法?C# IRecord.GetGeometry怎么用?C# IRecord.GetGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRecord
的用法示例。
在下文中一共展示了IRecord.GetGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
/// <summary>
/// Updates the specified record.
/// </summary>
/// <param name="record">The record.</param>
public void Update(IRecord record)
{
if (record.FieldCount != this.FieldCount)
throw new InvalidOperationException(Strings.ErrorJaggedResultSet);
foreach (var v in _values.Values)
{
v.SetNull();
}
for (int i = 0; i < record.FieldCount; i++)
{
if (record.IsNull(i))
continue;
var val = _values[_ordinalMap[i]];
var type = val.Type;
switch (type)
{
case PropertyValueType.Blob:
((BlobValue)val).Value = record.GetBlob(i);
break;
case PropertyValueType.Boolean:
((BooleanValue)val).Value = record.GetBoolean(i);
break;
case PropertyValueType.Byte:
((ByteValue)val).Value = record.GetByte(i);
break;
case PropertyValueType.Clob:
((ClobValue)val).Value = record.GetClob(i);
break;
case PropertyValueType.DateTime:
((DateTimeValue)val).Value = record.GetDateTime(i);
break;
case PropertyValueType.Double:
((DoubleValue)val).Value = record.GetDouble(i);
break;
//case PropertyValueType.Feature:
// {
// List<IFeature> features = new List<IFeature>();
// foreach (var feat in record.GetFeatureObject(i))
// {
// features.Add(feat);
// }
// ((FeatureValue)val).Value = features.ToArray();
// }
// break;
case PropertyValueType.Geometry:
((GeometryValue)val).Value = record.GetGeometry(i);
break;
case PropertyValueType.Int16:
((Int16Value)val).Value = record.GetInt16(i);
break;
case PropertyValueType.Int32:
((Int32Value)val).Value = record.GetInt32(i);
break;
case PropertyValueType.Int64:
((Int64Value)val).Value = record.GetInt64(i);
break;
//case PropertyValueType.Raster:
// ((RasterValue)val).Value = record.GetRaster(i);
// break;
case PropertyValueType.Single:
((SingleValue)val).Value = record.GetSingle(i);
break;
case PropertyValueType.String:
((StringValue)val).Value = record.GetString(i);
break;
}
}
}