예제 #1
0
        /// <summary>
        /// Trata a operação de Set de um objeto da MIB sobre um Host
        /// </summary>
        private void setToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!ValidaHostSelecionado())
            {
                return;
            }

            using (var setValue = new MIBObjectSetForm())
            {
                var result = setValue.ShowDialog(this);
                switch (result)
                {
                case DialogResult.OK:
                    try
                    {
                        var req = new SNMPCommunications(SelectedHost, SelectedMibObject);
                        req.Send(setValue.ConvertedValue());
                        SNMPCommunications.Add(req);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    break;

                case DialogResult.Cancel:
                    break;

                default:
                    break;
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Trata a operação de Set de um objeto da MIB sobre um Host
        /// </summary>
        private void setToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!ValidaHostSelecionado())
                return;

            using (var setValue = new MIBObjectSetForm())
            {
                var result = setValue.ShowDialog(this);
                switch (result)
                {
                    case DialogResult.OK:
                        try
                        {
                            var req = new SNMPCommunications(SelectedHost, SelectedMibObject);
                            req.Send(setValue.ConvertedValue());
                            SNMPCommunications.Add(req);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        break;
                    case DialogResult.Cancel:
                        break;
                    default:
                        break;
                }
            }
        }