"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WpfExporter = void 0; const fs = require("fs-extra"); const path = require("path"); const CSharpExporter_1 = require("./CSharpExporter"); const Converter_1 = require("../Converter"); const uuid = require('uuid'); class WpfExporter extends CSharpExporter_1.CSharpExporter { constructor(options) { super(options); } backend() { return 'WPF'; } exportResources() { fs.ensureDirSync(path.join(this.options.to, this.sysdir() + '-build', 'Properties')); this.writeFile(path.join(this.options.to, this.sysdir() + '-build', 'Properties', 'AssemblyInfo.cs')); this.p('using System.Reflection;'); this.p('using System.Resources;'); this.p('using System.Runtime.CompilerServices;'); this.p('using System.Runtime.InteropServices;'); this.p('using System.Windows;'); this.p(); this.p('[assembly: AssemblyTitle("HaxeProject")]'); this.p('[assembly: AssemblyDescription("")]'); this.p('[assembly: AssemblyConfiguration("")]'); this.p('[assembly: AssemblyCompany("Kha Development Team")]'); this.p('[assembly: AssemblyProduct("HaxeProject")]'); this.p('[assembly: AssemblyCopyright("Copyright ? Kha Development Team 2018")]'); this.p('[assembly: AssemblyTrademark("")]'); this.p('[assembly: AssemblyCulture("")]'); this.p(); this.p('[assembly: ComVisible(false)]'); this.p(); this.p('//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]'); this.p(); this.p('[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]'); this.p(); this.p('// [assembly: AssemblyVersion("1.0.*")]'); this.p('[assembly: AssemblyVersion("1.0.0.0")]'); this.p('[assembly: AssemblyFileVersion("1.0.0.0")]'); this.closeFile(); this.writeFile(path.join(this.options.to, this.sysdir() + '-build', 'Properties', 'Resources.Designer.cs')); this.p('namespace WpfApplication1.Properties {'); this.p('[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]', 1); this.p('[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]', 1); this.p('[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]', 1); this.p('internal class Resources', 1); this.p('{', 1); this.p('private static global::System.Resources.ResourceManager resourceMan;', 2); this.p('private static global::System.Globalization.CultureInfo resourceCulture;', 2); this.p(); this.p('[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]', 2); this.p('internal Resources() { }', 2); this.p(); this.p('[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]', 2); this.p('internal static global::System.Resources.ResourceManager ResourceManager', 2); this.p('{', 2); this.p('get', 3); this.p('{', 3); this.p('if ((resourceMan == null))', 4); this.p('{', 4); this.p('global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfApplication1.Properties.Resources", typeof(Resources).Assembly);', 5); this.p('resourceMan = temp;', 5); this.p('}', 4); this.p('return resourceMan;', 4); this.p('}', 3); this.p('}', 2); this.p(); this.p('[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]', 2); this.p('internal static global::System.Globalization.CultureInfo Culture', 2); this.p('{', 2); this.p('get', 3); this.p('{', 3); this.p('return resourceCulture;', 4); this.p('}', 3); this.p('set', 3); this.p('{', 3); this.p('resourceCulture = value;', 4); this.p('}', 3); this.p('}', 2); this.p('}', 1); this.p('}'); this.closeFile(); this.writeFile(path.join(this.options.to, this.sysdir() + '-build', 'Properties', 'Resources.resx')); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p('text/microsoft-resx'); this.p(''); this.p(''); this.p('2.0'); this.p(''); this.p(''); this.p('System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'); this.p(''); this.p(''); this.p('System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'); this.p(''); this.p(''); this.closeFile(); this.writeFile(path.join(this.options.to, this.sysdir() + '-build', 'Properties', 'Settings.Designer.cs')); this.p('namespace WpfApplication1.Properties'); this.p('{'); this.p('[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]', 1); this.p('[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]', 1); this.p('internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase', 1); this.p('{', 1); this.p('private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));', 2); this.p(); this.p('public static Settings Default', 2); this.p('{', 2); this.p('get', 3); this.p('{', 3); this.p('return defaultInstance;', 4); this.p('}', 3); this.p('}', 2); this.p('}', 1); this.p('}'); this.closeFile(); this.writeFile(path.join(this.options.to, this.sysdir() + '-build', 'Properties', 'Settings.settings')); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.p(''); this.closeFile(); } exportCsProj(projectUuid) { this.writeFile(path.join(this.options.to, this.sysdir() + '-build', 'Project.csproj')); this.p(''); this.p(''); this.p('', 1); this.p('Debug', 2); this.p('x86', 2); this.p('8.0.30703', 2); this.p('2.0', 2); this.p('{' + projectUuid.toString().toUpperCase() + '}', 2); this.p('Library', 2); this.p('Properties', 2); this.p('WpfApplication1', 2); this.p('WpfApplication1', 2); this.p('v4.0', 2); this.p('Client', 2); this.p('512', 2); this.p('{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}', 2); this.p('4', 2); this.p('', 1); this.p('', 1); this.p('x86', 2); this.p('true', 2); this.p('full', 2); this.p('false', 2); this.p('bin\\Debug\\', 2); this.p('DEBUG;TRACE', 2); this.p('prompt', 2); this.p('4', 2); this.p('', 1); this.p('', 1); this.p('x86', 2); this.p('pdbonly', 2); this.p('true', 2); this.p('bin\\Release\\', 2); this.p('TRACE', 2); this.p('prompt', 2); this.p('4', 2); this.p('', 1); this.p('', 1); this.p('', 2); this.p('', 2); this.p('', 2); this.p('', 2); this.p('', 2); this.p('', 2); this.p('', 2); this.p('', 2); this.p('4.0', 3); this.p('', 2); this.p('', 2); this.p('', 2); this.p('', 2); this.p('', 1); this.p('', 1); this.includeFiles(path.join(this.options.to, this.sysdir() + '-build', 'Sources', 'src'), path.join(this.options.to, this.sysdir() + '-build')); this.p('', 1); this.p('', 1); this.p('', 2); this.p('Code', 3); this.p('', 2); this.p('', 2); this.p('True', 3); this.p('True', 3); this.p('Resources.resx', 3); this.p('', 2); this.p('', 2); this.p('True', 3); this.p('Settings.settings', 3); this.p('True', 3); this.p('', 2); this.p('', 2); this.p('ResXFileCodeGenerator', 3); this.p('Resources.Designer.cs', 3); this.p('', 2); this.p('', 2); this.p('SettingsSingleFileGenerator', 3); this.p('Settings.Designer.cs', 3); this.p('', 2); this.p('', 2); this.p('', 1); this.p('', 1); this.p(''); this.closeFile(); } /*copyMusic(platform, from, to, encoders, callback) { Files.createDirectories(this.directory.resolve(this.sysdir()).resolve(to).parent()); Converter.convert(from, this.directory.resolve(this.sysdir()).resolve(to + '.mp4'), encoders.aacEncoder, () => { callback([to + '.mp4']); }); }*/ async copySound(platform, from, to) { fs.copySync(from.toString(), path.join(this.options.to, this.sysdir(), to + '.wav'), { overwrite: true }); return { files: [to + '.wav'], sizes: [1] }; } async copyVideo(platform, from, to) { fs.ensureDirSync(path.join(this.options.to, this.sysdir(), path.dirname(to))); await (0, Converter_1.convert)(from, path.join(this.options.to, this.sysdir(), to + '.wmv'), this.options.wmv); return { files: [to + '.wmv'], sizes: [1] }; } } exports.WpfExporter = WpfExporter; //# sourceMappingURL=WpfExporter.js.map