Ejemplo n.º 1
0
        private IResourceIndexEntry NewResource(IResourceKey rk, MemoryStream ms, DuplicateHandling dups, bool compress)
        {
            IResourceIndexEntry rie = CurrentPackage.Find(x => rk.Equals(x));
            if (rie != null)
            {
                if (dups == DuplicateHandling.reject) return null;
                if (dups == DuplicateHandling.replace) CurrentPackage.DeleteResource(rie);
            }

            rie = CurrentPackage.AddResource(rk, ms, false);//we do NOT want to search again...
            if (rie == null) return null;

            rie.Compressed = (ushort)(compress ? 0x5A42 : 0);

            IsPackageDirty = true;

            return rie;
        }
Ejemplo n.º 2
0
 bool IEqualityComparer <IResourceKey> .Equals(
     IResourceKey x, IResourceKey y)
 {
     return(x.Equals(y));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Determines whether the specified <see cref="IResourceKey"/> instances are equal.
 /// </summary>
 /// <param name="x">The first <see cref="IResourceKey"/> to compare.</param>
 /// <param name="y">The second <see cref="IResourceKey"/> to compare.</param>
 /// <returns>true if the specified <see cref="IResourceKey"/> instances are equal; otherwise, false.</returns>
 public bool Equals(IResourceKey x, IResourceKey y)
 {
     return(x.Equals(y));
 }
Ejemplo n.º 4
0
 public bool Equals(IResourceKey x, IResourceKey y) { return x.Equals(y); }