本文整理汇总了C#中OsmSharp.Osm.Xml.Streams.XmlOsmStreamSource.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# XmlOsmStreamSource.Reset方法的具体用法?C# XmlOsmStreamSource.Reset怎么用?C# XmlOsmStreamSource.Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OsmSharp.Osm.Xml.Streams.XmlOsmStreamSource
的用法示例。
在下文中一共展示了XmlOsmStreamSource.Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XmlDataProcessorSourceReset
public void XmlDataProcessorSourceReset()
{
// generate the source.
var source = new XmlOsmStreamSource(
Assembly.GetExecutingAssembly().GetManifestResourceStream(
"OsmSharp.Test.Unittests.api.osm"));
// pull the data out.
var target = new OsmStreamTargetEmpty();
target.RegisterSource(source);
target.Pull();
// reset the source.
if (source.CanReset)
{
source.Reset();
// pull the data again.
target.Pull();
}
}
示例2: TestSimpleToCompleteOn
/// <summary>
/// Test simple to complete conversion on the given resource.
/// </summary>
/// <param name="embeddedResource"></param>
private void TestSimpleToCompleteOn(string embeddedResource)
{
var dataProcessorSource = new XmlOsmStreamSource(
Assembly.GetExecutingAssembly().GetManifestResourceStream(embeddedResource));
// fill the memory data source with source-data.
var referenceSource = MemoryDataSource.CreateFrom(dataProcessorSource);
// pull the complete objects.
dataProcessorSource.Reset();
var list = this.PullToCompleteList(dataProcessorSource);
// compare the two.
this.Compare(referenceSource, list);
}