当前位置: 首页>>代码示例>>C#>>正文


C# DataSource.ExecuteQueryObjectIdsAsync方法代码示例

本文整理汇总了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);
            }

        }
开发者ID:ruisebastiao,项目名称:solutions-widgets-wpf,代码行数:51,代码来源:RangeFanWid.xaml.cs


注:本文中的DataSource.ExecuteQueryObjectIdsAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。