I'm still learning C# and I need some help here.
I have a dispatchtimer that checks every second if datetime has initialized.
It works but the problem is that it continues to do same thing until datetime is over.
For example I want datetime to start NotePad. The problem is that dispatchtimer looks for datetime every 1 second which means that notepad starts everyone second.
How can I stop the DispatchTimer when DateTime has started it methods?

Here is code:

```
    private void Start_Click(object sender, RoutedEventArgs e) //Button start.
    {
        test();
    }
    private void startjob() //DateTime checking for DateValue and start's if correct value.
    {
        DateTime? start = DateTimePicker1.Value;
        DateTime? end = DateTimePicker2.Value;
        DateTime now = DateTime.Now;

        if (start == null || end == null)
        {
            Xceed.Wpf.Toolkit.MessageBox.Show("one of the pickers is empty");
        }
        else if (now >= start.Value && now <= end.Value)
        {
            Process notePad = new Process();

            notePad.StartInfo.FileName = "notepad.exe";

            notePad.Start();

        }
    }
    private void test() // DispatchTimer
    {
        DispatcherTimer dispatcherTimer = new DispatcherTimer();
        dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
        dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1);
        dispatcherTimer.Start();
    }

        private void dispatcherTimer_Tick(object sender, EventArgs e)
{           
    try
    {
        startjob();
    }
    catch (Exception)
    {

    } 

```