private void Init(FileLocation fileLocation, string parentKey, int offset, int length, FileRoles roles, string mimeType, FileContent contents, string encoding, IEnumerable <Hash> hashes, DateTime lastModifiedTime, IDictionary <string, SerializedPropertyInfo> properties) { if (fileLocation != null) { FileLocation = new FileLocation(fileLocation); } ParentKey = parentKey; Offset = offset; Length = length; Roles = roles; MimeType = mimeType; if (contents != null) { Contents = new FileContent(contents); } Encoding = encoding; if (hashes != null) { var destination_0 = new List <Hash>(); foreach (var value_0 in hashes) { if (value_0 == null) { destination_0.Add(null); } else { destination_0.Add(new Hash(value_0)); } } Hashes = destination_0; } LastModifiedTime = lastModifiedTime; if (properties != null) { Properties = new Dictionary <string, SerializedPropertyInfo>(properties); } }
public bool ValueEquals(FileContent other) => ValueComparer.Equals(this, other);
/// <summary> /// Initializes a new instance of the <see cref="FileData" /> class from the supplied values. /// </summary> /// <param name="fileLocation"> /// An initialization value for the <see cref="P: FileLocation" /> property. /// </param> /// <param name="parentKey"> /// An initialization value for the <see cref="P: ParentKey" /> property. /// </param> /// <param name="offset"> /// An initialization value for the <see cref="P: Offset" /> property. /// </param> /// <param name="length"> /// An initialization value for the <see cref="P: Length" /> property. /// </param> /// <param name="roles"> /// An initialization value for the <see cref="P: Roles" /> property. /// </param> /// <param name="mimeType"> /// An initialization value for the <see cref="P: MimeType" /> property. /// </param> /// <param name="contents"> /// An initialization value for the <see cref="P: Contents" /> property. /// </param> /// <param name="encoding"> /// An initialization value for the <see cref="P: Encoding" /> property. /// </param> /// <param name="hashes"> /// An initialization value for the <see cref="P: Hashes" /> property. /// </param> /// <param name="lastModifiedTime"> /// An initialization value for the <see cref="P: LastModifiedTime" /> property. /// </param> /// <param name="properties"> /// An initialization value for the <see cref="P: Properties" /> property. /// </param> public FileData(FileLocation fileLocation, string parentKey, int offset, int length, FileRoles roles, string mimeType, FileContent contents, string encoding, IEnumerable <Hash> hashes, DateTime lastModifiedTime, IDictionary <string, SerializedPropertyInfo> properties) { Init(fileLocation, parentKey, offset, length, roles, mimeType, contents, encoding, hashes, lastModifiedTime, properties); }