public object Clone() { MicrosoftImageRegionInfo cloneRegionInfo = new MicrosoftImageRegionInfo(); cloneRegionInfo.Regions = new List <MicrosoftImageRegion>(); foreach (MicrosoftImageRegion region in this.Regions) { cloneRegionInfo.Regions.Add(region.Clone() as MicrosoftImageRegion); } return(cloneRegionInfo); }
public override bool Equals(object unknownObject) { if (unknownObject is MicrosoftImageRegionInfo) { MicrosoftImageRegionInfo compareRegionInfo = unknownObject as MicrosoftImageRegionInfo; if (compareRegionInfo.Regions.Count == this.Regions.Count) { for (int i = 0; i < this.Regions.Count; i++) { // If region is not the same, return false if (!this.Regions[i].Equals(compareRegionInfo.Regions[i])) { return(false); } } // All regions must be the same return(true); } } return(false); }