コード例 #1
0
 /// <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.";
 }
コード例 #2
0
 /// <summary>
 /// Create instance
 /// </summary>
 /// <param name="baseExtractor"></param>
 public ResourceFileExtractor(ResourceFileExtractor baseExtractor)
     : this(Assembly.GetCallingAssembly(), baseExtractor)
 {
 }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
        /// <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));
        }
コード例 #5
0
 /// <summary>
 /// Instance constructor
 /// </summary>
 /// <param name="assembly"></param>
 /// <param name="baseExtractor"></param>
 public ResourceFileExtractor(Assembly assembly, ResourceFileExtractor baseExtractor)
     : this(assembly ?? Assembly.GetCallingAssembly(), false, baseExtractor)
 {
 }