Exemplo n.º 1
0
        //Get sys info online
        private void button2_Click(object sender, EventArgs e)
        {
            string methodName = new StackTrace(false).GetFrame(0).GetMethod().Name;

            ClearLog();
            try {
                if (CurrentDxc.ReadInfoFromIp())
                {
                    CurrentDxc.SaveToFile(Cfg);
                    InvokeLog("DXC dsp st sys", CurrentDxc.ToString());
                }
                else
                if (CurrentDxc.LoadFromFile(Cfg))
                {
                    ClearLog();
                    InvokeLog("DXC dsp st sys", "Загружено c файла:");
                    InvokeLog("", CurrentDxc.ToString());
                }
                else
                {
                    ClearLog();
                    InvokeLog("DXC info", "Информации не найдено");
                }
            } catch (Exception ex) {
                Log.WriteLog(methodName, ex.Message);
            }
        }
Exemplo n.º 2
0
        //Select DXC in listbox
        void LbAllSelectedIndexChanged(object sender, EventArgs e)
        {
            string methodName = new StackTrace(false).GetFrame(0).GetMethod().Name;

            try
            {
                if (lbAll.SelectedItems.Count != 1)
                {
                    return;
                }
                CurrentDxc = DxcList.Find(x => x.CustomName == lbAll.SelectedItem.ToString());
                ClearLog();
                CurrentDxc.ReadInfoFromIp();
                Help.BeepClick();
                InvokeLog("", CurrentDxc.ToString());
                #region test
                //CurrentDXC.alarms=ReadAlarmsFromFile("test_ALARMS.txt");
                #endregion
                dataGridView1.Rows.Clear();
                ViewDXCAlarmsDGV(CurrentDxc, FromFilter, ToFilter);
            }
            catch (Exception exception)
            {
                Log.WriteLog(methodName, exception.Message);
            }
        }