public Platform.AbstractPlatform GetPlatform(string name) { if (platforms == null) { platforms = new Dictionary <string, Platform.AbstractPlatform>(); foreach (System.Reflection.Assembly assembly in GetRawAssemblies()) { Platform.AbstractPlatform platform = this.GetPlatformInstance(assembly); platform.PlatformProvider = this; string key = platform.Name; if (platforms.ContainsKey(key)) { throw new InvalidOperationException("Multiple platforms with the same ID: '" + key + "'"); } platforms[key] = platform; } } if (name != null && platforms.ContainsKey(name)) { return(platforms[name]); } return(null); }
public TemplateReader(Common.PkgAwareFileUtil fileUtil, AbstractPlatform platform) { this.fileUtil = fileUtil; AbstractPlatform walker = platform; while (walker != null) { platformNamesMostGeneralFirst.Add(walker.Name); walker = walker.ParentPlatform; } platformNamesMostGeneralFirst.Reverse(); }
public TemplateReader(Wax.PkgAwareFileUtil fileUtil, AbstractPlatform platform, string activeCrayonSourceRoot) { this.activeCrayonSourceRoot = activeCrayonSourceRoot; this.fileUtil = fileUtil; AbstractPlatform walker = platform; while (walker != null) { platformNamesMostGeneralFirst.Add(walker.Name); walker = walker.ParentPlatform; } platformNamesMostGeneralFirst.Reverse(); }
public byte[] LoadBinaryResource(string resourcePath) { byte[] bytes = Util.ReadAssemblyFileBytes(this.GetType().Assembly, resourcePath); if (bytes == null) { AbstractPlatform parent = this.ParentPlatform; if (parent == null) { return(null); } return(parent.LoadBinaryResource(resourcePath)); } return(bytes); }
public string LoadTextResource(string resourcePath, Dictionary <string, string> replacements) { string content = Util.ReadAssemblyFileText(this.GetType().Assembly, resourcePath, true); if (content == null) { AbstractPlatform parent = this.ParentPlatform; if (parent == null) { throw new Exception("Resource not found: '" + resourcePath + "'"); } return(parent.LoadTextResource(resourcePath, replacements)); } return(this.ApplyReplacements(content, replacements)); }
public LibraryNativeInvocationTranslatorProvider(Dictionary <string, Library> libraries, Platform.AbstractPlatform platform) { this.libraries = libraries; this.platform = platform; }