From 71477cf6cf0a50c181ebddf4179ceaf039973d07 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 23 Dec 2017 01:46:08 +0000 Subject: [PATCH] DOCUMENTATION: Added XML documentation to DiscImageChef.Core. --- MediaType.cs | 4 +++- MediaTypeFromSCSI.cs | 11 +++++++++++ Partition.cs | 15 +++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/MediaType.cs b/MediaType.cs index 635df2c..ccd57e4 100644 --- a/MediaType.cs +++ b/MediaType.cs @@ -34,7 +34,9 @@ // TODO: Rename contents namespace DiscImageChef.CommonTypes { - // Media (disk, cartridge, tape, cassette, etc) types + /// + /// Contains an enumeration of all known types of media. + /// public enum MediaType { /// Unknown disk type diff --git a/MediaTypeFromSCSI.cs b/MediaTypeFromSCSI.cs index 23e638e..3f9d011 100644 --- a/MediaTypeFromSCSI.cs +++ b/MediaTypeFromSCSI.cs @@ -37,6 +37,17 @@ namespace DiscImageChef.CommonTypes #pragma warning disable RECS0063 // Warns when a culture-aware 'StartsWith' call is used by default. public static class MediaTypeFromScsi { + /// + /// Tries to guess, from SCSI information, the media type of a device and/or its inserted media + /// + /// The SCSI Peripheral Type as indicated in the INQUIRY response + /// The vendor string of the device + /// The model string of the device + /// The medium type byte from MODE SENSE + /// The density type byte from MODE SENSE + /// How many blocks are on the media + /// Size in bytes of each block + /// public static MediaType Get(byte scsiPeripheralType, string vendor, string model, byte mediumType, byte densityCode, ulong blocks, uint blockSize) { diff --git a/Partition.cs b/Partition.cs index e931bc7..2494d47 100644 --- a/Partition.cs +++ b/Partition.cs @@ -56,13 +56,15 @@ namespace DiscImageChef.CommonTypes /// Information that does not find space in this struct public string Description; /// LBA of last partition sector - public ulong End - { - get => Start + Length - 1; - } + public ulong End => Start + Length - 1; /// Name of partition scheme that contains this partition public string Scheme; + /// + /// Compares two partitions + /// + /// Partition to compare with + /// 0 if both partitions start and end at the same sector public bool Equals(Partition other) { return Start == other.Start && Length == other.Length; @@ -80,6 +82,11 @@ namespace DiscImageChef.CommonTypes return Start.GetHashCode() + End.GetHashCode(); } + /// + /// Compares this partition with another and returns an integer that indicates whether the current partition precedes, follows, or is in the same place as the other partition. + /// + /// Partition to compare with + /// A value that indicates the relative equality of the partitions being compared. public int CompareTo(Partition other) { if(Start == other.Start && End == other.End) return 0;