public static void TimeLineGUIValueChange(Window callingWindow)
        {
            switch (GuiData.TimeLineWindow.timeLine.TimeUnitDisplayed)
            {
            case TimeLine.TimeUnit.Millisecond:
                GuiData.TimeLineWindow.currentTimeTextBox.Text = (((TimeLine)callingWindow).CurrentValue * 1000.0).ToString();

                break;

            case TimeLine.TimeUnit.Second:
                GuiData.TimeLineWindow.currentTimeTextBox.Text = ((TimeLine)callingWindow).CurrentValue.ToString();
                break;
            }

            EditorData.SetTime(((TimeLine)callingWindow).CurrentValue);

            // do this only if we click on the window, not drag
            if (GuiManager.Cursor.PrimaryClick)
            {
                EditorData.instructionPlayer.ChangeTime();
            }
        }
        public static void CurrentTimeTextBoxChange(Window callingWindow)
        {
            double currentValue = (float)System.Convert.ToDouble(((TextBox)callingWindow).Text);

            if (GuiData.TimeLineWindow.timeLine.TimeUnitDisplayed == TimeLine.TimeUnit.Millisecond)
            {
                currentValue *= 1000.0;
            }

            if (currentValue < GuiData.TimeLineWindow.timeLine.MinimumValue)
            {
                currentValue = GuiData.TimeLineWindow.timeLine.MinimumValue;
                ((TextBox)callingWindow).Text = currentValue.ToString();
            }
            else if (currentValue > GuiData.TimeLineWindow.timeLine.MaximumValue)
            {
                currentValue = GuiData.TimeLineWindow.timeLine.MaximumValue;
                ((TextBox)callingWindow).Text = currentValue.ToString();
            }


            GuiData.TimeLineWindow.timeLine.CurrentValue = (float)System.Convert.ToDouble(((TextBox)callingWindow).Text);
            EditorData.SetTime(GuiData.TimeLineWindow.timeLine.CurrentValue);
        }