コード例 #1
0
ファイル: PathClientService.cs プロジェクト: ikvm/cloudb
 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;
 }
コード例 #2
0
ファイル: PathClientService.cs プロジェクト: ikvm/cloudb
 public void RemoveTransaction(PathTransaction transaction)
 {
     bool removed = transactions.Remove(transaction.Id);
     if (!removed)
         throw new InvalidOperationException();
 }
コード例 #3
0
ファイル: PathClientService.cs プロジェクト: ikvm/cloudb
 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;
 }