Ejemplo n.º 1
0
        public void UpdateTextFromFile()
        {
            var text = string.Join(Environment.NewLine, File.ReadLines(Conf.timespentFile).Reverse());

            Doc.Blocks.Clear();
            Doc.Blocks.Add(new Paragraph(new Run(text)));

            MainText.Focus();
            MainText.ScrollToHome();
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            progSetting  = Convert.ToInt32(txtProgTimer.Text);
            countSetting = Convert.ToInt32(txtCountdown.Text);
            progCurrent  = progSetting;
            countCurrent = countSetting;

            RunningTimer = new DispatcherTimer
            {
                Interval = new TimeSpan(10_000_000) // 10 million ticks = 1 second
            };
            RunningTimer.Tick   += new EventHandler(OnTick);
            running              = false;
            complete             = false;
            SaveButton.IsEnabled = false;

            safetext = "";

            MainText.Focus();
        }