public PathTransaction CreateTransaction(string pathName) { IPathContext context = GetContext(pathName); IPathTransaction t = context.CreateTransaction(); PathTransaction transaction = new PathTransaction(service, ++connId, context, t); transactions[transaction.Id] = transaction; return transaction; }
public void RemoveTransaction(PathTransaction transaction) { bool removed = transactions.Remove(transaction.Id); if (!removed) throw new InvalidOperationException(); }
private ClientRequestMessage GetMethodRequest(RequestType type, PathTransaction transaction, Stream requestStream) { ClientRequestMessage request = new ClientRequestMessage(Type, type, transaction.Transaction); if (requestStream != null) { Message streamedRequest = MessageSerializer.Deserialize(requestStream, MessageType.Request); foreach(KeyValuePair<string, object> attribute in streamedRequest.Attributes) { request.Attributes.Add(attribute.Key, attribute.Value); } foreach(MessageArgument argument in streamedRequest.Arguments) { request.Arguments.Add(argument); } } return request; }