protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: 释放托管状态(托管对象) } // TODO: 释放未托管的资源(未托管的对象)并替代终结器 //if (null != BondsContours) //{ // BondsContours.Dispose(); // BondsContours = null; //} //if (null != WiresRegions) //{ // WiresRegions.Dispose(); // WiresRegions = null; //} if (null != DetectIterms) { foreach (string key in DetectIterms.Keys) { if (DetectIterms[key] != null) { DetectIterms[key].Dispose(); } } DetectIterms = null; } if (null != DiesErrorRegions) { foreach (HObject[] ha in DiesErrorRegions) { if (null != ha) { foreach (HObject ho in ha) { ho.Dispose(); } } } DiesErrorRegions = null; } if (null != DetectDiesImages) { foreach (HObject ho in DetectDiesImages) { ho.Dispose(); } DetectDiesImages = null; } if (null != WireRegion) { WireRegion.Dispose(); WireRegion = null; } // TODO: 将大型字段设置为 null disposedValue = true; } }
public DlafFovDetectResult Clone() { DlafFovDetectResult ret = new DlafFovDetectResult(); ret.ICRow = ICRow; ret.ICCol = ICCol; ret.FovName = FovName; ret.DetectDiesRows = DetectDiesRows; ret.DetectDiesCols = DetectDiesCols; ret.DiesErrorCodes = DiesErrorCodes; ret.DiesErrorTaskNames = DiesErrorTaskNames; //非托管对象 if (null != DiesErrorRegions) { ret.DiesErrorRegions = new HObject[DiesErrorRegions.Length][]; for (int i = 0; i < DiesErrorRegions.Length; i++) { if (DiesErrorRegions[i] == null) { ret.DiesErrorRegions[i] = null; } else { ret.DiesErrorRegions[i] = new HObject[DiesErrorRegions[i].Length]; for (int j = 0; j < DiesErrorRegions[i].Length; j++) { ret.DiesErrorRegions[i][j] = DiesErrorRegions[i][j].CopyObj(1, -1);//Clone(); } } } } else { ret.DiesErrorRegions = DiesErrorRegions; } if (null != DetectIterms) { ret.DetectIterms = new Dictionary <string, HObject>(); foreach (string key in DetectIterms.Keys) { HObject val = DetectIterms[key]; if (null == val) { ret.DetectIterms.Add(key, null); } else { ret.DetectIterms.Add(key, val.Clone()); } } } else { ret.DetectIterms = null; } if (null != DetectDiesImages) { ret.DetectDiesImages = new HObject[DetectDiesImages.Length]; for (int i = 0; i < DetectDiesImages.Length; i++) { ret.DetectDiesImages[i] = DetectDiesImages[i].Clone(); } } else { ret.DetectDiesImages = null; } if (null != WireRegion) { ret.WireRegion = WireRegion.Clone(); } else { ret.WireRegion = null; } return(ret); }