示例#1
0
        /*
         * string GetPageTypeName(TestTypeID.Test_Type type)
         * {
         *  switch (type)
         *  {
         *      case TestTypeID.Test_Type.Classic:
         *          return Strings.ResStrings.Answers;
         *      case TestTypeID.Test_Type.Form:
         *          return Strings.ResStrings.Page;
         *      default:
         *          return "";
         *  }
         * }*/


        private void TestTypeCall_OnClick(int Pos, object sender)
        {
            SaveCanvas();

            Debug.WriteLine("POS:  " + Pos + "    Sender:" + ((TestType_ControlN)sender).test_type);

            FrameEditor.NavigationService.LoadCompleted -= NavigationService_LoadCompleted;
            FrameEditor.NavigationService.LoadCompleted += NavigationService_LoadCompleted;

            FrameEditor.Content = new Page_Form();
            FrameEditor.NavigationService.RemoveBackEntry();

            if (LastSelected != null)
            {
                LastSelected.Select(false);
            }

            ((TestType_ControlN)sender).Select(true);
            LastSelected = (TestType_ControlN)sender;

            SelectedPosition = Pos;

            ValueEditor.Content = "";

            HistoryRedo.Clear();
            HistoryUndo.Clear();

            Undo_MI.IsEnabled = false;
            Redo_MI.IsEnabled = false;

            LoadCanvas();
        }
示例#2
0
        private void HistoryUndo_OnAdd(object sender, EventArgs e)
        {
            HistoryRedo.Clear();
            Redo_MI.IsEnabled = false;
            Undo_MI.IsEnabled = true;

            MainWindow.IsChanged = true;

            if (HistoryUndo.Count >= HistoryLimit)
            {
                HistoryUndo.RemoveAt(0);
            }
        }