• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FeatureCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FeatureCollection的典型用法代码示例。如果您正苦于以下问题:C# FeatureCollection类的具体用法?C# FeatureCollection怎么用?C# FeatureCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FeatureCollection类属于命名空间,在下文中一共展示了FeatureCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ValidateFeatures

        /// <summary>
        /// Compare source and target features
        /// </summary>
        /// <param name="sFeatures">Source features</param>
        /// <param name="tFeatures">Target features</param>
        /// <returns>True if the features match, false otherwise</returns>
        public static bool ValidateFeatures(FeatureCollection sFeatures, FeatureCollection tFeatures)
        {
            int sCount = 0;
            int tCount = 0;

            foreach (Feature sFeature in sFeatures)
            {
                sCount++;
                Guid sID = sFeature.Id;

                Feature tFeature = tFeatures.Where(ft => ft.Id == sID).FirstOrDefault();
                
                // Feature activation: do we see the target feature with the correct id?
                // Feature deactivation: we shouldn't see the target feature anymore when we choose to deactivate
                if ((tFeature != null && sID == tFeature.Id) || (sFeature.Deactivate && tFeature == null))
                {
                    tCount++;
                }
            }

            if (sCount != tCount)
            {
                return false;
            }

            return true;
        }
开发者ID:stijnbrouwers,项目名称:PnP-Sites-Core,代码行数:33,代码来源:FeatureValidator.cs


示例2: OpenFeaturesFromArcGISOnline

        private async void OpenFeaturesFromArcGISOnline(string itemId)
        {
            try
            {
                // Open a portal item containing a feature collection
                ArcGISPortal portal = await ArcGISPortal.CreateAsync();
                PortalItem collectionItem = await PortalItem.CreateAsync(portal, itemId);

                // Verify that the item is a feature collection
                if (collectionItem.Type == PortalItemType.FeatureCollection)
                {
                    // Create a new FeatureCollection from the item
                    FeatureCollection featCollection = new FeatureCollection(collectionItem);

                    // Create a layer to display the collection and add it to the map as an operational layer
                    FeatureCollectionLayer featCollectionLayer = new FeatureCollectionLayer(featCollection);
                    featCollectionLayer.Name = collectionItem.Title;
                    MyMapView.Map.OperationalLayers.Add(featCollectionLayer);
                }
                else
                {
                    MessageBox.Show("Portal item with ID '" + itemId + "' is not a feature collection.", "Feature Collection");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to open item with ID '" + itemId + "': " + ex.Message, "Error");
            }
        }        
开发者ID:Esri,项目名称:arcgis-runtime-samples-dotnet,代码行数:29,代码来源:FeatureCollectionLayerFromPortal.xaml.cs


示例3: clusterThread_RunWorkerCompleted

 private void clusterThread_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if ((!e.Cancelled) && (e.Result != null))
     {
         Dictionary<int, Cluster> result = e.Result as Dictionary<int, Cluster>;
         if (result != null)
         {
             FeatureCollection clusters = new FeatureCollection();
             int num = 0;
             foreach (int num2 in result.Keys)
             {
                 if (result.ContainsKey(num2))
                     num = Math.Max(result[num2].Count, num);
             }
             foreach (int num3 in result.Keys)
             {
                 if (result.ContainsKey(num3) && result[num3].Features.Count == 1)
                 {
                     clusters.Add(result[num3].Features[0]);
                 }
                 else if (result.ContainsKey(num3))
                 {
                     Feature item = this.OnCreateFeature(result[num3].Features, new GeoPoint(result[num3].X, result[num3].Y), num);
                     item.DisableToolTip = true;
                     item.SetValue(Clusterer.ClusterProperty, result[num3].Features);
                     clusters.Add(item);
                 }
             }
             base.OnClusteringCompleted(clusters);
         }
     }
 }
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:32,代码来源:FeaturesClusterer.cs


示例4: OnCreateFeature

        protected override Feature OnCreateFeature(FeatureCollection cluster, GeoPoint center, int maxClusterCount)
        {
            double sum = 0;
            Feature feature = null;
            foreach (Feature item in cluster)
            {
                if (item.Attributes.ContainsKey(AggregateColumn))
                {
                    sum += Convert.ToDouble(item.Attributes[AggregateColumn]);
                }
            }
            double size = (sum + 450) / 30;
            size = Math.Log(sum * StyleScale / 10) * 10 + 20;
            if (size < 12)
            {
                size = 12;
            }
            CustomClusterStyle s = new CustomClusterStyle();
            feature = new Feature() { Style = new CustomClusterStyle() { Size = size }, Geometry = center };
            feature.Attributes.Add("Color", InterPlateColor(size - 12, 100));
            feature.Attributes.Add("Size", size);
            feature.Attributes.Add("Count", cluster.Count);

            return feature;
        }
开发者ID:SuperMap,项目名称:iClient-for-Silverlight,代码行数:25,代码来源:CustomClustererTest.xaml.cs


示例5: HandleRequest

 private Task HandleRequest(IDictionary<string, object> env)
 {
     var ofc = new FeatureCollection(new OwinFeatureCollection(env));
     var t = _callback.Invoke(ofc);
     return t;
     //return TaskHelpers.Await(t, () => {Console.WriteLine("done");}, (ex) => {Console.WriteLine("failed with " + ex.ToString());});
 }
开发者ID:borgdylan,项目名称:aspnet5-repros,代码行数:7,代码来源:NowinServerFactory.cs


示例6: CreateServer

 public IServer CreateServer(IConfiguration configuration)
 {
     var information = new ServerInformation(configuration);
     var serverFeatures = new FeatureCollection();
     serverFeatures.Set<IServerInformation>(information);
     serverFeatures.Set<IServerAddressesFeature>(information);
     return new Server(serverFeatures, _appLifetime, _loggerFactory.CreateLogger(Server.ConfigServerAssembly));
 }
开发者ID:bestwpw,项目名称:RestBus,代码行数:8,代码来源:ServerFactory.cs


示例7: MainViewModel

 public MainViewModel(IEnumerable<IFeature> features)
 {
     this.features = new FeatureCollection(features);
     this.featuresView = CollectionViewSource.GetDefaultView(this.features);
     this.featuresView.GroupDescriptions.Add(new PropertyGroupDescription(nameof(IFeature.GroupName)));
     this.featuresView.SortDescriptions.Add(new SortDescription(nameof(IFeature.Order), ListSortDirection.Ascending));
     this.addOrRemoveFeaturesCommand = new AsyncDelegateCommand(this.AddOrRemoveFeatures);
 } 
开发者ID:fmoliveira,项目名称:ASP.NET-MVC-Boilerplate,代码行数:8,代码来源:MainViewModel.cs


示例8: NewFeatureCollection

 static IFeatureCollection NewFeatureCollection()
 {
     var stub = new StubFeatures();
     var features = new FeatureCollection();
     features[typeof(IHttpRequestFeature)] = stub;
     features[typeof(IHttpResponseFeature)] = stub;
     return features;
 }
开发者ID:yonglehou,项目名称:Hosting,代码行数:8,代码来源:HostingEngineTests.cs


示例9: CreateServer

 public IServer CreateServer(IConfiguration configuration)
 {
     var information = new KestrelServerInformation(configuration);
     var serverFeatures = new FeatureCollection();
     serverFeatures.Set<IKestrelServerInformation>(information);
     serverFeatures.Set<IServerAddressesFeature>(information);
     return new KestrelServer(serverFeatures, _appLifetime, _loggerFactory.CreateLogger("Microsoft.AspNet.Server.Kestrel"));
 }
开发者ID:leloulight,项目名称:KestrelHttpServer,代码行数:8,代码来源:ServerFactory.cs


示例10: Initialize

 public IFeatureCollection Initialize(IConfiguration configuration)
 {
     var information = new KestrelServerInformation();
     information.Initialize(configuration);
     var serverFeatures = new FeatureCollection();
     serverFeatures.Set<IKestrelServerInformation>(information);
     serverFeatures.Set<IServerAddressesFeature>(information);
     return serverFeatures;
 }
开发者ID:rogeralsing,项目名称:KestrelHttpServer,代码行数:9,代码来源:ServerFactory.cs


示例11: IndexerAlsoAddsItems

        public void IndexerAlsoAddsItems()
        {
            var interfaces = new FeatureCollection();
            var thing = new Thing();

            interfaces[typeof(IThing)] = thing;

            Assert.Equal(interfaces[typeof(IThing)], thing);
        }
开发者ID:leloulight,项目名称:HttpAbstractions,代码行数:9,代码来源:FeatureCollectionTests.cs


示例12: Initialize

 public static void Initialize(FeatureCollection featureList, IUserListReader userListReader)
 {
     FeatureToggles = new List<BasicToggleType>();
     foreach (FeatureElement feature in featureList)
     {
         var toggleType = CreateToggleType(feature, userListReader);
         FeatureToggles.Add(toggleType);
     }
 }
开发者ID:esivertsson,项目名称:asp-net-feature-toggle,代码行数:9,代码来源:FeatureToggle.cs


示例13: EditFeatures

 public EditFeatures()
 {
     InitializeComponent();
     drawLayer = MyMap.Layers["DrawLayer"] as FeaturesLayer;
     tempLayer = MyMap.Layers["TempLayer"] as FeaturesLayer;
     layer = MyMap.Layers["MyLayer"] as TiledDynamicRESTLayer;
     features = new FeatureCollection();
     featureIDs = new List<int>();
 }
开发者ID:SuperMap,项目名称:iClient-for-Silverlight,代码行数:9,代码来源:EditFeatures.xaml.cs


示例14: SecondCallToAddThrowsException

        public void SecondCallToAddThrowsException()
        {
            var interfaces = new FeatureCollection();
            var thing = new Thing();

            interfaces.Add(typeof(IThing), thing);

            Assert.Throws<ArgumentException>(() => interfaces.Add(typeof(IThing), thing));
        }
开发者ID:mchenx,项目名称:HttpAbstractions,代码行数:9,代码来源:InterfaceDictionaryTests.cs


示例15: GetGeoJsonContents

        /// <summary>
        /// Gets a stream for a given feature collection.
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private static Action<Stream> GetGeoJsonContents(FeatureCollection model)
        {
            return stream =>
            {
                var geoJson = OsmSharp.Geo.Streams.GeoJson.GeoJsonConverter.ToGeoJson(model as FeatureCollection);

                var geoJsonBytes = System.Text.Encoding.UTF8.GetBytes(geoJson);
                stream.Write(geoJsonBytes, 0, geoJsonBytes.Length);
            };
        }
开发者ID:nagyistoce,项目名称:OsmSharp-routing-api,代码行数:15,代码来源:GeoJsonResponse.cs


示例16: AddedInterfaceIsReturned

        public void AddedInterfaceIsReturned()
        {
            var interfaces = new FeatureCollection();
            var thing = new Thing();

            interfaces[typeof(IThing)] = thing;

            object thing2 = interfaces[typeof(IThing)];
            Assert.Equal(thing2, thing);
        }
开发者ID:leloulight,项目名称:HttpAbstractions,代码行数:10,代码来源:FeatureCollectionTests.cs


示例17: Initialize

        public IFeatureCollection Initialize(IConfiguration configuration)
        {
            var builder = ServerBuilder.New()
                        .SetAddress(IPAddress.Any)
                        .SetPort(5000)
                        .SetOwinApp(HandleRequest);

            var serverFeatures = new FeatureCollection();
            serverFeatures.Set<INowinServerInformation>(new NowinServerInformation(builder));
            return serverFeatures;
        }
开发者ID:ChujianA,项目名称:aspnetcore-doc-cn,代码行数:11,代码来源:NowinServerFactory.cs


示例18: Initialize

 public IFeatureCollection Initialize(IConfiguration configuration)
 {
     // TODO: Parse config
     var builder = ServerBuilder.New()
         .SetAddress(IPAddress.Any)
         .SetPort(configuration["port"] != null ? Int32.Parse(configuration["port"]) : 8080)
         .SetOwinApp(OwinWebSocketAcceptAdapter.AdaptWebSockets(HandleRequest));
     var serverFeatures = new FeatureCollection();
     serverFeatures.Set<NowinServerInformation>(new NowinServerInformation(builder));
     return serverFeatures;
 }
开发者ID:borgdylan,项目名称:aspnet5-repros,代码行数:11,代码来源:NowinServerFactory.cs


示例19: CreateServer

        public IServer CreateServer(IConfiguration configuration)
        {
            var information = new RioSharpServerInformation();
            information.Initialize(configuration);

            var serverFeatures = new FeatureCollection();
            serverFeatures.Set<IRioSharpServerInformation>(information);
            serverFeatures.Set<IServerAddressesFeature>(information);

            return new RioSharpServer(serverFeatures, _appLifetime, _loggerFactory.CreateLogger("RioSharp.Aspnet"), _httpContextFactory);
        }
开发者ID:aL3891,项目名称:RioSharp,代码行数:11,代码来源:RioSharpAspNetServerFactory.cs


示例20: SetNullValueRemoves

        public void SetNullValueRemoves()
        {
            var interfaces = new FeatureCollection();
            var thing = new Thing();

            interfaces[typeof(IThing)] = thing;
            Assert.Equal(interfaces[typeof(IThing)], thing);

            interfaces[typeof(IThing)] = null;

            object thing2 = interfaces[typeof(IThing)];
            Assert.Null(thing2);
        }
开发者ID:leloulight,项目名称:HttpAbstractions,代码行数:13,代码来源:FeatureCollectionTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FeatureDataSet类代码示例发布时间:2022-05-24
下一篇:
C# FeatureBaseEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap