Ejemplo n.º 1
0
 private void CloseSession()
 {
     if (switchSession != null)
     {
         try
         {
             switchSession.Close();
             switchSession = null;
         }
         catch (System.Exception ex)
         {
             ShowError("Unable to Close Session, Reset the device.\n" + "Error : " + ex.Message);
             Application.Exit();
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Закрытие текущего реле
 /// </summary>
 public void CloseRelay()
 {
     if (relay != null)
     {
         try
         {
             relay.Utility.Reset();
             relay.Close();
             relay = null;
         }
         catch (Exception ex)
         {
             warningSWITCH(_name, "Невозможно закрыть сессию  " + ex.Message);
         }
     }
 }
Ejemplo n.º 3
0
 void Init(string topology)
 {
     relay = new NISwitch(_name, topology, false, true);
     relay.DriverOperation.Warning += DriverOperation_Warning;
 }
Ejemplo n.º 4
0
 private void InitializeSwitchSession()
 {
     switchSession = new NISwitch(ResourceName, TopologyName, false, true);
     switchSession.DriverOperation.Warning += new System.EventHandler <SwitchWarningEventArgs>(DriverOperationWarning);
 }