本文整理汇总了C#中IResourceLoader.openTextFile方法的典型用法代码示例。如果您正苦于以下问题:C# IResourceLoader.openTextFile方法的具体用法?C# IResourceLoader.openTextFile怎么用?C# IResourceLoader.openTextFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IResourceLoader
的用法示例。
在下文中一共展示了IResourceLoader.openTextFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: GooglePlayCSVGenerator
public GooglePlayCSVGenerator (IEditorUtil util, ProductIdRemapper remapper, InventoryDatabase db, IResourceLoader loader) {
this.util = util;
this.remapper = remapper;
this.db = db;
remapper.initialiseForPlatform(BillingPlatform.GooglePlay);
this.inventory = XDocument.Load(loader.openTextFile("unibillInventory"));
}
示例3: StorekitMassImportTemplateGenerator
public StorekitMassImportTemplateGenerator(IResourceLoader loader,
InventoryDatabase db, ProductIdRemapper remapper, IEditorUtil util) {
this.db = db;
this.remapper = remapper;
this.util = util;
XDocument inventory = XDocument.Load(loader.openTextFile("unibillInventory"));
this.inventoryDocument = inventory;
this.sku = (string) inventory.XPathSelectElement("//iOSSKU");
}