Пример #1
0
 private void PingButton_Click(object sender, RoutedEventArgs e)
 {
     //TODO: make me work to ping each node
     foreach (GingerNodeInfo GNI in  mGingerGrid.NodeList)
     {
         GingerNodeProxy GNA = new GingerNodeProxy(GNI);
         GNA.Reserve();
         string rc = GNA.Ping();
         GNI.Ping = rc;
         GNA.Disconnect();
     }
 }
Пример #2
0
 private void xPingButton_Click(object sender, RoutedEventArgs e)
 {
     foreach (GingerNodeInfo GNI in  mGingerGrid.NodeList)
     {
         GingerNodeProxy GNA = new GingerNodeProxy(GNI);
         GNA.GingerGrid = WorkSpace.Instance.LocalGingerGrid;
         GNA.Reserve();
         string rc = GNA.Ping();
         GNI.Ping = rc;
         GNA.Disconnect();
     }
     ShowProcesses();
 }
Пример #3
0
        public void Close()
        {
            try
            {
                if (AgentType == eAgentType.Service)
                {
                    if (gingerNodeInfo != null)
                    {
                        // this is plugin driver on local machine

                        GingerNodeProxy.GingerGrid = WorkSpace.Instance.LocalGingerGrid;
                        GingerNodeProxy.CloseDriver();


                        gingerNodeInfo.Status = GingerNodeInfo.eStatus.Ready;


                        if (mProcess != null) // it means a new plugin process was started for this agent - so we close it
                        {
                            // Remove the node from the grid
                            WorkSpace.Instance.LocalGingerGrid.NodeList.Remove(gingerNodeInfo);

                            // Close the plugin process
                            mProcess.CloseMainWindow();
                        }

                        GingerNodeProxy = null;
                        gingerNodeInfo  = null;

                        return;
                    }
                    else
                    {
                        if (GingerNodeProxy != null)
                        {
                            // Running on Remote Grid
                            GingerNodeProxy.CloseDriver();
                            GingerNodeProxy.Disconnect();
                            GingerNodeProxy = null;
                        }
                    }
                }
                if (Driver == null)
                {
                    return;
                }

                Driver.IsDriverRunning = false;
                if (Driver.Dispatcher != null)
                {
                    Driver.Dispatcher.Invoke(() =>
                    {
                        Driver.CloseDriver();
                        Thread.Sleep(1000);
                    });
                }
                else
                {
                    Driver.CloseDriver();
                }

                if (MSTATask != null)
                {
                    // Using cancellation token source to cancel
                    CancelTask         = new BackgroundWorker();
                    CancelTask.DoWork += new DoWorkEventHandler(CancelTMSTATask);
                    CancelTask.RunWorkerAsync();
                }

                Driver = null;
            }
            finally
            {
                OnPropertyChanged(Fields.Status);
                OnPropertyChanged(Fields.IsWindowExplorerSupportReady);
            }
        }