Ejemplo n.º 1
0
            public override void Execute()
            {
                lock (runner.operationsMutex)
                {
                    if (runner.NodeValueReady != null) // If an event handler is registered.
                    {
                        NodeValueReadyEventArgs retArgs = null;

                        try
                        {
                            // Now that background worker is free, get the value...
                            ProtoCore.Mirror.RuntimeMirror mirror = runner.InternalGetNodeValue(nodeId);
                            if (null != mirror)
                            {
                                retArgs = new NodeValueReadyEventArgs(mirror, nodeId);

                                System.Diagnostics.Debug.WriteLine("Node {0} => {1}",
                                                                   nodeId.ToString("x8"), mirror.GetData().GetStackValue());
                            }
                            else
                            {
                                retArgs = new NodeValueNotAvailableEventArgs(nodeId);
                            }
                        }
                        catch (Exception e)
                        {
                            retArgs = new NodeValueReadyEventArgs(null, nodeId, EventStatus.Error, e.ToString());
                        }

                        if (null != retArgs)
                        {
                            runner.NodeValueReady(this, retArgs); // Notify all listeners (e.g. UI).
                        }
                    }
                }
            }
Ejemplo n.º 2
0
 /// <summary>
 /// NodeValueReady event handler.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NodeValueReady(object sender, NodeValueReadyEventArgs e)
 {
     if (EventStatus.OK == e.ResultStatus)
     {
     }
 }
Ejemplo n.º 3
0
            public override void Execute()
            {
                lock (runner.operationsMutex)
                {
                    if (runner.NodeValueReady != null) // If an event handler is registered.
                    {
                        NodeValueReadyEventArgs retArgs = null;

                        try
                        {
                            // Now that background worker is free, get the value...
                            ProtoCore.Mirror.RuntimeMirror mirror = runner.InternalGetNodeValue(nodeId);
                            if (null != mirror)
                            {
                                retArgs = new NodeValueReadyEventArgs(mirror, nodeId);

                                System.Diagnostics.Debug.WriteLine("Node {0} => {1}",
                                    nodeId.ToString("x8"), mirror.GetData().GetStackValue());
                            }
                            else
                            {
                                retArgs = new NodeValueNotAvailableEventArgs(nodeId);
                            }

                        }
                        catch (Exception e)
                        {
                            retArgs = new NodeValueReadyEventArgs(null, nodeId, EventStatus.Error, e.ToString());
                        }

                        if (null != retArgs)
                        {
                            runner.NodeValueReady(this, retArgs); // Notify all listeners (e.g. UI).
                        }
                    }
                }
            }