コード例 #1
0
        public PrefForm(string pathTOAdudio, Color fontColor, Color color)
        {
            InitializeComponent();

            try
            {
                DiaryPreferences = new DiaryPreferences(Environment.CurrentDirectory.ToString() + @"\Ring.mp3"
                                                        , Color.Black
                                                        , Color.LightSalmon);
            }
            catch (ArgumentException exception)
            {
                MessageBox.Show(exception.Message, "Что-то пошло не так", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }


            fontDialog.ShowColor = true;
            colorDialog.FullOpen = true;
            _pathTOFile          = pathTOAdudio;
            _fontColor           = fontColor;
            _color = color;
            var lastIndex = pathTOAdudio.LastIndexOf(@"\");

            AuidoNameLabel.Text = pathTOAdudio.Substring(lastIndex + 1);
            ChangeColor(_fontColor, _color);
        }
コード例 #2
0
        public void NegativeConstructorDiaryPrefTest(string path, string fontColorString, string colorString)
        {
            var color     = Color.FromName(colorString);
            var fontColor = Color.FromName(fontColorString);

            Assert.Throws <ArgumentException>(() => { DiaryPreferences diaryPreferences = new DiaryPreferences(path, fontColor, color); }, "Error");
        }
コード例 #3
0
ファイル: Aboutform.cs プロジェクト: notUniqueUsername/diary
 private void ChangeColor(DiaryPreferences diaryPreferences)
 {
     this.BackColor         = diaryPreferences.Color;
     this.ForeColor         = diaryPreferences.FontColor;
     this.TextBox.BackColor = diaryPreferences.Color;
     this.TextBox.ForeColor = diaryPreferences.FontColor;
 }
コード例 #4
0
        public void ConstructorDiaryPrefTest()
        {
            DiaryPreferences diaryPreferences = new DiaryPreferences(_path, _fontColor, _color);

            Assert.AreEqual(_color, diaryPreferences.Color);
            Assert.AreEqual(_fontColor, diaryPreferences.FontColor);
            Assert.AreEqual(Environment.CurrentDirectory.ToString() + @"\Ring.mp3", diaryPreferences.AudioPath);
        }
コード例 #5
0
 private void ChangeColor(DiaryPreferences diaryPreferences)
 {
     this.BackColor           = diaryPreferences.Color;
     this.ForeColor           = diaryPreferences.FontColor;
     RemindCheckBox.BackColor = diaryPreferences.Color;
     RemindCheckBox.ForeColor = diaryPreferences.FontColor;
     NameTextBox.ForeColor    = diaryPreferences.FontColor;
     NameTextBox.BackColor    = Color.DarkTurquoise;
 }
コード例 #6
0
 public AddTaskForm(DiaryPreferences diaryPreferences)
 {
     InitializeComponent();
     TaskTimePicker.CustomFormat   = "dd.MM.yyyy - HH:mm";
     RemindTimePicker.CustomFormat = "dd.MM.yyyy - HH:mm";
     RemindTimePicker.Enabled      = false;
     RedactPictureBox.Visible      = false;
     ChangeColor(diaryPreferences);
 }
コード例 #7
0
ファイル: mainForm.cs プロジェクト: notUniqueUsername/diary
 /// <summary>
 /// Изменение цвета шрифта и фона.
 /// </summary>
 /// <param name="diaryPreferences"></param>
 private void ChangeColorAndFontColor(DiaryPreferences diaryPreferences)
 {
     this.BackColor = diaryPreferences.Color;
     this.ForeColor = diaryPreferences.FontColor;
     DiaryMainMenuStrip.BackColor = diaryPreferences.Color;
     DiaryMainMenuStrip.ForeColor = diaryPreferences.FontColor;
     FindListBox.BackColor        = diaryPreferences.Color;
     FindListBox.ForeColor        = diaryPreferences.FontColor;
     TaskListBox.BackColor        = diaryPreferences.Color;
     TaskListBox.ForeColor        = diaryPreferences.FontColor;
 }
コード例 #8
0
ファイル: mainForm.cs プロジェクト: notUniqueUsername/diary
        private void PrefsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var prefForm = new PrefForm(_diaryPreferences.AudioPath, _diaryPreferences.FontColor, _diaryPreferences.Color);

            if (prefForm.ShowDialog() == DialogResult.OK)
            {
                _diaryPreferences = prefForm.DiaryPreferences;
                sp = new DiarySoundPlayer(_diaryPreferences.AudioPath);
                ChangeColorAndFontColor(_diaryPreferences);
            }
        }
コード例 #9
0
 private void Accept_Click(object sender, EventArgs e)
 {
     try
     {
         DiaryPreferences = new DiaryPreferences(_pathTOFile, _fontColor, _color);
         DialogResult     = DialogResult.OK;
     }
     catch (ArgumentException exception)
     {
         MessageBox.Show(exception.Message, "Что-то пошло не так", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #10
0
        public void Setup()
        {
            _diaryPreferences = new DiaryPreferences(@"C:\Users\Valeriy\Desktop\diary\diary\DiaryApp\DiaryAppUnitTests" + @"\-click-nice_1.mp3"
                                                     , Color.Black
                                                     , Color.LightSalmon);
            string name = "";

            for (int i = 0; i < 3; i++)
            {
                name       = i.ToString();
                _diaryTask = new DiaryTask(name, DateTime.Now, false);
                _diaryTasks.Add(_diaryTask);
            }
            _diaryTaskList = new DiaryTaskList(_diaryTasks);
            File.CreateText(@"D:\games\DiaryTest.diary");
        }
コード例 #11
0
ファイル: Aboutform.cs プロジェクト: notUniqueUsername/diary
 public Aboutform(DiaryPreferences diaryPreferences)
 {
     InitializeComponent();
     ChangeColor(diaryPreferences);
 }