// // OpenCover - S Wilde // // This source code is released under the MIT License; see the accompanying license file. // using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Xml.Serialization; namespace OpenCover.Framework.Model { /// /// A file reference within the coverage session and is used to point to an existing File entity /// public class FileRef { /// /// The uniqueid of a file in a coverage session /// [XmlAttribute("uid")] public UInt32 UniqueId { get; set; } } /// /// File details of a source file /// public class File : FileRef { private static int _uId; static readonly List Files = new List(); internal static void ResetAfterLoading() { _uId = (int)Files.Max(x => x.UniqueId); } /// /// A standard constructor /// public File() { UniqueId = (UInt32)Interlocked.Increment(ref _uId); Files.Add(this); } /// /// The path to file /// [XmlAttribute("fullPath")] public string FullPath { get; set; } } internal class FileEqualityComparer : IEqualityComparer { public bool Equals(File x, File y) { return x.FullPath == y.FullPath; } public int GetHashCode(File obj) { return 0; } } }