Esempio n. 1
0
 /// <summary>
 /// Adds entry from specified file.
 /// </summary>
 /// <param name="resPath">The resPath to entry. It should start with res://</param>
 public static void Add(this PckPacker source, string resPath, string filePath)
 {
     if (source is null)
     {
         throw new ArgumentNullException(nameof(source));
     }
     source.Add(new PckPackerEntryFile(resPath, filePath));
 }
Esempio n. 2
0
 /// <summary>
 /// Adds entry from bytes.
 /// </summary>
 /// <param name="resPath">The resPath to entry. It should start with res://</param>
 public static void Add(this PckPacker source, string resPath, byte[] bytes)
 {
     if (source is null)
     {
         throw new ArgumentNullException(nameof(source));
     }
     source.Add(new PckPackerEntryBytes(resPath, bytes));
 }
Esempio n. 3
0
 /// <summary>
 /// Adds entry from specified stream.
 /// </summary>
 /// <param name="resPath">The resPath to entry. It should start with res://</param>
 public static void Add(this PckPacker source, string resPath, Stream stream)
 {
     if (source is null)
     {
         throw new ArgumentNullException(nameof(source));
     }
     source.Add(new PckPackerEntryStream(resPath, stream));
 }
Esempio n. 4
0
 /// <summary>
 /// Adds entry from PckArchiveEntry with a new resPath.
 /// </summary>
 /// <param name="resPath">The resPath to entry. It should start with res://</param>
 public static void Add(this PckPacker source, string resPath, PckArchiveEntry entry)
 {
     if (source is null)
     {
         throw new ArgumentNullException(nameof(source));
     }
     source.Add(new PckPackerEntryEntry(resPath, entry));
 }
Esempio n. 5
0
        /// <summary>
        /// Adds entry from specified text.
        /// </summary>
        /// <param name="resPath">The resPath to entry. It should start with res://</param>
        public static void Add(this PckPacker source, string resPath, string text, Encoding encoding)
        {
            if (source is null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (text is null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (encoding is null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            var bytes = encoding.GetBytes(text);

            source.Add(new PckPackerEntryBytes(resPath, bytes));
        }