/// <summary>
        /// Replaces a list item in a growing object.
        /// </summary>
        /// <param name="uri">The URI of the parent object.</param>
        /// <param name="uid">The ID of the element within the list.</param>
        /// <param name="contentType">The content type string for the parent object.</param>
        /// <param name="data">The data (list items) to be added to the growing object.</param>
        /// <param name="startIndex">The start index.</param>
        /// <param name="endIndex">The end index.</param>
        /// <param name="uom">The unit of measure.</param>
        /// <param name="depthDatum">The depth datum.</param>
        /// <param name="includeOverlappingIntervals"><c>true</c> if overlapping intervals should be included; otherwise, <c>false</c>.</param>
        /// <returns>The message identifier.</returns>
        public long ReplacePartsByRange(string uri, string uid, string contentType, byte[] data, object startIndex, object endIndex, string uom, string depthDatum, bool includeOverlappingIntervals)
        {
            var header = CreateMessageHeader(Protocols.GrowingObject, MessageTypes.GrowingObject.ReplacePartsByRange);

            var message = new ReplacePartsByRange
            {
                Uri            = uri,
                Uid            = uid,
                ContentType    = contentType,
                Data           = data,
                DeleteInterval = new IndexInterval
                {
                    StartIndex = new IndexValue {
                        Item = startIndex
                    },
                    EndIndex = new IndexValue {
                        Item = endIndex
                    },
                    Uom        = uom,
                    DepthDatum = depthDatum
                },
                IncludeOverlappingIntervals = includeOverlappingIntervals
            };

            return(Session.SendMessage(header, message));
        }
Beispiel #2
0
        /// <summary>
        /// Sends a ReplacePartsByRange message to a store.
        /// </summary>
        /// <param name="uri">The URI of the parent object.</param>
        /// <param name="deleteInterval">The index interval to delete.</param>
        /// <param name="includeOverlappingIntervals"><c>true</c> if overlapping intervals should be included; otherwise, <c>false</c>.</param>
        /// <param name="parts">The map of UIDs and data of the parts being put.</param>
        /// <param name="format">The format of the data (XML or JSON).</param>
        /// <param name="isFinalPart">Whether or not this is the final part of a multi-part message.</param>
        /// <param name="correlatedHeader">The message header that the message to send is correlated with.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ReplacePartsByRange> ReplacePartsByRange(string uri, IndexInterval deleteInterval, bool includeOverlappingIntervals, IList <ObjectPart> parts, string format = Formats.Xml, bool isFinalPart = true, IMessageHeader correlatedHeader = null, IMessageHeaderExtension extension = null)
        {
            var body = new ReplacePartsByRange
            {
                Uri            = uri ?? string.Empty,
                Format         = format ?? Formats.Xml,
                DeleteInterval = deleteInterval,
                IncludeOverlappingIntervals = includeOverlappingIntervals,
                Parts = parts ?? new List <ObjectPart>(),
            };

            return(SendRequest(body, extension: extension, isMultiPart: true, correlatedHeader: correlatedHeader, isFinalPart: isFinalPart));
        }
 /// <summary>
 /// Handles the ReplacePartsByRange message from a store.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="message">The ReplacePartsByRange message.</param>
 protected virtual void HandleReplacePartsByRange(IMessageHeader header, ReplacePartsByRange message)
 {
     Notify(OnReplacePartsByRange, header, message);
 }