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); }
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"); }
private void ChangeColor(DiaryPreferences diaryPreferences) { this.BackColor = diaryPreferences.Color; this.ForeColor = diaryPreferences.FontColor; this.TextBox.BackColor = diaryPreferences.Color; this.TextBox.ForeColor = diaryPreferences.FontColor; }
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); }
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; }
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); }
/// <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; }
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); } }
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); } }
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"); }
public Aboutform(DiaryPreferences diaryPreferences) { InitializeComponent(); ChangeColor(diaryPreferences); }