Ejemplo n.º 1
0
 private void Resolver_ReferenceResurrected(object sender, ProxyObjectBaseEventArgs e)
 {
     Send(SocketMessage.Create(
              SocketMessage.SocketMessageType.ProxyResurrected,
              e.Proxy,
              string.Empty,
              0,
              null));
 }
Ejemplo n.º 2
0
 public T GetRootObject <T>()
 {
     try
     {
         var queryMessage = SocketMessage.Create(SocketMessage.SocketMessageType.RootQuery, null, null, 0, null);
         var response     = SendAndGetResponse <T>(queryMessage);
         return(response);
     }
     catch (Exception e)
     {
         Logger.Error(e, $"From {nameof(GetRootObject)}:");
         throw;
     }
 }
Ejemplo n.º 3
0
 public void Set(ProxyObjectBase dto, object value, string propertyName)
 {
     try
     {
         var queryMessage = SocketMessage.Create(
             SocketMessage.SocketMessageType.Set,
             dto,
             propertyName,
             1,
             value);
         SendAndGetResponse <object>(queryMessage);
     }
     catch (Exception e)
     {
         Logger.Error("From Set {0}: {1}", dto, e);
         throw;
     }
 }
Ejemplo n.º 4
0
 public void EventRemove(ProxyObjectBase dto, string eventName)
 {
     try
     {
         var queryMessage = SocketMessage.Create(
             SocketMessage.SocketMessageType.EventRemove,
             dto,
             eventName,
             0,
             null);
         SendAndGetResponse <object>(queryMessage);
     }
     catch (Exception e)
     {
         Logger.Error("From Invoke {0}: {1}", dto, e);
         throw;
     }
 }
Ejemplo n.º 5
0
 public T Get <T>(ProxyObjectBase dto, string propertyName)
 {
     try
     {
         var queryMessage = SocketMessage.Create(
             SocketMessage.SocketMessageType.Get,
             dto,
             propertyName,
             0,
             null
             );
         return(SendAndGetResponse <T>(queryMessage));
     }
     catch (Exception e)
     {
         Logger.Error("From Get {0}: {1}", dto, e);
         throw;
     }
 }
Ejemplo n.º 6
0
 public void Invoke(ProxyObjectBase dto, string methodName, params object[] parameters)
 {
     try
     {
         var queryMessage = SocketMessage.Create(
             SocketMessage.SocketMessageType.Query,
             dto,
             methodName,
             parameters.Length,
             new SocketMessageArrayValue {
             Value = parameters
         });
         SendAndGetResponse <object>(queryMessage);
     }
     catch (Exception e)
     {
         Logger.Error("From Invoke {0}: {1}", dto, e);
         throw;
     }
 }