Beispiel #1
0
 public void WriteXml(System.Xml.XmlWriter writer)
 {
     writer.WriteStartElement("skin");
     writer.WriteElementString("skinName", SkinName);
     writer.WriteElementString("inUse", InUse.ToString());
     writer.WriteEndElement();
 }
Beispiel #2
0
        /// <summary>
        /// Returns true if TagValidation instances are equal
        /// </summary>
        /// <param name="other">Instance of TagValidation to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(TagValidation other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Tag == other.Tag ||
                     Tag != null &&
                     Tag.Equals(other.Tag)
                     ) &&
                 (
                     InUse == other.InUse ||
                     InUse != null &&
                     InUse.Equals(other.InUse)
                 ) &&
                 (
                     IsValid == other.IsValid ||
                     IsValid != null &&
                     IsValid.Equals(other.IsValid)
                 ));
        }
Beispiel #3
0
        /// <summary>
        /// Implement IDisposable.
        /// </summary>
        public override void Dispose()
        {
            TK.GL.DeleteTexture(Handle);
            Handle = -1;

            IsDisposed = true;
            InUse.Remove(this);
        }
Beispiel #4
0
 /// <summary>
 ///
 /// </summary>
 public Texture()
 {
     Handle = -1;
     if (InUse == null)
     {
         InUse = new List <Texture>();
     }
     InUse.Add(this);
 }
        public void WriteXml(XmlWriter writer)
        {
            //Write start of main elemenst
            writer.WriteStartElement("skin");

            writer.WriteElementString("skinName", SkinName);
            writer.WriteElementString("inUse", InUse.ToString());

            //Write end of Host Info
            writer.WriteEndElement();
        }
Beispiel #6
0
        public override int GetHashCode()
        {
            var hash = Name == null ? 0 : Name.GetHashCode();

            hash += Acquired.GetHashCode();
            hash += Category.GetHashCode();
            hash += SubCategory == null ? 0 : SubCategory.GetHashCode();
            hash += InUse.GetHashCode();
            hash += Owner == null ? 0 : Owner.GetHashCode();
            hash += PartOf == null ? 0 : PartOf.GetHashCode();
            return(hash);
        }
Beispiel #7
0
        /// <summary>
        /// Constructor
        /// </summary>
        public TileSet()
        {
            Scale = new Vector2(1.0f, 1.0f);
            tiles = new Dictionary <int, Tile>();

            IsDisposed = false;

            if (InUse == null)
            {
                InUse = new List <TileSet>();
            }
            InUse.Add(this);
        }
Beispiel #8
0
        /// <summary>
        /// Implement IDisposable.
        /// </summary>
        public void Dispose()
        {
            if (Texture != null)
            {
                Texture.Dispose();
            }
            Texture = null;

            Scale = new Vector2(1, 1);
            tiles.Clear();
            TextureName = "";
            Name        = "";

            IsDisposed = true;
            InUse.Remove(this);

            GC.SuppressFinalize(this);
        }
Beispiel #9
0
        protected override void EndProcessing()
        {
            var idRanges = IdRange.Invoke(Path, ObjectType).Select(o => o.BaseObject).Cast <ObjectIdRange>();
            var reserved = Reserved.Invoke(Path, ObjectType).Select(o => o.BaseObject).Cast <ObjectIdInfo>();
            var inUse    = InUse.Invoke(Path, ObjectType, Recurse).Select(o => o.BaseObject).Cast <ObjectIdInfo>();

            if (MyInvocation.BoundParameters.ContainsKey(nameof(ObjectType)))
            {
                idRanges = idRanges.Where(r => ObjectType.Contains(r.ObjectType));
                reserved = reserved.Where(r => ObjectType.Contains(r.ObjectType));
                inUse    = inUse.Where(o => ObjectType.Contains(o.ObjectType));
            }

            switch (Summary.IsPresent)
            {
            case true: WriteSummary(idRanges, reserved, inUse); break;

            case false: WriteDetails(idRanges, reserved, inUse); break;
            }
        }
Beispiel #10
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Tag != null)
         {
             hashCode = hashCode * 59 + Tag.GetHashCode();
         }
         if (InUse != null)
         {
             hashCode = hashCode * 59 + InUse.GetHashCode();
         }
         if (IsValid != null)
         {
             hashCode = hashCode * 59 + IsValid.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #11
0
 /// <summary>
 ///
 /// </summary>
 public override void Dispose()
 {
     IsDisposed = true;
     InUse.Remove(this);
 }