/// <summary> /// Initializes a new instance of the <see cref="CrossReferenceResolverMutableEngine"/> class. /// </summary> /// <param name="objects"> /// The objects. /// </param> /// <param name="sdmxStructureTypes"> /// The SDMX structure types. /// </param> public CrossReferenceResolverMutableEngine(IEnumerable <IMaintainableMutableObject> objects, params SdmxStructureType[] sdmxStructureTypes) : this(sdmxStructureTypes) { if (objects != null) { foreach (var mutableObject in objects) { IStructureReference reference = _fromMutable.Build(mutableObject); this._cache.Add(reference, mutableObject); } } }
/// <summary> /// Initializes a new instance of the <see cref="CachedRetrievalManager"/> class. /// </summary> /// <param name="maintainableMutableObjects"> /// The mutable objects. /// </param> /// <param name="retrievalManager"> /// The retrieval manager. /// </param> public CachedRetrievalManager( IEnumerable <IMaintainableMutableObject> maintainableMutableObjects, ISdmxMutableObjectRetrievalManager retrievalManager) { this._retrievalManager = retrievalManager; this._requestToLatestArtefacts = new Dictionary <IStructureReference, IMaintainableMutableObject>(); this._requestToArtefacts = new DictionaryOfSets <IStructureReference, IMaintainableMutableObject>(); if (maintainableMutableObjects != null) { foreach (IMaintainableMutableObject mutableObject in maintainableMutableObjects) { this._requestToArtefacts.Add(_fromMutable.Build(mutableObject), new HashSet <IMaintainableMutableObject> { mutableObject }); } } }
/// <summary> /// Determines whether the specified objects are equal. /// </summary> /// <returns> /// true if the specified objects are equal; otherwise, false. /// </returns> /// <param name="x"> /// The first object of type <see cref="IMaintainableMutableObject"/> to compare. /// </param> /// <param name="y"> /// The second object of type <see cref="IMaintainableMutableObject"/> to compare. /// </param> public bool Equals(IMaintainableMutableObject x, IMaintainableMutableObject y) { if (ReferenceEquals(x, y)) { return(true); } if (x == null || y == null) { return(false); } IStructureReference firstReference = _fromMutable.Build(x); IStructureReference secondReference = _fromMutable.Build(y); return(firstReference.Equals(secondReference)); }