public async Task PingTrackerToggle(OnOff onOff) { bool success = false; switch (onOff) { case OnOff.On: success = await DepMap.TryEnable <PingTracker>(); break; case OnOff.Off: success = await DepMap.TryDisable <PingTracker>(); break; } var action = onOff.ToString().ToLower(); if (!success) { await Context.ReplyAsync($":warning: The Ping Tracker is already {action}"); } else { await Context.ReplyAsync($"The Ping Tracker has been turned {action}"); } }
public void GetStationPINEnabled() { SetNotSupportedErrorCallback(); OnOff enabled = jbc_api.GetStationPINEnabled(station_id); Debug.WriteLine("STATION ID:" + station_id + "ENABLED: " + enabled.ToString()); }
public void GetStationLocked() { SetNotSupportedErrorCallback(); OnOff locked = jbc_api.GetStationLocked(station_id); Debug.WriteLine("STATION ID:" + station_id + " LOCKED: " + locked.ToString()); }
public void GetStationBeep() { if (features.DisplaySettings) { OnOff beep = jbc_api.GetStationBeep(station_id); Debug.WriteLine("STATION ID:" + station_id + " BEEP: " + beep.ToString()); } else { Debug.WriteLine("Function not implemented for this model"); } }
public void GetStationHelpText() { if (features.DisplaySettings) { OnOff text = jbc_api.GetStationHelpText(station_id); Debug.WriteLine("STATION ID:" + station_id + " HELP TEXT: " + text.ToString()); } else { Debug.WriteLine("Function not implemented for this model"); } }
public void GetStationN2Mode() { if (features.DisplaySettings) { OnOff n2_mode = jbc_api.GetStationN2Mode(station_id); Debug.WriteLine("STATION ID:" + station_id + " N2 MODE: " + n2_mode.ToString()); } else { Debug.WriteLine("Function not implemented for this model"); } }
/// <summary> /// Switch autoactivate on or off. /// </summary> /// <param name="mode">Set autoactivation <c>On</c> or <c>Off</c>. Default is <c>On</c>.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="stringBuilder"/> is <c>null</c>.</exception> public static void AutoActivate(this StringBuilder stringBuilder, OnOff mode = OnOff.On) { if (stringBuilder is null) { throw new ArgumentNullException(nameof(stringBuilder)); } stringBuilder.Append(Constant.Auto); stringBuilder.Append(Constant.Activate); stringBuilder.Append(Constant.Space); stringBuilder.Append(mode.ToString().ToLowerInvariant()); stringBuilder.AppendNewLine(); }
public void GetRemoteMode() { OnOff remote_mode = jbc_api.GetRemoteMode(station_id); Trace.WriteLine("REMOTE MODE: " + remote_mode.ToString()); }
public string SetAutoCarvePolicy(OnOff state) { return(ExecuteCommand(AMCC_3Ware_State.TW_CLI_path, TW_CLI_ParameterType.SetAutoCarvePolicy, CtlID, state.ToString().ToLower())); }
public string SetCache(OnOff state, bool quiet) { var parameter = quiet ? TW_CLI_ParameterType.UnitSetCacheQuiet : TW_CLI_ParameterType.UnitSetCache; return(ExecuteCommand(AMCC_3Ware_State.TW_CLI_path, parameter, CtlID, UnitID.ToString(), state.ToString().ToLower())); }
public string SetIgnoreECC(OnOff state) { return(ExecuteCommand(AMCC_3Ware_State.TW_CLI_path, TW_CLI_ParameterType.UnitSetIgnoreECC, CtlID, UnitID.ToString(), state.ToString().ToLower())); }