-
Notifications
You must be signed in to change notification settings - Fork 0
/
SentOnBehalfBCCRibbon.cs
42 lines (39 loc) · 1.33 KB
/
SentOnBehalfBCCRibbon.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Windows.Data;
using Microsoft.Office.Tools.Ribbon;
namespace SentOnBehalfBCC
{
public partial class SentOnBehalfBCCRibbon
{
private void MyRibbon_Load(object sender, RibbonUIEventArgs e)
{
this.EnableToggle.Image =
Properties.Settings.Default.AddInEnabled ?
Properties.Resources.toggle_on_solid :
Properties.Resources.toggle_off_solid;
}
private void EnableToggle_Click(object sender, RibbonControlEventArgs e)
{
if (this.EnableToggle.Checked)
{
this.EnableToggle.Image = Properties.Resources.toggle_on_solid;
this.MailText.Enabled = true;
}
else
{
this.EnableToggle.Image = Properties.Resources.toggle_off_solid;
this.MailText.Enabled = false;
}
Properties.Settings.Default.AddInEnabled = this.EnableToggle.Checked;
}
private void MailText_TextChanged(object sender, RibbonControlEventArgs e)
{
Properties.Settings.Default.MailText = (sender as RibbonEditBox)?.Text;
}
}
}