/// <summary> /// Instance constructor /// </summary> /// <param name="assembly"></param> /// <param name="isStatic"></param> /// <param name="baseExtractor"></param> /// <exception cref="ArgumentNullException">Argument is null.</exception> private ResourceFileExtractor(Assembly assembly, bool isStatic, ResourceFileExtractor baseExtractor) { #region Check if (ReferenceEquals(assembly, null)) { throw new ArgumentNullException("assembly"); } #endregion m_assembly = assembly; m_baseExtractor = baseExtractor; m_assemblyName = Assembly.GetName().Name; IsStatic = isStatic; m_resourceFilePath = ".Resources."; }
/// <summary> /// Create instance /// </summary> /// <param name="baseExtractor"></param> public ResourceFileExtractor(ResourceFileExtractor baseExtractor) : this(Assembly.GetCallingAssembly(), baseExtractor) { }
/// <summary> /// Create instance /// </summary> /// <param name="resourceFilePath"><c>ResourceFilePath</c> in assembly. Example: .Properties.Scripts.</param> /// <param name="baseExtractor"></param> public ResourceFileExtractor(string resourceFilePath, ResourceFileExtractor baseExtractor) : this(Assembly.GetCallingAssembly(), baseExtractor) { m_resourceFilePath = resourceFilePath; }
/// <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 string ReadSpecificFileFromRes(string specificPath, string fileName) { ResourceFileExtractor _ext = new ResourceFileExtractor(Assembly, specificPath); return(_ext.ReadFileFromRes(fileName)); }
/// <summary> /// Instance constructor /// </summary> /// <param name="assembly"></param> /// <param name="baseExtractor"></param> public ResourceFileExtractor(Assembly assembly, ResourceFileExtractor baseExtractor) : this(assembly ?? Assembly.GetCallingAssembly(), false, baseExtractor) { }