Пример #1
0
 /// <summary>
 /// When you are done with a feature and driver you must call this function to free up resources.
 /// If your application is likely to be run exclusively on the unit, it is recommendable that you open and close an MHL feature handle only once during the lifetime of the application.
 /// Do not make code that opens and closes the feature rapidly and very often, it is extremely inefficient.
 /// </summary>
 /// <exception cref="System.ArgumentException">If exceptions are enabled, on failure exception is thrown with valid error message.</exception>
 /// <returns>true on success, false on failure.</returns>
 /// <remarks>On failure, use GetLastError() ot GetLastErrorMessage() for more information.</remarks>
 public bool Close()
 {
     if (IsOpen())
     {
         if (MHLSRV._MHL_CloseDrv(loadedDrvHandle) == 0)
         {
             if (throwsException)
             {
                 throw new System.ArgumentException("Cannot close driver " + loadedDrvName, "Error " + this.GetLastError().ToString() + "; " + this.GetLastErrorMessage());
             }
         }
         loadedDrvHandle = -1;
         loadedDrvName   = "";
         return(true);
     }
     return(false);
 }
Пример #2
0
 /// <summary>PROVIDED ONLY FOR BACKWARD COMPATIBILITY. Please use new HotkeyHelper class.</summary>
 /// <remarks>PROVIDED ONLY FOR BACKWARD COMPATIBILITY. Please use new MHLDriver class.</remarks>
 public int CloseDrv(int handle)
 {
     return(MHLSRV._MHL_CloseDrv(handle));
 }