예제 #1
0
        /// <summary>
        /// Gets an embedded resource string of text file embedded into Assembly.
        /// </summary>
        /// <param name="name">Name of embedded resource</param>
        /// <returns>string</returns>
        public static string GetEmbeddedResourceString(this System.Reflection.Assembly assembly, string name)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            using (StreamReader reader = assembly.GetEmbeddedResourceStream(name))
            {
                return(reader.ReadToEnd());
            }
        }