本文整理汇总了C#中IStorage.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# IStorage.GetString方法的具体用法?C# IStorage.GetString怎么用?C# IStorage.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStorage
的用法示例。
在下文中一共展示了IStorage.GetString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoteConfigManager
public RemoteConfigManager(IResourceLoader loader, IStorage storage, ILogger logger, RuntimePlatform platform)
{
this.storage = storage;
logger.prefix = "Unibill.RemoteConfigManager";
this.XML = loader.openTextFile ("unibillInventory.json").ReadToEnd ();
Config = new UnibillConfiguration(XML, platform, logger);
if (Config.UseHostedConfig) {
string val = storage.GetString (CACHED_CONFIG_PATH, string.Empty);
if (string.IsNullOrEmpty (val)) {
logger.Log ("No cached config available. Using bundled");
} else {
logger.Log ("Cached config found, attempting to parse");
try {
Config = new UnibillConfiguration(val, platform, logger);
if (Config.inventory.Count == 0) {
logger.LogError ("No purchasable items in cached config, ignoring.");
Config = new UnibillConfiguration (XML, platform, logger);
} else {
logger.Log (string.Format ("Using cached config with {0} purchasable items", Config.inventory.Count));
XML = val;
}
} catch (Exception e) {
logger.LogError ("Error parsing inventory: {0}", e.Message);
Config = new UnibillConfiguration(XML, platform, logger);
}
}
refreshCachedConfig (Config.HostedConfigUrl, logger);
} else {
logger.Log ("Not using cached inventory, using bundled.");
Config = new UnibillConfiguration(XML, platform, logger);
}
}
示例2: getUserId
private string getUserId(IStorage storage)
{
string result = storage.GetString(USER_ID_KEY, string.Empty);
if (string.IsNullOrEmpty(result)) {
result = Guid.NewGuid().ToString();
storage.SetString(USER_ID_KEY, result);
onEvent (EventType.new_installation, null, null);
}
return result;
}