本文整理汇总了C#中Cache.write方法的典型用法代码示例。如果您正苦于以下问题:C# Cache.write方法的具体用法?C# Cache.write怎么用?C# Cache.write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cache
的用法示例。
在下文中一共展示了Cache.write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addToCache
/// <summary>
/// add a new location to the cache
/// </summary>
public void addToCache(Address address)
{
//if the location's zone matches a cache file name
//then store it in the cache
//else create a new cache
if (address.AddressString == "")
return;
if (_currentCache != null
&& address.GpxLocation.Zone == _currentCache.Name)
_currentCache.write(address.GpxLocation.Key, address);
else {
bool foundCache = false;
foreach (Cache c in _caches) {
if (address.GpxLocation.Zone == c.Name) {
_currentCache = c;
foundCache = true;
c.write(address.GpxLocation.Key, address);
}
}
//create the cache and store the location
if (!foundCache) {
Cache c = new Cache(address.GpxLocation.Zone);
_currentCache = c;
c.write(address.GpxLocation.Key, address);
_caches.Add(c);
}
}
}