Added configurable first day of week to the calendar
This commit is contained in:
parent
554677e21f
commit
e0489a9e8a
@ -55,6 +55,11 @@ namespace Outlook2013TodoAddIn
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShowTasks { get; set; }
|
public bool ShowTasks { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets/sets the first day of the week for the calendar
|
||||||
|
/// </summary>
|
||||||
|
public System.DayOfWeek FirstDayOfWeek { get; set; }
|
||||||
|
|
||||||
#endregion "Properties"
|
#endregion "Properties"
|
||||||
|
|
||||||
#region "Methods"
|
#region "Methods"
|
||||||
@ -82,6 +87,7 @@ namespace Outlook2013TodoAddIn
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void RetrieveData()
|
public void RetrieveData()
|
||||||
{
|
{
|
||||||
|
this.apptCalendar.FirstDayOfWeek = this.FirstDayOfWeek;
|
||||||
this.RetrieveAppointments();
|
this.RetrieveAppointments();
|
||||||
if (this.ShowTasks)
|
if (this.ShowTasks)
|
||||||
{
|
{
|
||||||
@ -438,6 +444,7 @@ namespace Outlook2013TodoAddIn
|
|||||||
this.Accounts = cfg.Accounts;
|
this.Accounts = cfg.Accounts;
|
||||||
this.ShowFriendlyGroupHeaders = cfg.ShowFriendlyGroupHeaders;
|
this.ShowFriendlyGroupHeaders = cfg.ShowFriendlyGroupHeaders;
|
||||||
this.ShowTasks = cfg.ShowTasks;
|
this.ShowTasks = cfg.ShowTasks;
|
||||||
|
this.FirstDayOfWeek = cfg.FirstDayOfWeek;
|
||||||
this.RetrieveData();
|
this.RetrieveData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,8 @@
|
|||||||
this.lblAccounts = new System.Windows.Forms.Label();
|
this.lblAccounts = new System.Windows.Forms.Label();
|
||||||
this.chkFriendlyGroupHeaders = new System.Windows.Forms.CheckBox();
|
this.chkFriendlyGroupHeaders = new System.Windows.Forms.CheckBox();
|
||||||
this.chkShowTasks = new System.Windows.Forms.CheckBox();
|
this.chkShowTasks = new System.Windows.Forms.CheckBox();
|
||||||
|
this.cboFirstDayOfWeek = new System.Windows.Forms.ComboBox();
|
||||||
|
this.lblFirstDayOfWeek = new System.Windows.Forms.Label();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numRangeDays)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.numRangeDays)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
@ -85,7 +87,7 @@
|
|||||||
// btnCancel
|
// btnCancel
|
||||||
//
|
//
|
||||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
this.btnCancel.Location = new System.Drawing.Point(168, 314);
|
this.btnCancel.Location = new System.Drawing.Point(168, 374);
|
||||||
this.btnCancel.Name = "btnCancel";
|
this.btnCancel.Name = "btnCancel";
|
||||||
this.btnCancel.Size = new System.Drawing.Size(87, 37);
|
this.btnCancel.Size = new System.Drawing.Size(87, 37);
|
||||||
this.btnCancel.TabIndex = 11;
|
this.btnCancel.TabIndex = 11;
|
||||||
@ -95,7 +97,7 @@
|
|||||||
// btnOK
|
// btnOK
|
||||||
//
|
//
|
||||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||||
this.btnOK.Location = new System.Drawing.Point(26, 314);
|
this.btnOK.Location = new System.Drawing.Point(26, 374);
|
||||||
this.btnOK.Name = "btnOK";
|
this.btnOK.Name = "btnOK";
|
||||||
this.btnOK.Size = new System.Drawing.Size(87, 37);
|
this.btnOK.Size = new System.Drawing.Size(87, 37);
|
||||||
this.btnOK.TabIndex = 10;
|
this.btnOK.TabIndex = 10;
|
||||||
@ -116,7 +118,7 @@
|
|||||||
// chkListCalendars
|
// chkListCalendars
|
||||||
//
|
//
|
||||||
this.chkListCalendars.FormattingEnabled = true;
|
this.chkListCalendars.FormattingEnabled = true;
|
||||||
this.chkListCalendars.Location = new System.Drawing.Point(26, 199);
|
this.chkListCalendars.Location = new System.Drawing.Point(26, 259);
|
||||||
this.chkListCalendars.Name = "chkListCalendars";
|
this.chkListCalendars.Name = "chkListCalendars";
|
||||||
this.chkListCalendars.Size = new System.Drawing.Size(229, 106);
|
this.chkListCalendars.Size = new System.Drawing.Size(229, 106);
|
||||||
this.chkListCalendars.TabIndex = 13;
|
this.chkListCalendars.TabIndex = 13;
|
||||||
@ -124,7 +126,7 @@
|
|||||||
// lblAccounts
|
// lblAccounts
|
||||||
//
|
//
|
||||||
this.lblAccounts.AutoSize = true;
|
this.lblAccounts.AutoSize = true;
|
||||||
this.lblAccounts.Location = new System.Drawing.Point(23, 179);
|
this.lblAccounts.Location = new System.Drawing.Point(23, 239);
|
||||||
this.lblAccounts.Name = "lblAccounts";
|
this.lblAccounts.Name = "lblAccounts";
|
||||||
this.lblAccounts.Size = new System.Drawing.Size(70, 17);
|
this.lblAccounts.Size = new System.Drawing.Size(70, 17);
|
||||||
this.lblAccounts.TabIndex = 14;
|
this.lblAccounts.TabIndex = 14;
|
||||||
@ -150,13 +152,33 @@
|
|||||||
this.chkShowTasks.Text = "Show Tasks";
|
this.chkShowTasks.Text = "Show Tasks";
|
||||||
this.chkShowTasks.UseVisualStyleBackColor = true;
|
this.chkShowTasks.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// cboFirstDayOfWeek
|
||||||
|
//
|
||||||
|
this.cboFirstDayOfWeek.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cboFirstDayOfWeek.FormattingEnabled = true;
|
||||||
|
this.cboFirstDayOfWeek.Location = new System.Drawing.Point(45, 201);
|
||||||
|
this.cboFirstDayOfWeek.Name = "cboFirstDayOfWeek";
|
||||||
|
this.cboFirstDayOfWeek.Size = new System.Drawing.Size(186, 24);
|
||||||
|
this.cboFirstDayOfWeek.TabIndex = 17;
|
||||||
|
//
|
||||||
|
// lblFirstDayOfWeek
|
||||||
|
//
|
||||||
|
this.lblFirstDayOfWeek.AutoSize = true;
|
||||||
|
this.lblFirstDayOfWeek.Location = new System.Drawing.Point(42, 181);
|
||||||
|
this.lblFirstDayOfWeek.Name = "lblFirstDayOfWeek";
|
||||||
|
this.lblFirstDayOfWeek.Size = new System.Drawing.Size(124, 17);
|
||||||
|
this.lblFirstDayOfWeek.TabIndex = 18;
|
||||||
|
this.lblFirstDayOfWeek.Text = "First Day of Week:";
|
||||||
|
//
|
||||||
// FormConfiguration
|
// FormConfiguration
|
||||||
//
|
//
|
||||||
this.AcceptButton = this.btnOK;
|
this.AcceptButton = this.btnOK;
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.CancelButton = this.btnCancel;
|
this.CancelButton = this.btnCancel;
|
||||||
this.ClientSize = new System.Drawing.Size(282, 383);
|
this.ClientSize = new System.Drawing.Size(282, 452);
|
||||||
|
this.Controls.Add(this.lblFirstDayOfWeek);
|
||||||
|
this.Controls.Add(this.cboFirstDayOfWeek);
|
||||||
this.Controls.Add(this.chkShowTasks);
|
this.Controls.Add(this.chkShowTasks);
|
||||||
this.Controls.Add(this.chkFriendlyGroupHeaders);
|
this.Controls.Add(this.chkFriendlyGroupHeaders);
|
||||||
this.Controls.Add(this.lblAccounts);
|
this.Controls.Add(this.lblAccounts);
|
||||||
@ -193,5 +215,7 @@
|
|||||||
private System.Windows.Forms.Label lblAccounts;
|
private System.Windows.Forms.Label lblAccounts;
|
||||||
private System.Windows.Forms.CheckBox chkFriendlyGroupHeaders;
|
private System.Windows.Forms.CheckBox chkFriendlyGroupHeaders;
|
||||||
private System.Windows.Forms.CheckBox chkShowTasks;
|
private System.Windows.Forms.CheckBox chkShowTasks;
|
||||||
|
private System.Windows.Forms.ComboBox cboFirstDayOfWeek;
|
||||||
|
private System.Windows.Forms.Label lblFirstDayOfWeek;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -76,6 +76,15 @@ namespace Outlook2013TodoAddIn.Forms
|
|||||||
set { this.chkShowTasks.Checked = value; }
|
set { this.chkShowTasks.Checked = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets/sets the first day of the week for the calendar
|
||||||
|
/// </summary>
|
||||||
|
public System.DayOfWeek FirstDayOfWeek
|
||||||
|
{
|
||||||
|
get { return (System.DayOfWeek)Enum.Parse(typeof(System.DayOfWeek), this.cboFirstDayOfWeek.SelectedValue.ToString()); }
|
||||||
|
set { this.cboFirstDayOfWeek.SelectedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
#endregion "Properties"
|
#endregion "Properties"
|
||||||
|
|
||||||
#region "Methods"
|
#region "Methods"
|
||||||
@ -101,6 +110,7 @@ namespace Outlook2013TodoAddIn.Forms
|
|||||||
this.chkFriendlyGroupHeaders.Checked = Properties.Settings.Default.ShowFriendlyGroupHeaders;
|
this.chkFriendlyGroupHeaders.Checked = Properties.Settings.Default.ShowFriendlyGroupHeaders;
|
||||||
this.chkShowTasks.Checked = Properties.Settings.Default.ShowTasks;
|
this.chkShowTasks.Checked = Properties.Settings.Default.ShowTasks;
|
||||||
this.LoadStores();
|
this.LoadStores();
|
||||||
|
this.LoadDays();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -116,6 +126,15 @@ namespace Outlook2013TodoAddIn.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loads the available days of the week in the dropdown
|
||||||
|
/// </summary>
|
||||||
|
private void LoadDays()
|
||||||
|
{
|
||||||
|
this.cboFirstDayOfWeek.DataSource = Enum.GetValues(typeof(System.DayOfWeek));
|
||||||
|
this.cboFirstDayOfWeek.SelectedItem = Properties.Settings.Default.FirstDayOfWeek;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clicking the OK button
|
/// Clicking the OK button
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -129,6 +148,7 @@ namespace Outlook2013TodoAddIn.Forms
|
|||||||
Properties.Settings.Default.Accounts = this.Accounts;
|
Properties.Settings.Default.Accounts = this.Accounts;
|
||||||
Properties.Settings.Default.ShowFriendlyGroupHeaders = this.chkFriendlyGroupHeaders.Checked;
|
Properties.Settings.Default.ShowFriendlyGroupHeaders = this.chkFriendlyGroupHeaders.Checked;
|
||||||
Properties.Settings.Default.ShowTasks = this.chkShowTasks.Checked;
|
Properties.Settings.Default.ShowTasks = this.chkShowTasks.Checked;
|
||||||
|
Properties.Settings.Default.FirstDayOfWeek = (System.DayOfWeek)Enum.Parse(typeof(System.DayOfWeek), this.cboFirstDayOfWeek.SelectedValue.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion "Methods"
|
#endregion "Methods"
|
||||||
|
12
Outlook2013TodoAddIn/Properties/Settings.Designer.cs
generated
12
Outlook2013TodoAddIn/Properties/Settings.Designer.cs
generated
@ -129,5 +129,17 @@ namespace Outlook2013TodoAddIn.Properties {
|
|||||||
this["ShowTasks"] = value;
|
this["ShowTasks"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("Sunday")]
|
||||||
|
public global::System.DayOfWeek FirstDayOfWeek {
|
||||||
|
get {
|
||||||
|
return ((global::System.DayOfWeek)(this["FirstDayOfWeek"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["FirstDayOfWeek"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,5 +29,8 @@
|
|||||||
<Setting Name="ShowTasks" Type="System.Boolean" Scope="User">
|
<Setting Name="ShowTasks" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="FirstDayOfWeek" Type="System.DayOfWeek" Scope="User">
|
||||||
|
<Value Profile="(Default)">Sunday</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
@ -45,6 +45,7 @@ namespace Outlook2013TodoAddIn
|
|||||||
this.AppControl.Accounts = Properties.Settings.Default.Accounts;
|
this.AppControl.Accounts = Properties.Settings.Default.Accounts;
|
||||||
this.AppControl.ShowFriendlyGroupHeaders = Properties.Settings.Default.ShowFriendlyGroupHeaders;
|
this.AppControl.ShowFriendlyGroupHeaders = Properties.Settings.Default.ShowFriendlyGroupHeaders;
|
||||||
this.AppControl.ShowTasks = Properties.Settings.Default.ShowTasks;
|
this.AppControl.ShowTasks = Properties.Settings.Default.ShowTasks;
|
||||||
|
this.AppControl.FirstDayOfWeek = Properties.Settings.Default.FirstDayOfWeek;
|
||||||
this.AppControl.NumDays = Properties.Settings.Default.NumDays; // Setting the value will load the appointments
|
this.AppControl.NumDays = Properties.Settings.Default.NumDays; // Setting the value will load the appointments
|
||||||
|
|
||||||
ToDoTaskPane = this.CustomTaskPanes.Add(this.AppControl, "Appointments");
|
ToDoTaskPane = this.CustomTaskPanes.Add(this.AppControl, "Appointments");
|
||||||
|
@ -31,6 +31,9 @@
|
|||||||
<setting name="ShowTasks" serializeAs="String">
|
<setting name="ShowTasks" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="FirstDayOfWeek" serializeAs="String">
|
||||||
|
<value>Sunday</value>
|
||||||
|
</setting>
|
||||||
</Outlook2013TodoAddIn.Properties.Settings>
|
</Outlook2013TodoAddIn.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||||
|
Loading…
Reference in New Issue
Block a user