private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // Dispose managed state (managed objects). _propCreator = null; if (ComparerField is IDisposable disable1) { disable1.Dispose(); } if (_propInitialValueField is IDisposable disable2) { disable2.Dispose(); } if (InitialValueCooked is IDisposable disable3) { disable3.Dispose(); } } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }
// Complete public PropItemModel ( Type type, string name, PropStorageStrategyEnum storageStrategy, bool typeIsSolid, PropKindEnum propKind, ITypeInfoField propTypeInfoField, IPropInitialValueField initialValueField, object extraInfo, IPropComparerField comparer, Type itemType, IPropBinderField binderField, IMapperRequest mapperRequest, PropCreatorType propCreator ) { PropertyType = type; PropertyName = name; ExtraInfo = extraInfo; StorageStrategy = storageStrategy; TypeIsSolid = typeIsSolid; PropKind = propKind; PropTypeInfoField = _propTypeInfoField; InitialValueField = initialValueField; ComparerField = comparer; _itemType = itemType; _propBinderField = binderField; _mapperRequest = mapperRequest; _propCreator = propCreator; InitialValueCooked = null; }