protected override void RegisterShortcuts(IShortcutManager s) { base.RegisterShortcuts(s); #region Arguments s.RegisterAction($"{Name}::Arguments::Set", b => b.WithSetting <string>(s => s.WithLabel("Arguments")).WithCallback((_, arguments) => Arguments = arguments)); #endregion }
protected override void RegisterShortcuts(IShortcutManager s) { base.RegisterShortcuts(s); #region Endpoint s.RegisterAction($"{Name}::Endpoint::Set", b => b.WithSetting <string>(s => s.WithLabel("Endpoint").WithDescription("ip:port")).WithCallback((_, endpointString) => { if (IPEndPoint.TryParse(endpointString, out var endpoint)) { Endpoint = endpoint; } })); #endregion }
public override void RegisterActions(IShortcutManager s) { base.RegisterActions(s); #region Uri s.RegisterAction($"{Identifier}::Uri::Set", b => b.WithSetting <string>(s => s.WithLabel("Uri").WithDescription("websocket uri")).WithCallback((_, uriString) => { if (Uri.TryCreate(uriString, UriKind.Absolute, out var uri)) { Uri = uri; } })); #endregion }
public override void RegisterActions(IShortcutManager s) { base.RegisterActions(s); #region PipeName s.RegisterAction($"{Identifier}::PipeName::Set", b => b.WithSetting <string>(s => s.WithLabel("Pipe name")).WithCallback((_, pipeName) => PipeName = pipeName)); #endregion }
public override void RegisterActions(IShortcutManager s) { base.RegisterActions(s); #region Endpoint s.RegisterAction($"{Identifier}::Endpoint::Set", b => b.WithSetting <string>(s => s.WithLabel("Endpoint").WithDescription("ip:port")).WithCallback((_, endpointString) => { if (IPEndPoint.TryParse(endpointString, out var endpoint)) { Endpoint = endpoint; } })); #endregion #region Protocol s.RegisterAction($"{Identifier}::Protocol::Set", b => b.WithSetting <ProtocolType?>(s => s.WithLabel("Protocol").WithItemsSource(EnumUtils.GetValues <ProtocolType?>())).WithCallback((_, protocol) => { if (protocol.HasValue) { Protocol = protocol.Value; } })); #endregion }
protected virtual void RegisterShortcuts(IShortcutManager s) { #region AutoConnectEnabled s.RegisterAction($"{Name}::AutoConnectEnabled::Set", b => b.WithSetting <bool>(s => s.WithLabel("Enable auto connect")).WithCallback((_, enabled) => AutoConnectEnabled = enabled)); s.RegisterAction($"{Name}::AutoConnectEnabled::Toggle", b => b.WithCallback(_ => AutoConnectEnabled = !AutoConnectEnabled)); #endregion }
public override void RegisterActions(IShortcutManager s) { base.RegisterActions(s); #region ComPort s.RegisterAction($"{Identifier}::SerialPort::Set", b => b.WithSetting <string>(s => s.WithLabel("Device ID")).WithCallback((_, deviceId) => SelectSerialPortByDeviceId(deviceId))); #endregion }