コード例 #1
0
        /// <summary>
        /// This constructor for hide and if i choose edit will show the variable for types of question
        /// </summary>
        public QuestionsInformation(TypeOfChoice AddOrEdit)
        {
            try
            {
                InitializeComponent();
                InitHide();
                NewText.Focus();
                AddOrEditChoice = AddOrEdit;
                switch (AddOrEdit)
                {
                case TypeOfChoice.Edit:
                    //For Change Ttitle
                    this.Text = Survey.Properties.Messages.TitleOfQuestionEdit;
                    ShowDataForEdit();
                    if (ReturnNewQuestion != null)
                    {
                        switch (ReturnNewQuestion.TypeOfQuestion)
                        {
                        case TypeOfQuestion.Slider:
                            ShowForSlider();
                            break;

                        case TypeOfQuestion.Smily:
                            ShowForSmiles();
                            break;

                        case TypeOfQuestion.Stars:
                            ShowForStars();
                            break;
                        }
                    }
                    break;

                case TypeOfChoice.Add:
                    this.Text            = Survey.Properties.Messages.TitleOfQuestionAdd;
                    GroupOfTypes.Visible = true;
                    InitHide();
                    break;
                }
            }
            catch (Exception ex)
            {
                GenralVariables.Errors.Log(ex.Message);
                MessageBox.Show(Survey.Properties.Messages.MessageError);
            }
        }
コード例 #2
0
 /// <summary>
 /// This constructor for hide and if i choose edit will show the variable for types of question
 /// </summary>
 public QuestionsInformation(Qustions QuestionWillDeleteOrEdit, string AddOrEdit)
 {
     InitializeComponent();
     InitHide();
     this.QuestionWillDeleteOrEdit = QuestionWillDeleteOrEdit;
     NewText.Focus();
     AddOrEdirChoice = AddOrEdit;
     try
     {
         if (TypeOfChoice.Edit.ToString() == AddOrEdit)
         {
             this.Text            = Survey.Properties.Resource1.TitleOfQuestionEdit;
             GroupOfTypes.Visible = false;
             ShowDataForEdit();
             if (QuestionWillDeleteOrEdit != null)
             {
                 if (TypeOfQuestion.Slider.ToString() == QuestionWillDeleteOrEdit.TypeOfQuestion)
                 {
                     ShowForSlider();
                 }
                 else if (TypeOfQuestion.Smily.ToString() == QuestionWillDeleteOrEdit.TypeOfQuestion)
                 {
                     ShowForSmiles();
                 }
                 else if (TypeOfQuestion.Stars.ToString() == QuestionWillDeleteOrEdit.TypeOfQuestion)
                 {
                     ShowForStars();
                 }
             }
         }
         else if (TypeOfChoice.Add.ToString() == AddOrEdit)
         {
             this.Text            = Survey.Properties.Resource1.TitleOfQuestionAdd;
             GroupOfTypes.Visible = true;
             InitHide();
         }
     }
     catch (Exception ex)
     {
         StaticObjects.Erros.Log(ex);
         MessageBox.Show(Survey.Properties.Resource1.MessageError);
     }
 }