本文整理汇总了C#中DataSource.ExecuteQueryObjectIdsAsync方法的典型用法代码示例。如果您正苦于以下问题:C# DataSource.ExecuteQueryObjectIdsAsync方法的具体用法?C# DataSource.ExecuteQueryObjectIdsAsync怎么用?C# DataSource.ExecuteQueryObjectIdsAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSource
的用法示例。
在下文中一共展示了DataSource.ExecuteQueryObjectIdsAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRefresh
/// <summary>
/// Called when a DataSource found in the DataSourceIds property is updated.
/// </summary>
/// <param name="dataSource">The DataSource being updated.</param>
public async void OnRefresh(DataSource dataSource)
{
try
{
int[] oIds = new int[_rfFeatures.Count];
int count = 0;
foreach (Feature f in _rfFeatures)
{
oIds[count] = System.Convert.ToInt32(f.Graphic.Attributes[dataSource.ObjectIdFieldName].ToString());
System.Diagnostics.Debug.WriteLine("Refresh: " + oIds[count].ToString());
count++;
}
Query q = new Query();
q.ReturnGeometry = true;
var result = await dataSource.ExecuteQueryObjectIdsAsync(oIds, q);
if (result == null || result.Features == null)
return;
client.GraphicsLayer gLayer = _map.Layers["RangeFanGraphics"] as client.GraphicsLayer;
if (gLayer != null)
{
if (gLayer.Graphics.Count == result.Features.Count)
{
foreach (client.Graphic g in result.Features)
{
client.Graphic pFan = CreateFan(g);
if (pFan != null)
{
foreach (client.Graphic graphic in gLayer.Graphics)
{
if (graphic.Attributes["Name"].ToString() == g.Attributes[_datasource.ObjectIdFieldName].ToString())
graphic.Geometry = pFan.Geometry;
}
}
}
}
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}