예제 #1
0
        private void CheckIfOidsBuiltCorrectly()
        {
            ListOidEnt listNotFound = new ListOidEnt();

            foreach (OidEnt oidInfo in _listOids)
            {
                string oidValue = GetOidValue(oidInfo.Parent);

                if (oidValue.Contains(HP_OID))
                {
                    if (oidValue[0].Equals('.'))
                    {
                        oidValue = oidValue.Substring(1);
                    }
                }
                else
                {
                    oidValue = HP_OID + oidValue;
                }
                oidValue += "." + oidInfo.Value;
                // The parent values aren't building correctly
                if (!oidValue.Equals(oidInfo.OidString))
                {
                    OidEnt temp = new OidEnt(oidInfo);

                    temp.OidIndex      = oidValue;
                    temp.OidIndexValue = string.Empty;
                    temp.Usage         = USAGES.eUnknown;

                    listNotFound.Add(temp);
                }
            }
            if (listNotFound.Count > 0)
            {
                WriteFile wf = new WriteFile(listNotFound);
                wf.WritePartOInfoFile();
                MessageBox.Show(listNotFound.Count.ToString() + " building of parent values not matching stated MIB OID.");
            }
        }
예제 #2
0
        private void MnuFileSave_Click(object sender, EventArgs e)
        {
            string filePath = string.Empty;

            saveDlg                  = new SaveFileDialog();
            saveDlg.Filter           = FILTERS_CSV;
            saveDlg.RestoreDirectory = true;
            saveDlg.FileName         = "FullOidListing.csv";
            if (saveDlg.ShowDialog() == DialogResult.OK)
            {
                if ((filePath = saveDlg.FileName) != string.Empty)
                {
                    WriteFile wf = new WriteFile(_listOids);
                    wf.SaveDirectory = Path.GetDirectoryName(saveDlg.FileName);
                    wf.FileName      = Path.GetFileName(saveDlg.FileName);
                    wf.WriteOidGridData();
                    if (wf.IsError)
                    {
                        MessageBox.Show(wf.GetLastError);
                    }
                }
            }
        }