コード例 #1
0
        /// <summary>
        /// Handles the FindObjects message from a customer.
        /// </summary>
        /// <param name="header">The message header.</param>
        /// <param name="findObjects">The FindObjects message.</param>
        protected virtual void HandleFindObjects(IMessageHeader header, FindObjects findObjects)
        {
            var args = Notify(OnFindObjects, header, findObjects, new DataObjectResponse());

            HandleFindObjects(args);

            if (!args.Cancel)
            {
                FindObjectsResponse(header, args.Context.DataObjects, args.Context.ServerSortOrder);
            }
        }
コード例 #2
0
        /// <summary>
        /// Sends a FindObjects message to a store.
        /// </summary>
        /// <param name="uri">The URI.</param>
        /// <returns>The message identifier.</returns>
        public virtual long FindObjects(string uri)
        {
            var header = CreateMessageHeader(Protocols.StoreQuery, MessageTypes.StoreQuery.FindObjects);

            var findObjects = new FindObjects()
            {
                Uri = uri
            };

            return(Session.SendMessage(header, findObjects,
                                       h => _requests[h.MessageId] = uri // Cache requested URIs by message ID
                                       ));
        }