Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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();
        }