Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
 /// <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;
 }
Exemplo n.º 4
0
        /// <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;
        }
Exemplo n.º 5
0
    /// <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;
    }