public MainWindow() { InitializeComponent(); Loaded += OnLoaded; var token = GetTokenFromConfigs(); TokenTextBox.Text = token; _sender = new CloudKeyboardSender(HostInfo.BaseUrl, token, () => new TypingText( TypingTextBox.Text, TypingTextBox.SelectionStart, TypingTextBox.SelectionStart + TypingTextBox.SelectionLength)); _sender.TargetUpdated += OnTargetUpdated; _sender.ExceptionOccurred += OnExceptionOccurred; }
public MainWindow() { InitializeComponent(); Loaded += OnLoaded; _configFile = File.Exists("configs.fkv") ? "configs.fkv" : Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Walterlv.CloudKeyboard", "configs.fkv"); var token = GetTokenFromConfigs(); TokenTextBox.Text = token; _sender = new CloudKeyboardSender(HostInfo.BaseUrl, token, () => new TypingText( TypingTextBox.Text, TypingTextBox.SelectionStart, TypingTextBox.SelectionStart + TypingTextBox.SelectionLength)); _sender.TargetUpdated += OnTargetUpdated; _sender.ExceptionOccurred += OnExceptionOccurred; }