public void writeFile(BillingPlatform platform) { string directory = Path.Combine(util.getAssetsDirectoryPath(), "Plugins/unibill/generated/storekit"); if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); } string path = Path.Combine(directory, string.Format("{0}.MassImportTemplate.txt", platform)); using (StreamWriter writer = new StreamWriter(path, false)) { writer.WriteLine(getHeaderLine()); foreach (PurchasableItem item in config.AllPurchasableItems) { if (PurchaseType.Subscription != item.PurchaseType) { writer.WriteLine(serialisePurchasable(item, platform)); } } } }
public void writeCSV() { var directory = Path.Combine(util.getAssetsDirectoryPath(), "Plugins/unibill/generated/googleplay"); if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); } string path = Path.Combine(directory, "MassImportCSV.txt"); using (StreamWriter writer = new StreamWriter(path, false)) { writer.WriteLine(getHeaderRow()); foreach (PurchasableItem item in config.AllPurchasableItems) { if (PurchaseType.Subscription == item.PurchaseType) { continue; } string[] fields = serialiseItem(item); writer.WriteLine(string.Join(",", fields)); } } }