示例#1
0
 public void Monitor(RemoteObject remoteObject)
 {
     remoteObject.Execute(() =>
     {
         var invoker = new RemoteHelper(remoteObject);
         return(invoker.WriteVariable(this));
     });
 }
示例#2
0
 public Variant Write(RemoteObject remoteObject)
 {
     return(remoteObject.Execute(() =>
     {
         var invoker = new RemoteHelper(remoteObject);
         return invoker.WriteVariable(this);
     }));
 }
示例#3
0
 public void Announce(RemoteObject remoteObject)
 {
     remoteObject.Execute(() =>
     {
         var remoteHelper = new RemoteHelper(remoteObject);
         remoteHelper.MonitorDataChange(this, remoteObject);
         return(Variant.Null);
     });
 }
示例#4
0
 public void Monitor(Dictionary <string, Action <Variant> > monitors)
 {
     Execute(() =>
     {
         var rh = new RemoteHelper(this);
         rh.MonitorDataChanges(monitors.Keys.Select(name => new RemoteDataMonitor
         {
             Name     = name,
             Value    = Variant.Null,
             Callback = monitors[name]
         })
                               .ToList(), this);
         return(Variant.Null);
     });
 }
示例#5
0
        public Variant Invoke(RemoteObject remoteObject)
        {
            var methodNodeId = NodeId.Null;

            if (remoteObject.NodeIdCache.ContainsKey(Name))
            {
                methodNodeId = remoteObject.NodeIdCache[Name];
            }

            var result = remoteObject.Execute(() =>
            {
                var invoker = new RemoteHelper(remoteObject);
                return(invoker.CallMethod(this, ref methodNodeId));
            });

            if (methodNodeId != NodeId.Null && !remoteObject.NodeIdCache.ContainsKey(Name))
            {
                remoteObject.NodeIdCache[Name] = methodNodeId;
            }

            return(result);
        }