Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #22

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Days Counter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include=".editorconfig" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
Expand All @@ -161,6 +162,9 @@
</ItemGroup>
<ItemGroup>
<Content Include="logo.ico" />
<None Include="Resources\document-small.png" />
<None Include="Resources\clipboard.png" />
<None Include="Resources\calendar-small.png" />
<None Include="Resources\application-blue.png" />
<None Include="Resources\application.png" />
<None Include="Resources\calendar-day.png" />
Expand Down
5 changes: 5 additions & 0 deletions Days Counter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ VisualStudioVersion = 16.0.29509.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Days Counter", "Days Counter.csproj", "{FC6B9DFD-B928-4AA8-9943-7DCF71197233}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{05809405-B565-4535-8A13-AD0EBB357394}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
300 changes: 263 additions & 37 deletions MainWindow.Designer.cs

Large diffs are not rendered by default.

100 changes: 80 additions & 20 deletions MainWindow.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Windows.Forms;
using MijoSoftware.AssemblyInformation;
using DaysCounter.Properties;
using MijoSoftware.AssemblyInformation;

namespace DaysCounter
{
Expand All @@ -10,6 +10,35 @@ namespace DaysCounter
/// </summary>
public partial class MainWindow : Form
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions")]
private void ShowCopiedToClipboardMessage()
{
MessageBox.Show(
text: Resources.copiedToClipboard,
caption: string.Empty,
buttons: MessageBoxButtons.OK,
icon: MessageBoxIcon.Information,
defaultButton: MessageBoxDefaultButton.Button1);
}

private void ApplicationStayNotOnTop()
{
TopMost = false;
toolStripMenuItemStayNotOnTop.Checked = !TopMost;
toolStripMenuItemStayOnTop.Checked = TopMost;
toolStripSplitButtonStayOnTop.Image = Resources.application;
toolStripSplitButtonStayOnTop.Text = Resources.stayNotOnTop;
}

private void ApplicationStayOnTop()
{
TopMost = true;
toolStripMenuItemStayNotOnTop.Checked = !TopMost;
toolStripMenuItemStayOnTop.Checked = TopMost;
toolStripSplitButtonStayOnTop.Image = Resources.application_blue;
toolStripSplitButtonStayOnTop.Text = Resources.stayOnTop;
}

/// <summary>
/// Set a specific text to the status bar
/// </summary>
Expand Down Expand Up @@ -96,7 +125,7 @@ public MainWindow()
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
/// <remarks>The parameters <paramref name="e"/> and <paramref name="sender"/> are not needed, but must be indicated.</remarks>
private void ButtonDateOfTheBirth_Click(object sender, EventArgs e) => dateTimePickerDateOfTheBirth.ShowUpDown = !dateTimePickerDateOfTheBirth.ShowUpDown;
private void ButtonSwitchDateOfTheBirth_Click(object sender, EventArgs e) => dateTimePickerDateOfTheBirth.ShowUpDown = !dateTimePickerDateOfTheBirth.ShowUpDown;

/// <summary>
/// Update the value of the beginning date
Expand Down Expand Up @@ -178,37 +207,68 @@ private void SetStatusbar_Enter(object sender, EventArgs e)
/// <remarks>The parameters <paramref name="e"/> and <paramref name="sender"/> are not needed, but must be indicated.</remarks>
private void ClearStatusbar_Leave(object sender, EventArgs e) => SetStatusbarText(text: string.Empty);

private void ApplicationStayNotOnTop()
private void ToolStripMenuItemStayNotOnTop_Click(object sender, EventArgs e) => ApplicationStayNotOnTop();

private void ToolStripMenuItemStayOnTop_Click(object sender, EventArgs e) => ApplicationStayOnTop();

private void ToolStripSplitButtonStayOnTop_ButtonClick(object sender, EventArgs e)
{
TopMost = false;
toolStripMenuItemStayNotOnTop.Checked = !TopMost;
toolStripMenuItemStayOnTop.Checked = TopMost;
toolStripSplitButtonStayOnTop.Image = Resources.application;
toolStripSplitButtonStayOnTop.Text = Resources.stayNotOnTop;
if (TopMost)
{
ApplicationStayNotOnTop();
}
else
{
ApplicationStayOnTop();
}
}

private void ApplicationStayOnTop()
private void ButtonInsertDateTodayBegin_Click(object sender, EventArgs e) => dateTimePickerBegin.Value = DateTime.Now;

private void ButtonInsertDateTodayEnd_Click(object sender, EventArgs e) => dateTimePickerEnd.Value = DateTime.Now;

private void ButtonInsertDateIn_Click(object sender, EventArgs e) => dateTimePickerDateIn.Value = DateTime.Now;

private void ButtonCopyDateBegin_Click(object sender, EventArgs e)
{
TopMost = true;
toolStripMenuItemStayNotOnTop.Checked = !TopMost;
toolStripMenuItemStayOnTop.Checked = TopMost;
toolStripSplitButtonStayOnTop.Image = Resources.application_blue;
toolStripSplitButtonStayOnTop.Text = Resources.stayOnTop;
Clipboard.SetDataObject(data: dateTimePickerBegin.Value.ToLongDateString());
ShowCopiedToClipboardMessage();
}

private void ToolStripMenuItemStayNotOnTop_Click(object sender, EventArgs e)
private void ButtonCopyDateEnd_Click(object sender, EventArgs e)
{
ApplicationStayNotOnTop();
Clipboard.SetDataObject(data: dateTimePickerEnd.Value.ToLongDateString());
ShowCopiedToClipboardMessage();
}

private void ToolStripMenuItemStayOnTop_Click(object sender, EventArgs e)
private void ButtonCopyDateIn_Click(object sender, EventArgs e)
{
ApplicationStayOnTop();
Clipboard.SetDataObject(data: dateTimePickerDateIn.Value.ToLongDateString());
ShowCopiedToClipboardMessage();
}

private void ToolStripSplitButtonStayOnTop_ButtonClick(object sender, EventArgs e)
private void ButtonCopyDateOut_Click(object sender, EventArgs e)
{
Clipboard.SetDataObject(data: dateTimePickerDateOut.Value.ToLongDateString());
ShowCopiedToClipboardMessage();
}

private void ButtonCopyDateOfTheBirth_Click(object sender, EventArgs e)
{
Clipboard.SetDataObject(data: dateTimePickerDateOfTheBirth.Value.ToLongDateString());
ShowCopiedToClipboardMessage();
}

private void ToolStripMenuItemSwitch_Click(object sender, EventArgs e)
{
}

private void ToolStripMenuItemCopyDateToClipboard_Click(object sender, EventArgs e)
{
}

private void ToolStripMenuItemInsertDateToday_Click(object sender, EventArgs e)
{
if (TopMost) ApplicationStayNotOnTop(); else ApplicationStayOnTop();
}
}
}
5 changes: 4 additions & 1 deletion MainWindow.resx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAK
DAAAAk1TRnQBSQFMAgEBBAEAAaABAAGgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DAAAAk1TRnQBSQFMAgEBBAEAAeABAAHgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
Expand Down Expand Up @@ -185,6 +185,9 @@
<metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>108, 17</value>
</metadata>
<metadata name="contextMenuStripDateContext.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>320, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>58</value>
</metadata>
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.6")]
[assembly: AssemblyFileVersion("1.3.0.6")]
[assembly: AssemblyVersion("1.4.0.7")]
[assembly: AssemblyFileVersion("1.4.0.7")]
[assembly: NeutralResourcesLanguage("en")]
29 changes: 29 additions & 0 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,31 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="calendar-small" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\calendar-small.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="calendar-day" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\calendar-day.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="switch-small" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\switch-small.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="application" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\application.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="application-blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\application-blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="stayNotOnTop" xml:space="preserve">
<value>Stay not on top</value>
</data>
<data name="application" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\application.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="stayOnTop" xml:space="preserve">
<value>Stay on top</value>
</data>
<data name="document-small" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\document-small.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="copiedToClipboard" xml:space="preserve">
<value>Copied to clipboard!</value>
</data>
</root>
Binary file added Resources/calendar-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/clipboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/document-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.