Example #1
0
        private void InitFarmButton_Click(object sender, EventArgs e)
        {
            if (actFarm != null)
            {
                MessageBox.Show("there is already an open farm instance ...");
                return;
            }
            try
            {
                if (fs == null)
                {
                    fs = ConnectionDetail.ConnectionDetailFactory()["local"];
                }

                actFarm = new ComputeFarm.ComputeFarm(fs, null);
                actFarm.Init();
            }
            catch (Exception exc)
            {
            }
            if (actFarm != null && actFarm.IsOpen)
            {
                MessageBox.Show("Local Farm Instance Is OK");
            }
            else
            {
                MessageBox.Show("Could not create local farm");
                thisClientID = "";
                actFarm      = null;
            }
        }
        protected override void OnStart(string[] args)
        {
            myEventLog.WriteEntry("Service Starting");
            baseTimer          = new System.Timers.Timer();
            baseTimer.Interval = 1000;
            baseTimer.Elapsed += new System.Timers.ElapsedEventHandler(this.OnTimer);
            baseTimer.Start();
            myEventLog.WriteEntry("Service Started");

            thisFarm = new ComputeFarm.ComputeFarm(myEventLog);
            thisFarm.Init();
        }
Example #3
0
        private void DisconnectFarmButton_Click(object sender, EventArgs e)
        {
            if (myFarmProxy != null)
            {
                DisconnectFabricButton_Click(sender, e);
            }

            // disconnect farm
            actFarm.Shutdown();
            actFarm = null;
            MessageBox.Show("Farm instance closed");
        }