當前位置: 首頁>>代碼示例>>C#>>正文


C# Map.GetMapNewTileAvailableAsObservable方法代碼示例

本文整理匯總了C#中SharpMap.Map.GetMapNewTileAvailableAsObservable方法的典型用法代碼示例。如果您正苦於以下問題:C# Map.GetMapNewTileAvailableAsObservable方法的具體用法?C# Map.GetMapNewTileAvailableAsObservable怎麽用?C# Map.GetMapNewTileAvailableAsObservable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SharpMap.Map的用法示例。


在下文中一共展示了Map.GetMapNewTileAvailableAsObservable方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Map_TileAsyncAddedToReplacedCollection_FiresMapNewtileAvailable

        public void Map_TileAsyncAddedToReplacedCollection_FiresMapNewtileAvailable(LayerCollectionType collectionType)
        {
            var map = new Map();

            var group = CreateLayerGroup();
            map.GetCollection(collectionType).Add(group);

            group.Layers = new ObservableCollection<ILayer>();

            var tileAsync = CreateTileAsyncLayer();
            AddTileLayerToLayerGroup(tileAsync, group);

            var eventSource = map.GetMapNewTileAvailableAsObservable();
            RaiseMapNewtileAvailableOn(tileAsync);
            Assert.That(eventSource.Count().First(), Is.EqualTo(1), TestContext.CurrentContext.Test.GetDescription());
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:16,代碼來源:MapTest.cs

示例2: Map_TileAsyncAddedToDetachedCollection_DoesNotFireMapNewTileAvailable

        public void Map_TileAsyncAddedToDetachedCollection_DoesNotFireMapNewTileAvailable(LayerCollectionType collectionType)
        {
            var map = new Map();

            var group = CreateLayerGroup();
            map.GetCollection(collectionType).Add(group);

            var detachedCollection = group.Layers;

            group.Layers = new ObservableCollection<ILayer>();

            var tileAsync = CreateTileAsyncLayer();
            detachedCollection.Add(tileAsync.Item1.Object);

            var eventSource = map.GetMapNewTileAvailableAsObservable();
            RaiseMapNewtileAvailableOn(tileAsync);
            Assert.That(eventSource.Count().First(), Is.EqualTo(0), TestContext.CurrentContext.Test.GetDescription());
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:18,代碼來源:MapTest.cs

示例3: Map_TileAsyncFromClearedGroup_DoesNotFireMapNewTileAvailable

        public void Map_TileAsyncFromClearedGroup_DoesNotFireMapNewTileAvailable(LayerCollectionType collectionType)
        {
            var map = new Map();

            var group = CreateLayerGroup();
            map.GetCollection(collectionType).Add(group);

            var tileLayer = CreateTileAsyncLayer();
            AddTileLayerToLayerGroup(tileLayer, group);

            group.Layers.Clear();

            var eventSource = map.GetMapNewTileAvailableAsObservable();
            RaiseMapNewtileAvailableOn(tileLayer);

            Assert.That(eventSource.IsEmpty().First(), TestContext.CurrentContext.Test.GetDescription());
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:17,代碼來源:MapTest.cs

示例4: Map_TileAsyncRemovedFromNephew_DoesNotFireMapNewtileAvailable

        public void Map_TileAsyncRemovedFromNephew_DoesNotFireMapNewtileAvailable(LayerCollectionType collectionType)
        {
            var map = new Map();

            var group = CreateLayerGroup();
            map.GetCollection(collectionType).Add(group);

            var subGroup = CreateLayerGroup("subgroup");

            var tileAsyncLayer = CreateTileAsyncLayer();
            AddTileLayerToLayerGroup(tileAsyncLayer, subGroup);

            group.Layers.Add(subGroup);

            // test
            RemoveTileLayerFromGroup(subGroup, tileAsyncLayer);

            var eventSource = map.GetMapNewTileAvailableAsObservable();
            RaiseMapNewtileAvailableOn(tileAsyncLayer);
            Assert.That(eventSource.Count().First(), Is.EqualTo(0), TestContext.CurrentContext.Test.GetDescription());
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:21,代碼來源:MapTest.cs

示例5: Map_TileAsyncReplacedFromGroup_DoesNotFireMapNewTileAvailable

        public void Map_TileAsyncReplacedFromGroup_DoesNotFireMapNewTileAvailable(LayerCollectionType collectionType)
        {
            var map = new Map();

            var group = CreateLayerGroup();
            map.GetCollection(collectionType).Add(group);

            var tileLayer = CreateTileAsyncLayer();
            AddTileLayerToLayerGroup(tileLayer, group);

            var newTileLayer = CreateTileAsyncLayer();
            ReplaceExistingAsyncLayerFromGroup(group, tileLayer, newTileLayer);

            var eventSource = map.GetMapNewTileAvailableAsObservable();
            RaiseMapNewtileAvailableOn(tileLayer);

            Assert.That(eventSource.IsEmpty().First(),
                "Map should NOT fire MapNewTileAvailable event for TileAsyncLayers replaced from a group");

            RaiseMapNewtileAvailableOn(newTileLayer);

            Assert.That(eventSource.Count().First(), Is.EqualTo(1), TestContext.CurrentContext.Test.GetDescription());
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:23,代碼來源:MapTest.cs

示例6: MapDoesNoGenerateMapNewTile_AfterClear

        public void MapDoesNoGenerateMapNewTile_AfterClear(LayerCollectionType collectionType)
        {
            var map = new Map();

            var tileAsyncLayer = CreateTileAsyncLayer();

            AddTileLayerToMap(tileAsyncLayer, map, collectionType);

            var eventSource = map.GetMapNewTileAvailableAsObservable();

            map.GetCollection(collectionType).Clear();

            RaiseMapNewtileAvailableOn(tileAsyncLayer);

            Assert.That(eventSource.IsEmpty().First(), TestContext.CurrentContext.Test.GetDescription());
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:16,代碼來源:MapTest.cs

示例7: MapGeneratesMapNewTile_NewReplacedLayers

        public void MapGeneratesMapNewTile_NewReplacedLayers(LayerCollectionType collectionType)
        {
            var map = new Map();

            var tileAsyncLayer = CreateTileAsyncLayer();

            AddTileLayerToMap(tileAsyncLayer, map, collectionType);

            var eventSource = map.GetMapNewTileAvailableAsObservable();

            var newLayer = CreateTileAsyncLayer();
            map.GetCollection(collectionType)[0] = newLayer.Item1.Object;

            RaiseMapNewtileAvailableOn(newLayer);

            Assert.That(eventSource.Count().First(), Is.EqualTo(1), TestContext.CurrentContext.Test.GetDescription());
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:17,代碼來源:MapTest.cs

示例8: AfterRemovingTileAsyncLayer_MapDoesNotHookAnymoreItsMapNewTileAvailableEvent

        public void AfterRemovingTileAsyncLayer_MapDoesNotHookAnymoreItsMapNewTileAvailableEvent(LayerCollectionType collectionType)
        {
            var map = new Map();

            var tileAsyncLayer = CreateTileAsyncLayer();

            AddTileLayerToMap(tileAsyncLayer, map, collectionType);

            var eventSource = map.GetMapNewTileAvailableAsObservable();

            map.GetCollection(collectionType).RemoveAt(0); 

            RaiseMapNewtileAvailableOn(tileAsyncLayer);

            Assert.That(eventSource.Count().First(), Is.EqualTo(0), TestContext.CurrentContext.Test.GetDescription());
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:16,代碼來源:MapTest.cs

示例9: AddingTileAsyncLayers_HookItsMapNewTileAvaliableEvent

        public void AddingTileAsyncLayers_HookItsMapNewTileAvaliableEvent(LayerCollectionType collectionType)
        {
            var map = new Map();

            var layer = CreateTileAsyncLayer();

            AddTileLayerToMap(layer, map, collectionType);
            
            var eventSource = map.GetMapNewTileAvailableAsObservable();

            RaiseMapNewtileAvailableOn(layer);
            
            Assert.That(eventSource.Count().First(), Is.EqualTo(1), TestContext.CurrentContext.Test.GetDescription());
        }
開發者ID:lishxi,項目名稱:_SharpMap,代碼行數:14,代碼來源:MapTest.cs


注:本文中的SharpMap.Map.GetMapNewTileAvailableAsObservable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。