コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }