/// <summary> /// Sets the decoded well-known attribute data (except the early data) on the bag in a thread safe manner. /// Stored decoded data is immutable and cannot be updated further. /// </summary> /// <returns>Returns true if decoded data were stored into the bag on this thread.</returns> public bool SetDecodedWellKnownAttributeData(WellKnownAttributeData data) { WellKnownAttributeData.Seal(data); var setOnOurThread = Interlocked.CompareExchange(ref _decodedWellKnownAttributeData, data, null) == null; NotePartComplete(CustomAttributeBagCompletionPart.DecodedWellKnownAttributeData); return(setOnOurThread); }
public bool SetDecodedWellKnownAttributeData(WellKnownAttributeData data) { WellKnownAttributeData.Seal(data); // Early decode must complete before full decode Debug.Assert(IsPartComplete(CustomAttributeBagCompletionPart.EarlyDecodedWellKnownAttributeData)); var setOnOurThread = Interlocked.CompareExchange(ref _decodedWellKnownAttributeData, data, null) == null; NotePartComplete(CustomAttributeBagCompletionPart.DecodedWellKnownAttributeData); return(setOnOurThread); }