/// <summary> /// Instance constructor /// </summary> /// <param name="resourcePath"> </param> /// <param name="assembly"> </param> /// <param name="baseExtractor"> </param> public ResourceFileExtractor(string resourcePath = ".Resources.", Assembly assembly = null, ResourceFileExtractor baseExtractor = null) { _assembly = assembly ?? Assembly.GetCallingAssembly(); _baseExtractor = baseExtractor; _assemblyName = Assembly.GetName().Name; ResourceFilePath = resourcePath; }
/// <summary> /// Instance constructor /// </summary> /// <param name="resourcePath"> </param> /// <param name="assembly"> </param> /// <param name="baseExtractor"> </param> public ResourceFileExtractor(string resourcePath = ".Resources.", Assembly assembly = null, ResourceFileExtractor baseExtractor = null) { _assembly = assembly ?? Assembly.GetCallingAssembly(); _baseExtractor = baseExtractor; _assemblyName = Assembly.GetName().Name; ResourceFilePath = resourcePath; }
/// <summary> /// Read file in current assembly by specific path /// </summary> /// <param name="specificPath"> Specific path </param> /// <param name="fileName"> Read file name </param> /// <returns> </returns> public Stream ReadSpecificFileFromResToStream(string specificPath, string fileName) { var ext = new ResourceFileExtractor(specificPath, Assembly); return ext.ReadFileFromResToStream(fileName); }
/// <summary> /// Read file in current assembly by specific path /// </summary> /// <param name="specificPath"> Specific path </param> /// <param name="fileName"> Read file name </param> /// <returns> </returns> public Stream ReadSpecificFileFromResToStream(string specificPath, string fileName) { var ext = new ResourceFileExtractor(specificPath, Assembly); return(ext.ReadFileFromResToStream(fileName)); }