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(); } } }
/// <summary> /// Закрытие текущего реле /// </summary> public void CloseRelay() { if (relay != null) { try { relay.Utility.Reset(); relay.Close(); relay = null; } catch (Exception ex) { warningSWITCH(_name, "Невозможно закрыть сессию " + ex.Message); } } }
void Init(string topology) { relay = new NISwitch(_name, topology, false, true); relay.DriverOperation.Warning += DriverOperation_Warning; }
private void InitializeSwitchSession() { switchSession = new NISwitch(ResourceName, TopologyName, false, true); switchSession.DriverOperation.Warning += new System.EventHandler <SwitchWarningEventArgs>(DriverOperationWarning); }