/// <summary> /// Opens the COM interface for live view control. /// </summary> /// <returns>true if successfull and false if not.</returns> private bool GetAtmoLiveViewControl() { if (atmoRemoteControl == null) { return(false); } Log.Debug("AtmoWinHandler - Getting AtmoWin Live View Control."); if (TimeoutHandler(() => atmoLiveViewControl = (IAtmoLiveViewControl)Marshal.GetActiveObject("AtmoRemoteControl.1"))) { Log.Debug("AtmoWinHandler - Successfully got AtmoWin Live View 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 for live view control. /// </summary> /// <returns>true if successfull and false if not.</returns> private bool GetAtmoLiveViewControl() { if (atmoRemoteControl == null) { return false; } Log.Debug("AtmoWinHandler - Getting AtmoWin Live View Control."); if (TimeoutHandler(() => atmoLiveViewControl = (IAtmoLiveViewControl)Marshal.GetActiveObject("AtmoRemoteControl.1"))) { Log.Debug("AtmoWinHandler - Successfully got AtmoWin Live View 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; }