/// <summary> /// Opens the COM interface to AtmoWin. /// </summary> /// <returns></returns> private bool GetAtmoRemoteControl() { Log.Debug("AtmoWinHandler - Getting AtmoWin Remote Control."); if (TimeoutHandler(() => atmoRemoteControl = (IAtmoRemoteControl)Marshal.GetActiveObject("AtmoRemoteControl.1"))) { Log.Debug("AtmoWinHandler - Successfully got AtmoWin Remote Control."); return(true); } return(false); }
/// <summary> /// Disconnect from AtmoWin. /// </summary> /// <returns>true or false</returns> public bool Disconnect() { Log.Debug("AtmoWinHandler - Disconnecting from AtmoWin."); StopGetAtmoLiveViewSourceThread(); if (atmoRemoteControl != null) { Marshal.ReleaseComObject(atmoRemoteControl); atmoRemoteControl = null; } if (atmoLiveViewControl != null) { Marshal.ReleaseComObject(atmoLiveViewControl); atmoLiveViewControl = null; } // Sleep timer to avoid Windows being to quick upon COM port unlocking Thread.Sleep(1500); return(true); }
/// <summary> /// Opens the COM interface to AtmoWin. /// </summary> /// <returns></returns> private bool GetAtmoRemoteControl() { Log.Debug("AtmoWinHandler - Getting AtmoWin Remote Control."); if (TimeoutHandler(() => atmoRemoteControl = (IAtmoRemoteControl)Marshal.GetActiveObject("AtmoRemoteControl.1"))) { Log.Debug("AtmoWinHandler - Successfully got AtmoWin Remote Control."); return true; } return false; }
/// <summary> /// Disconnect from AtmoWin. /// </summary> /// <returns>true or false</returns> public bool Disconnect() { Log.Debug("AtmoWinHandler - Disconnecting from AtmoWin."); StopGetAtmoLiveViewSourceThread(); if (atmoRemoteControl != null) { Marshal.ReleaseComObject(atmoRemoteControl); atmoRemoteControl = null; } if (atmoLiveViewControl != null) { Marshal.ReleaseComObject(atmoLiveViewControl); atmoLiveViewControl = null; } return true; }
/// <summary> /// Disconnect from AtmoWin. /// </summary> /// <returns>true or false</returns> public bool Disconnect() { Log.Debug("AtmoWinHandler - Disconnecting from AtmoWin."); StopGetAtmoLiveViewSourceThread(); if (atmoRemoteControl != null) { Marshal.ReleaseComObject(atmoRemoteControl); atmoRemoteControl = null; } if (atmoLiveViewControl != null) { Marshal.ReleaseComObject(atmoLiveViewControl); atmoLiveViewControl = null; } // Sleep timer to avoid Windows being to quick upon COM port unlocking Thread.Sleep(1500); return true; }