示例#1
0
        private void Act_StopThreadAndShutdown(DataGridViewRow row)
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndShutdown);

            if (dataGridView.InvokeRequired)
            {
                dataGridView.Invoke(de, row);
            }
            else
            {
                lock (row)
                {
                    string host = row.Cells["Host"].Value.ToString();

                    osManager.BeginShutdown(row, host);

                    lock (threadList)
                    {
                        if (threadList.ContainsKey(row))
                        {
                            threadList[row].Abort(null);

                            Thread.Sleep(5000);
                        }
                    }

                    pinger.BeginStart(host, row);
                }
            }
        }
示例#2
0
        private void Act_RemoveItem(DataGridViewRow row)
        {
            if (dataGridView.InvokeRequired)
            {
                DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_RemoveItem);
                dataGridView.Invoke(de, row);
            }
            else
            {
                pinger.BeginStop(row);

                lock (row)
                {
                    lock (threadList)
                    {
                        if (threadList.ContainsKey(row))
                        {
                            threadList[row].Abort(null);
                            threadList.Remove(row);
                        }
                    }

                    dataGridView.Rows.Remove(row);
                }
            }
        }
示例#3
0
        private void Act_StopThreadAndReboot(DataGridViewRow row)
        {
            if (dataGridView.InvokeRequired)
            {
                DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndReboot);
                dataGridView.Invoke(de, row);
            }
            else
            {
                lock (row)
                {
                    string host = row.Cells["Host"].Value.ToString();

                    osManager.BeginReboot(row, host);

                    lock (threadList)
                    {
                        if (threadList.ContainsKey(row))
                        {
                            DgvUtils.SetRowValue(ref row, WUCollums.Status, "WU Aborting, wait ...");

                            threadList[row].Abort(null);

                            Thread.Sleep(5000);
                        }
                    }

                    if (chkBoxEnablePingAfterBoot.Checked == true)
                    {
                        pinger.BeginStart(host, row);
                    }
                }
            }
        }
示例#4
0
 private void Act_ShutdownSelectedItens()
 {
     foreach (DataGridViewRow row in InvertSelectedRowOrder(dataGridView.SelectedRows))
     {
         DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndShutdown);
         de.BeginInvoke(row, null, null);
     }
 }
示例#5
0
 private void Act_ResetAuthorizationOnWsusSelectedItens()
 {
     foreach (DataGridViewRow row in InvertSelectedRowOrder(dataGridView.SelectedRows))
     {
         DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_ResetAuthorizationOnWsus);
         de.BeginInvoke(row, null, null);
     }
 }
示例#6
0
 private void Act_RebootSelectedItens()
 {
     foreach (DataGridViewRow row in dataGridView.SelectedRows)
     {
         DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndReboot);
         de.BeginInvoke(row, null, null);
     }
 }
示例#7
0
        private void validateImapCredentialsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_CheckImapCredentials);

            foreach (DataGridViewRow row in dtGridMbx.SelectedRows)
            {
                de.BeginInvoke(row, null, null);
            }
        }
示例#8
0
        private void startImapSyncToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StartSync);

            foreach (DataGridViewRow row in dtGridMbx.SelectedRows)
            {
                de.BeginInvoke(row, null, null);
            }
        }
示例#9
0
        private void Act_InstallUpdateInSelectedItens()
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_InstallUpdates);

            foreach (DataGridViewRow row in InvertSelectedRowOrder(dataGridView.SelectedRows))
            {
                de.BeginInvoke(row, null, null);
            }
        }
示例#10
0
        private void getEWSMailboxSizeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StartMbxSize);

            foreach (DataGridViewRow row in dtGridMbx.SelectedRows)
            {
                de.BeginInvoke(row, null, null);
            }
        }
示例#11
0
        private void Act_CountUpdatesSelectedItens()
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_CountUpdates);

            foreach (DataGridViewRow row in dataGridView.SelectedRows)
            {
                de.BeginInvoke(row, null, null);
            }
        }
示例#12
0
        private void Act_StartCheckRebootSelectedItens()
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StartCheckReboot);

            foreach (DataGridViewRow row in dataGridView.SelectedRows)
            {
                de.BeginInvoke(row, null, null);
            }
        }
示例#13
0
        private void removeItensToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(RemoveItem);

            foreach (DataGridViewRow row in dtGridMbx.SelectedRows)
            {
                //RemoveItem(row);
                de.BeginInvoke(row, null, null);
            }
        }
示例#14
0
        private void RemoveItem(DataGridViewRow row)
        {
            if (dtGridMbx.InvokeRequired)
            {
                DataGridViewRowDelegate de = new DataGridViewRowDelegate(RemoveItem);
                dtGridMbx.Invoke(de, row);
            }
            else
            {
                lock (row)
                {
                    lock (threadList)
                    {
                        if (threadList.ContainsKey(row))
                        {
                            threadList[row].Abort(null);
                            threadList.Remove(row);
                        }
                    }

                    dtGridMbx.Rows.Remove(row);
                }
            }
        }
示例#15
0
        private void Act_InstallUpdateInSelectedItens()
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_InstallUpdates);

            foreach (DataGridViewRow row in dataGridView.SelectedRows)
            {
                de.BeginInvoke(row, null, null);
            }
        }
示例#16
0
        private void Act_RemoveItem(DataGridViewRow row)
        {
            if (dataGridView.InvokeRequired)
            {
                DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_RemoveItem);
                dataGridView.Invoke(de, row);
            }
            else
            {
                pinger.BeginStop(row);

                lock (row)
                {
                    lock (threadList)
                    {
                        if (threadList.ContainsKey(row))
                        {
                            threadList[row].Abort(null);
                            threadList.Remove(row);
                        }
                    }

                    dataGridView.Rows.Remove(row);
                }
            }
        }
示例#17
0
        private void Act_RemoveSelectedItens()
        {
            DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_RemoveItem);

            foreach (DataGridViewRow row in dataGridView.SelectedRows)
            {
                de.BeginInvoke(row, null, null);
            }
        }
示例#18
0
        private void Act_StopThreadAndReboot(DataGridViewRow row)
        {
            if (dataGridView.InvokeRequired)
            {
                DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndReboot);
                dataGridView.Invoke(de, row);
            }
            else
            {
                lock (row)
                {
                    string host = row.Cells["Host"].Value.ToString();
                    pinger.BeginStart(host, row);

                    lock (threadList)
                    {
                        if (threadList.ContainsKey(row))
                        {
                            DgvUtils.SetRowValue(ref row, WUCollums.Status, "WU Aborting, wait ...");

                            threadList[row].Abort(null);

                            Thread.Sleep(5000);
                        }
                    }

                    osManager.BeginReboot(row, host);
                }
            }
        }
示例#19
0
 private void Act_RebootSelectedItens()
 {
     foreach (DataGridViewRow row in dataGridView.SelectedRows)
     {
         DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndReboot);
         de.BeginInvoke(row, null, null);
     }
 }