/// <summary> /// Indicates the current AutoDial status for a specific TAPI dialing location. /// </summary> /// <param name="dialingLocation">The dialing location whose status to check.</param> /// <returns><b>true</b> if the AutoDial feature is currently enabled for the dialing location, otherwise <b>false</b>.</returns> public bool GetAutoDialEnable(int dialingLocation) { RasGetAutodialEnableParams info = new RasGetAutodialEnableParams(); info.DialingLocation = dialingLocation; try { int ret = UnsafeNativeMethods.Instance.GetAutodialEnable(info); if (ret != NativeMethods.SUCCESS) { ThrowHelper.ThrowRasException(ret); } } catch (EntryPointNotFoundException) { ThrowHelper.ThrowNotSupportedException(Resources.Exception_NotSupportedOnPlatform); } return info.Enabled; }
/// <summary> /// Indicates whether the AutoDial feature is enabled for a specific TAPI dialing location. /// </summary> /// <param name="value">An <see cref="RasGetAutodialEnableParams"/> containing call data.</param> /// <returns>If the function succeeds, the return value is zero.</returns> public int GetAutodialEnable(RasGetAutodialEnableParams value) { if (value == null) { ThrowHelper.ThrowArgumentNullException("value"); } bool enabled = value.Enabled; PInvokeCallTraceEvent evt = new PInvokeCallTraceEvent(NativeMethods.RasApi32Dll, "RasGetAutodialEnable"); evt.Data.Add("enabled-IN", enabled); int result = 0; try { result = UnsafeNativeMethods.RasGetAutodialEnable(value.DialingLocation, ref enabled); evt.ResultCode = result; evt.Data.Add("enabled-OUT", enabled); value.Enabled = enabled; } finally { DiagnosticTrace.Default.TraceEvent(TraceEventType.Verbose, evt); } return result; }
/// <summary> /// Indicates whether the AutoDial feature is enabled for a specific TAPI dialing location. /// </summary> /// <param name="value">An <see cref="RasGetAutodialEnableParams"/> containing call data.</param> /// <returns>If the function succeeds, the return value is zero.</returns> public int GetAutodialEnable(RasGetAutodialEnableParams value) { bool enabled = value.Enabled; int ret = UnsafeNativeMethods.RasGetAutodialEnable(value.DialingLocation, ref enabled); value.Enabled = enabled; return ret; }