private void SetFilePath(string filePath, string name = null) { FilePathBox.Text = filePath; FilePathBox.CaretIndex = FilePathBox.Text.Length; FilePathBox.ScrollToEnd(); VariableNameBox.Text = name ?? Path.GetFileNameWithoutExtension(filePath); PreviewContentAsync().DoNotWait(); }
private async Task SetFilePathAsync(string filePath, string name = null) { FilePathBox.Text = filePath; FilePathBox.CaretIndex = FilePathBox.Text.Length; FilePathBox.ScrollToEnd(); var variableName = name == null?Path.GetFileNameWithoutExtension(filePath) : name; VariableNameBox.Text = variableName; string text = ReadFile(FilePathBox.Text); InputFilePreview.Text = text; await PreviewAsync(); }