Ejemplo n.º 1
0
 /// <summary>
 /// Gets the blip targeted by this operation, creating a data document if it does not exist.
 /// </summary>
 /// <param name="target"></param>
 /// <returns>blip targeted by this operation, never null</returns>
 private IBlipData GetTargetBlip(IWaveletData target)
 {
     return target.GetDocument(BlipId) 
         ?? target.CreateDocument(BlipId, Context.Creator,
             new Collection<ParticipantId> { Context.Creator }, 
             EmptyDocument.Empty,
             Context.Timestamp, target.Version + Context.VersionIncrement);            
 }
Ejemplo n.º 2
0
        private VersionUpdateOperation DoApplyInternal(IWaveletData wavelet)
        {
            HashedVersion oldHashedVersion = wavelet.HashedVersion;
            if (string.IsNullOrEmpty(_docId))
            {
                // Update blip version.
                var blip = (IBlipData) wavelet.GetDocument(_docId);
                long newWaveletVersion = wavelet.Version + Context.VersionIncrement;
                long newDocVersion = _useFixedBlipInfo ? _docVersion : newWaveletVersion;
                long oldDocVersion = blip.LastModifiedVersion = newDocVersion;

                return new VersionUpdateOperation(Context.Creator, -Context.VersionIncrement, oldHashedVersion, _docId,
                    oldDocVersion, true);
            }
            return new VersionUpdateOperation(Context.Creator, -Context.VersionIncrement, oldHashedVersion);
        }