Exemplo 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));
 }
Exemplo 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));
 }
Exemplo 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));
 }
Exemplo 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));
 }
Exemplo 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));
        }