Beispiel #1
0
 private void LoadCode()
 {
     if (!File.Exists(_path))
     {
         var popup = new PopupMessage("File does not exist", "Please check your path and try again!");
         popup.ShowDialog();
         return;
     }
     TextBoxCode.Text = File.ReadAllText(_path);
 }
Beispiel #2
0
        private void ButtonCopyCode_Click(object sender, RoutedEventArgs e)
        {
            if (!File.Exists(_path))
            {
                var popup = new PopupMessage("File does not exist", "Please check your path and try again!");
                popup.ShowDialog();
                return;
            }

            Clipboard.SetData(DataFormats.Text, File.ReadAllText(_path));

            SnackbarInfo.IsActive = true;
            var task = new Task(() =>
            {
                Thread.Sleep(3000);
                Dispatcher.Invoke(() =>
                {
                    SnackbarInfo.IsActive = false;
                });
            });

            task.Start();
        }