Changeset 2188


Ignore:
Timestamp:
6/18/2010 11:54:53 AM (2 years ago)
Author:
lowjoel
Message:

Define the PhysicalDriveInfo?.Equals function to check whether two VolumeInfo? instances are equal (it is a class type but should exhibit value type behaviour)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.Util/PhysicalDriveInfo.cs

    r2187 r2188  
    189189        } 
    190190 
     191        public override bool Equals(object obj) 
     192        { 
     193            PhysicalDriveInfo info = obj as PhysicalDriveInfo; 
     194            if (info == null) 
     195                return base.Equals(obj); 
     196 
     197            return Index == info.Index; 
     198        } 
     199 
     200        public override int GetHashCode() 
     201        { 
     202            return Index.GetHashCode(); 
     203        } 
     204 
    191205        /// <summary> 
    192206        /// The format string for accessing partitions. 
Note: See TracChangeset for help on using the changeset viewer.