worktimehero

git clone https://git.clttr.info/worktimehero.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit a3fc84ad6b265932be06d2074782bc08121cadf2
parent be7642e0451667c4e3b12edd900902afaaaff035
Author: rwa <apollo@rw-net.de>
Date:   Thu,  6 Sep 2018 19:08:44 +0200

initial commit

Diffstat:
AWorkTimeHero.sln | 38++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/App.config | 22++++++++++++++++++++++
AWorkTimeHero/BreakCalculatorExtension.cs | 43+++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/MainForm.Designer.cs | 323+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/MainForm.cs | 161+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/MainForm.resx | 179+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/Program.cs | 22++++++++++++++++++++++
AWorkTimeHero/Properties/AssemblyInfo.cs | 36++++++++++++++++++++++++++++++++++++
AWorkTimeHero/Properties/Resources.Designer.cs | 113+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/Properties/Resources.resx | 137+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/Properties/Settings.Designer.cs | 50++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/Properties/Settings.settings | 13+++++++++++++
AWorkTimeHero/Properties/vssver2.scc | 0
AWorkTimeHero/WorkTimeCalculator.cs | 151++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/WorkTimeHero.csproj | 117+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHero/WorkTimeHero.csproj.vspscc | 10++++++++++
AWorkTimeHero/clock.ico | 0
AWorkTimeHero/clock_15.ico | 0
AWorkTimeHero/clock_45.ico | 0
AWorkTimeHero/clock_error.ico | 0
AWorkTimeHero/clock_red.ico | 0
AWorkTimeHeroTest/BreakCalculatorExtensionText.cs | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHeroTest/Properties/AssemblyInfo.cs | 36++++++++++++++++++++++++++++++++++++
AWorkTimeHeroTest/Properties/vssver2.scc | 0
AWorkTimeHeroTest/WorkTimeCalculatorTest.cs | 14++++++++++++++
AWorkTimeHeroTest/WorkTimeHeroTest.csproj | 95+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AWorkTimeHeroTest/WorkTimeHeroTest.csproj.vspscc | 10++++++++++
27 files changed, 1653 insertions(+), 0 deletions(-)

diff --git a/WorkTimeHero.sln b/WorkTimeHero.sln @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkTimeHero", "WorkTimeHero\WorkTimeHero.csproj", "{5562D843-C5C9-4097-9E20-B280A410EE83}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkTimeHeroTest", "WorkTimeHeroTest\WorkTimeHeroTest.csproj", "{C5EBE147-90B4-47E5-8DB2-4DA723A3015C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5562D843-C5C9-4097-9E20-B280A410EE83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5562D843-C5C9-4097-9E20-B280A410EE83}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5562D843-C5C9-4097-9E20-B280A410EE83}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5562D843-C5C9-4097-9E20-B280A410EE83}.Release|Any CPU.Build.0 = Release|Any CPU + {C5EBE147-90B4-47E5-8DB2-4DA723A3015C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5EBE147-90B4-47E5-8DB2-4DA723A3015C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5EBE147-90B4-47E5-8DB2-4DA723A3015C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5EBE147-90B4-47E5-8DB2-4DA723A3015C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(SourceCodeControl) = preSolution + SccNumberOfProjects = 3 + SccLocalPath0 = . + SccProjectUniqueName1 = WorkTimeHero\\WorkTimeHero.csproj + SccLocalPath1 = . + SccProjectFilePathRelativizedFromConnection1 = WorkTimeHero\\ + SccProjectUniqueName2 = WorkTimeHeroTest\\WorkTimeHeroTest.csproj + SccLocalPath2 = . + SccProjectFilePathRelativizedFromConnection2 = WorkTimeHeroTest\\ + EndGlobalSection +EndGlobal diff --git a/WorkTimeHero/App.config b/WorkTimeHero/App.config @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <configSections> + <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > + <section name="WorkTimeHero.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> + </sectionGroup> + </configSections> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> + </startup> + <userSettings> + <WorkTimeHero.Properties.Settings> + <setting name="StartTimePreamp" serializeAs="String"> + <value>-10</value> + </setting> + <setting name="TargetTime" serializeAs="String"> + <value>01/01/2016 08:00:00</value> + </setting> + </WorkTimeHero.Properties.Settings> + </userSettings> +</configuration> +\ No newline at end of file diff --git a/WorkTimeHero/BreakCalculatorExtension.cs b/WorkTimeHero/BreakCalculatorExtension.cs @@ -0,0 +1,42 @@ +using System; + +namespace WorkTimeHero +{ + public static class BreakCalculatorExtension + { + public static TimeSpan CalculateBreak( this TimeSpan currentWorkTime ) + { + if ( currentWorkTime > new TimeSpan( 6, 45, 0 ) ) + { + return new TimeSpan( 0, 45, 0 ); + } + + if ( currentWorkTime > new TimeSpan( 6, 0, 0 ) ) + { + return currentWorkTime - new TimeSpan( 6, 0, 0 ); + } + + if ( currentWorkTime > new TimeSpan( 4, 30, 0 ) ) + { + return new TimeSpan( 0, 30, 0 ); + } + + if ( currentWorkTime > new TimeSpan( 4, 15, 0 ) ) + { + return currentWorkTime - new TimeSpan( 4, 0, 0 ); + } + + if ( currentWorkTime > new TimeSpan( 2, 15, 0 ) ) + { + return new TimeSpan( 0, 15, 0 ); + } + + if ( currentWorkTime > new TimeSpan( 2, 0, 0 ) ) + { + return currentWorkTime - new TimeSpan( 2, 0, 0 ); + } + + return new TimeSpan(); + } + } +} +\ No newline at end of file diff --git a/WorkTimeHero/MainForm.Designer.cs b/WorkTimeHero/MainForm.Designer.cs @@ -0,0 +1,323 @@ +namespace WorkTimeHero +{ + partial class MainForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.lblStartTime = new System.Windows.Forms.Label(); + this.dtpStartTime = new System.Windows.Forms.DateTimePicker(); + this.dtpBreak = new System.Windows.Forms.DateTimePicker(); + this.prgPercentage = new System.Windows.Forms.ProgressBar(); + this.lblCompleted = new System.Windows.Forms.Label(); + this.refreshTimer = new System.Windows.Forms.Timer(this.components); + this.lblRemaining = new System.Windows.Forms.Label(); + this.lblOvertime = new System.Windows.Forms.Label(); + this.lblTimeDue = new System.Windows.Forms.Label(); + this.cboIndividualBreak = new System.Windows.Forms.CheckBox(); + this.ntiWorkTimeHero = new System.Windows.Forms.NotifyIcon(this.components); + this.cmsNotifyIcon = new System.Windows.Forms.ContextMenuStrip(this.components); + this.tsmiToogleView = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.tsmiBeenden = new System.Windows.Forms.ToolStripMenuItem(); + this.lblBuchungVorlauf = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.lblSollzeit = new System.Windows.Forms.Label(); + this.dtpTargetTime = new System.Windows.Forms.DateTimePicker(); + this.nudPreamp = new System.Windows.Forms.NumericUpDown(); + this.cmsNotifyIcon.SuspendLayout(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudPreamp)).BeginInit(); + this.SuspendLayout(); + // + // lblStartTime + // + this.lblStartTime.AutoSize = true; + this.lblStartTime.Font = new System.Drawing.Font("Consolas", 9.75F); + this.lblStartTime.Location = new System.Drawing.Point(9, 83); + this.lblStartTime.Name = "lblStartTime"; + this.lblStartTime.Size = new System.Drawing.Size(98, 15); + this.lblStartTime.TabIndex = 0; + this.lblStartTime.Text = "Arbeitsbeginn"; + // + // dtpStartTime + // + this.dtpStartTime.CustomFormat = "HH:mm"; + this.dtpStartTime.Font = new System.Drawing.Font("Consolas", 9.75F); + this.dtpStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpStartTime.Location = new System.Drawing.Point(226, 77); + this.dtpStartTime.Name = "dtpStartTime"; + this.dtpStartTime.ShowUpDown = true; + this.dtpStartTime.Size = new System.Drawing.Size(67, 23); + this.dtpStartTime.TabIndex = 0; + this.dtpStartTime.ValueChanged += new System.EventHandler(this.dtpStartTime_ValueChanged); + // + // dtpBreak + // + this.dtpBreak.CustomFormat = "HH:mm"; + this.dtpBreak.Enabled = false; + this.dtpBreak.Font = new System.Drawing.Font("Consolas", 9.75F); + this.dtpBreak.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpBreak.Location = new System.Drawing.Point(226, 106); + this.dtpBreak.Name = "dtpBreak"; + this.dtpBreak.ShowUpDown = true; + this.dtpBreak.Size = new System.Drawing.Size(67, 23); + this.dtpBreak.TabIndex = 1; + this.dtpBreak.Value = new System.DateTime(2016, 1, 1, 0, 45, 0, 0); + this.dtpBreak.ValueChanged += new System.EventHandler(this.dtpBreak_ValueChanged); + // + // prgPercentage + // + this.prgPercentage.Location = new System.Drawing.Point(12, 49); + this.prgPercentage.Name = "prgPercentage"; + this.prgPercentage.Size = new System.Drawing.Size(440, 23); + this.prgPercentage.TabIndex = 4; + // + // lblCompleted + // + this.lblCompleted.AutoSize = true; + this.lblCompleted.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblCompleted.Location = new System.Drawing.Point(9, 9); + this.lblCompleted.Name = "lblCompleted"; + this.lblCompleted.Size = new System.Drawing.Size(84, 15); + this.lblCompleted.TabIndex = 5; + this.lblCompleted.Text = "Arbeitszeit"; + // + // refreshTimer + // + this.refreshTimer.Interval = 11500; + this.refreshTimer.Tick += new System.EventHandler(this.refreshTimer_Tick); + // + // lblRemaining + // + this.lblRemaining.AutoSize = true; + this.lblRemaining.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblRemaining.Location = new System.Drawing.Point(9, 31); + this.lblRemaining.Name = "lblRemaining"; + this.lblRemaining.Size = new System.Drawing.Size(84, 15); + this.lblRemaining.TabIndex = 6; + this.lblRemaining.Text = "Verbleibend"; + // + // lblOvertime + // + this.lblOvertime.AutoSize = true; + this.lblOvertime.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblOvertime.Location = new System.Drawing.Point(223, 9); + this.lblOvertime.Name = "lblOvertime"; + this.lblOvertime.Size = new System.Drawing.Size(84, 15); + this.lblOvertime.TabIndex = 7; + this.lblOvertime.Text = "Überstunden"; + // + // lblTimeDue + // + this.lblTimeDue.AutoSize = true; + this.lblTimeDue.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblTimeDue.Location = new System.Drawing.Point(223, 31); + this.lblTimeDue.Name = "lblTimeDue"; + this.lblTimeDue.Size = new System.Drawing.Size(105, 15); + this.lblTimeDue.TabIndex = 8; + this.lblTimeDue.Text = "Arbeitsende um"; + // + // cboIndividualBreak + // + this.cboIndividualBreak.AutoSize = true; + this.cboIndividualBreak.Font = new System.Drawing.Font("Consolas", 9.75F); + this.cboIndividualBreak.Location = new System.Drawing.Point(12, 107); + this.cboIndividualBreak.Name = "cboIndividualBreak"; + this.cboIndividualBreak.Size = new System.Drawing.Size(201, 19); + this.cboIndividualBreak.TabIndex = 9; + this.cboIndividualBreak.Text = "individueller Pausenabzug"; + this.cboIndividualBreak.UseVisualStyleBackColor = true; + this.cboIndividualBreak.CheckedChanged += new System.EventHandler(this.cboIndividualBreak_CheckedChanged); + // + // ntiWorkTimeHero + // + this.ntiWorkTimeHero.ContextMenuStrip = this.cmsNotifyIcon; + this.ntiWorkTimeHero.Icon = ((System.Drawing.Icon)(resources.GetObject("ntiWorkTimeHero.Icon"))); + this.ntiWorkTimeHero.Text = "WorkTimeHero"; + this.ntiWorkTimeHero.Visible = true; + this.ntiWorkTimeHero.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.ntiWorkTimeHero_MouseDoubleClick); + // + // cmsNotifyIcon + // + this.cmsNotifyIcon.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsmiToogleView, + this.toolStripSeparator1, + this.tsmiBeenden}); + this.cmsNotifyIcon.Name = "cmsNotifyIcon"; + this.cmsNotifyIcon.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; + this.cmsNotifyIcon.Size = new System.Drawing.Size(203, 54); + // + // tsmiToogleView + // + this.tsmiToogleView.Name = "tsmiToogleView"; + this.tsmiToogleView.Size = new System.Drawing.Size(202, 22); + this.tsmiToogleView.Text = "Fenster ein-/ausblenden"; + this.tsmiToogleView.Click += new System.EventHandler(this.tsmiToogleView_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(199, 6); + // + // tsmiBeenden + // + this.tsmiBeenden.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tsmiBeenden.Name = "tsmiBeenden"; + this.tsmiBeenden.Size = new System.Drawing.Size(202, 22); + this.tsmiBeenden.Text = "Beenden"; + this.tsmiBeenden.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay; + this.tsmiBeenden.Click += new System.EventHandler(this.tsmiBeenden_Click); + // + // lblBuchungVorlauf + // + this.lblBuchungVorlauf.AutoSize = true; + this.lblBuchungVorlauf.Font = new System.Drawing.Font("Consolas", 9.75F); + this.lblBuchungVorlauf.Location = new System.Drawing.Point(6, 27); + this.lblBuchungVorlauf.Name = "lblBuchungVorlauf"; + this.lblBuchungVorlauf.Size = new System.Drawing.Size(140, 15); + this.lblBuchungVorlauf.TabIndex = 12; + this.lblBuchungVorlauf.Text = "Buchung Vorlaufzeit"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.dtpTargetTime); + this.groupBox1.Controls.Add(this.lblSollzeit); + this.groupBox1.Controls.Add(this.lblBuchungVorlauf); + this.groupBox1.Controls.Add(this.nudPreamp); + this.groupBox1.Font = new System.Drawing.Font("Consolas", 9.75F); + this.groupBox1.Location = new System.Drawing.Point(12, 132); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(440, 81); + this.groupBox1.TabIndex = 14; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Einstellungen"; + // + // lblSollzeit + // + this.lblSollzeit.AutoSize = true; + this.lblSollzeit.Font = new System.Drawing.Font("Consolas", 9.75F); + this.lblSollzeit.Location = new System.Drawing.Point(6, 57); + this.lblSollzeit.Name = "lblSollzeit"; + this.lblSollzeit.Size = new System.Drawing.Size(63, 15); + this.lblSollzeit.TabIndex = 14; + this.lblSollzeit.Text = "Sollzeit"; + // + // dtpTargetTime + // + this.dtpTargetTime.CustomFormat = "HH:mm"; + this.dtpTargetTime.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::WorkTimeHero.Properties.Settings.Default, "TargetTime", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.dtpTargetTime.Font = new System.Drawing.Font("Consolas", 9.75F); + this.dtpTargetTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpTargetTime.Location = new System.Drawing.Point(214, 51); + this.dtpTargetTime.Name = "dtpTargetTime"; + this.dtpTargetTime.ShowUpDown = true; + this.dtpTargetTime.Size = new System.Drawing.Size(67, 23); + this.dtpTargetTime.TabIndex = 15; + this.dtpTargetTime.Value = global::WorkTimeHero.Properties.Settings.Default.TargetTime; + this.dtpTargetTime.ValueChanged += new System.EventHandler(this.dtpTargetTime_ValueChanged); + // + // nudPreamp + // + this.nudPreamp.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::WorkTimeHero.Properties.Settings.Default, "StartTimePreamp", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.nudPreamp.Font = new System.Drawing.Font("Consolas", 9.75F); + this.nudPreamp.Location = new System.Drawing.Point(214, 22); + this.nudPreamp.Maximum = new decimal(new int[] { + 0, + 0, + 0, + 0}); + this.nudPreamp.Minimum = new decimal(new int[] { + 60, + 0, + 0, + -2147483648}); + this.nudPreamp.Name = "nudPreamp"; + this.nudPreamp.Size = new System.Drawing.Size(67, 23); + this.nudPreamp.TabIndex = 0; + this.nudPreamp.Value = global::WorkTimeHero.Properties.Settings.Default.StartTimePreamp; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(464, 225); + this.ControlBox = false; + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.cboIndividualBreak); + this.Controls.Add(this.lblTimeDue); + this.Controls.Add(this.lblOvertime); + this.Controls.Add(this.lblRemaining); + this.Controls.Add(this.lblCompleted); + this.Controls.Add(this.prgPercentage); + this.Controls.Add(this.dtpBreak); + this.Controls.Add(this.dtpStartTime); + this.Controls.Add(this.lblStartTime); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "MainForm"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "WorkTimeHero"; + this.TopMost = true; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.Load += new System.EventHandler(this.MainForm_Load); + this.cmsNotifyIcon.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudPreamp)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lblStartTime; + private System.Windows.Forms.DateTimePicker dtpStartTime; + private System.Windows.Forms.DateTimePicker dtpBreak; + private System.Windows.Forms.ProgressBar prgPercentage; + private System.Windows.Forms.Label lblCompleted; + private System.Windows.Forms.Timer refreshTimer; + private System.Windows.Forms.Label lblRemaining; + private System.Windows.Forms.Label lblOvertime; + private System.Windows.Forms.Label lblTimeDue; + private System.Windows.Forms.CheckBox cboIndividualBreak; + private System.Windows.Forms.NotifyIcon ntiWorkTimeHero; + private System.Windows.Forms.ContextMenuStrip cmsNotifyIcon; + private System.Windows.Forms.ToolStripMenuItem tsmiBeenden; + private System.Windows.Forms.ToolStripMenuItem tsmiToogleView; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.NumericUpDown nudPreamp; + private System.Windows.Forms.Label lblBuchungVorlauf; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.DateTimePicker dtpTargetTime; + private System.Windows.Forms.Label lblSollzeit; + } +} + diff --git a/WorkTimeHero/MainForm.cs b/WorkTimeHero/MainForm.cs @@ -0,0 +1,160 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using WorkTimeHero.Properties; + +namespace WorkTimeHero +{ + public partial class MainForm : Form + { + private const string TimeFormatter = @"h\:mm"; + + private WorkTimeCalculator wtc; + + public MainForm() + { + InitializeComponent(); + } + + private void MainForm_Load(object sender, EventArgs e) + { + dtpStartTime.Value = DateTime.Now.AddMinutes((int)Settings.Default.StartTimePreamp); + } + + private void RefreshDisplay() + { + prgPercentage.Value = wtc.WorkTimePercentage; + lblCompleted.Text = string.Format("{1,-20}{0}", wtc.DoneWorkTime.ToString(TimeFormatter), "Arbeitszeit:"); + lblOvertime.Text = string.Format("{1,-20}{0}", wtc.AdditionalWorkTime.ToString(TimeFormatter), "Überstunden:"); + lblRemaining.Text = string.Format("{1,-20}{0}", wtc.RemainingWorkTime.ToString(TimeFormatter), "Verbleibend:"); + lblTimeDue.Text = string.Format("{1,-20}{0}", wtc.TimeDue.ToString(TimeFormatter), "Uhrzeit:"); + + RefreshTooltip(); + RefreshIcons(); + } + + private void RefreshTooltip() + { + string toolTipInfo = string.Empty; + if (wtc.AdditionalWorkTime.TotalMinutes > 0) + { + toolTipInfo = $"{wtc.AdditionalWorkTime.ToString(TimeFormatter)} Überstunden"; + if (!wtc.NotificationShown) + { + ntiWorkTimeHero.ShowBalloonTip(10, "Fertig!", "Sollzeit für heute erreicht!", ToolTipIcon.Info); + wtc.NotificationShown = true; + } + } + else + { + toolTipInfo = $"{wtc.WorkTimePercentage}% - noch {wtc.RemainingWorkTime.ToString(TimeFormatter)} Stunden"; + } + + ntiWorkTimeHero.Text = $"{toolTipInfo} - WorkTimeHero"; + } + + private void RefreshIcons() + { + Icon newIcon = Resources.clock; + ToolTipIcon newToolTipIcon = ToolTipIcon.Info; + if (wtc.WorkTimePercentage > 25) + { + newIcon = Resources.clock_15; + } + if (wtc.WorkTimePercentage > 75) + { + newIcon = Resources.clock_45; + } + if (wtc.RemainingWorkTime.TotalMinutes <= 0) + { + newIcon = Resources.clock_error; + newToolTipIcon = ToolTipIcon.Warning; + } + if ( wtc.DoneWorkTime.TotalMinutes >= 600) + { + newIcon = Resources.clock_red; + newToolTipIcon = ToolTipIcon.Error; + } + + ntiWorkTimeHero.Icon = newIcon; + Icon = newIcon; + ntiWorkTimeHero.BalloonTipIcon = newToolTipIcon; + } + + private void refreshTimer_Tick(object sender, EventArgs e) + { + RefreshDisplay(); + } + + private void dtpStartTime_ValueChanged(object sender, EventArgs e) + { + refreshTimer.Enabled = true; + RefreshWtc(); + RefreshDisplay(); + } + + private void RefreshWtc() + { + wtc = new WorkTimeCalculator(new TimeSpan(dtpStartTime.Value.Hour, dtpStartTime.Value.Minute, 0)); + + wtc.TargetTime = dtpTargetTime.Value.TimeOfDay; + if (!dtpBreak.Enabled) + { + wtc.IndividualBreakTime = null; + } + else + { + wtc.IndividualBreakTime = dtpBreak.Value.TimeOfDay; + } + RefreshDisplay(); + } + + private void dtpBreak_ValueChanged(object sender, EventArgs e) + { + RefreshWtc(); + } + + private void cboIndividualBreak_CheckedChanged(object sender, EventArgs e) + { + dtpBreak.Enabled = cboIndividualBreak.Checked; + RefreshWtc(); + } + + private void ntiWorkTimeHero_MouseDoubleClick(object sender, MouseEventArgs e) + { + ToogleVisiblity(); + } + + private void ToogleVisiblity() + { + if (Visible) + { + Hide(); + } + else + { + Show(); + } + } + + private void tsmiBeenden_Click(object sender, EventArgs e) + { + Close(); + } + + private void tsmiToogleView_Click(object sender, EventArgs e) + { + ToogleVisiblity(); + } + + private void MainForm_FormClosing(object sender, FormClosingEventArgs e) + { + Settings.Default.Save(); + } + + private void dtpTargetTime_ValueChanged(object sender, EventArgs e) + { + RefreshWtc(); + } + } +} +\ No newline at end of file diff --git a/WorkTimeHero/MainForm.resx b/WorkTimeHero/MainForm.resx @@ -0,0 +1,178 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="refreshTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <metadata name="ntiWorkTimeHero.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>132, 17</value> + </metadata> + <metadata name="cmsNotifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>270, 17</value> + </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="ntiWorkTimeHero.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAAAAAAAAADMAAAAyAAAAEAAAABkAAAAxAAAAMwAAADMAAAAzAAAAMQAAABkAAAAQAAAAMgAA + ADMAAAAA////AAAAAABFou//QKTz/CZ8snSXLEOWrTta+Kw8Xf+sO13/rDxd/607WviXLEOWJnyydECk + 8/xFou//AAAAAP///wAAAAAARKz2+4bo//+gSm3/tkFY/7hVXv+5Wl//uVpf/7laX/+4VV7/tkFY/6BK + bf+E5v//RKz2+wAAAAD///8AAAAAADKe02KhTG7/uUhX/8BdYf/TcnP/4Hx9/+B8ff/gfH3/03Jz/8Bd + Yf+5SFf/oUxu/zKe02IAAAAA////AAAAAACZMkOVukpc/8Zpbv/fe3z/4s/P/+n///+Zraz/6P///+LO + zv/fe3v/xmlu/7pKXP+ZMkOVAAAAAP///wAAAAAAsENY+MZvev/bfX//383O/9/////i////4v///97/ + ///d////3szO/9t9f//Gb3r/sENY+AAAAAD///8AAAAAALBFWf/TiZP/54GA/9X////a////VElH/7bO + 0P/Z/f//1fz//9X////ngYD/04mT/7BFWf8AAAAA////AAAAAACxR1f/25ij/+qCgf+Am5z/1P///7XR + 1P9aUE7/rsbJ/8/5/v9+mJr/6YKB/9uYo/+xR1f/AAAAAP///wAAAAAAtUVS/+Wos//tg4P/xP///6rM + 0P9eVFH/rcnN/8j1/P/E8/n/wfz//+yDgv/lqLP/tUVS/wAAAAD///8AAAAAIrRKVf/loa3/7ZSX/9LJ + zf9aV1T/pMjP/8H2//+88Pj/t/H6/83Dxv/sk5b/5aGt/7RKVf8AAAAi////ADyc47p+eaL/zmtx//a+ + y//xiYr/zsXM/7D2//9lhYr/rfL8/8q/xf/vhob/9b3K/85rcf9+eaL/PJzjuv///wBIr/T/UcX//6tb + Zf/cjJP//s3a//Wgo//yhoT/9IaE//KGg//1n6L//cza/9yLk/+rW2X/UcX//0iv9P////8ATbHy+mfX + /f9o1/v/r2Fl/9N0ef/4yNb//+f5///n+f//5/n/+MjW/9N0ef+vYWX/aNf7/2fX/f9NsfL6////AFC4 + 9Fxaxvf/efH//3r///+Fjqf/sVZY/7ZRUP+1UlH/tlFQ/7FWWP+Fjqf/ev///3nx//9axvf/ULj0XP// + /wAAAAAAUbz1XFG89fpOwPv/Rcn/qQAAAAAAAAAAAAAAAAAAAAAAAAAARcn/qU7A+/9RvPX6Ubz1XAAA + AAD///8A//8AAIADAACAAwAAgAMAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAAABAAAAAQAAAAEAAAAB + AAAAAQAAh8MAAA== +</value> + </data> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAAAAAAAAADMAAAAyAAAAEAAAABkAAAAxAAAAMwAAADMAAAAzAAAAMQAAABkAAAAQAAAAMgAA + ADMAAAAA////AAAAAABFou//QKTz/CZ8snSXLEOWrTta+Kw8Xf+sO13/rDxd/607WviXLEOWJnyydECk + 8/xFou//AAAAAP///wAAAAAARKz2+4bo//+gSm3/tkFY/7hVXv+5Wl//uVpf/7laX/+4VV7/tkFY/6BK + bf+E5v//RKz2+wAAAAD///8AAAAAADKe02KhTG7/uUhX/8BdYf/TcnP/4Hx9/+B8ff/gfH3/03Jz/8Bd + Yf+5SFf/oUxu/zKe02IAAAAA////AAAAAACZMkOVukpc/8Zpbv/fe3z/4s/P/+n///+Zraz/6P///+LO + zv/fe3v/xmlu/7pKXP+ZMkOVAAAAAP///wAAAAAAsENY+MZvev/bfX//383O/9/////i////4v///97/ + ///d////3szO/9t9f//Gb3r/sENY+AAAAAD///8AAAAAALBFWf/TiZP/54GA/9X////a////VElH/7bO + 0P/Z/f//1fz//9X////ngYD/04mT/7BFWf8AAAAA////AAAAAACxR1f/25ij/+qCgf+Am5z/1P///7XR + 1P9aUE7/rsbJ/8/5/v9+mJr/6YKB/9uYo/+xR1f/AAAAAP///wAAAAAAtUVS/+Wos//tg4P/xP///6rM + 0P9eVFH/rcnN/8j1/P/E8/n/wfz//+yDgv/lqLP/tUVS/wAAAAD///8AAAAAIrRKVf/loa3/7ZSX/9LJ + zf9aV1T/pMjP/8H2//+88Pj/t/H6/83Dxv/sk5b/5aGt/7RKVf8AAAAi////ADyc47p+eaL/zmtx//a+ + y//xiYr/zsXM/7D2//9lhYr/rfL8/8q/xf/vhob/9b3K/85rcf9+eaL/PJzjuv///wBIr/T/UcX//6tb + Zf/cjJP//s3a//Wgo//yhoT/9IaE//KGg//1n6L//cza/9yLk/+rW2X/UcX//0iv9P////8ATbHy+mfX + /f9o1/v/r2Fl/9N0ef/4yNb//+f5///n+f//5/n/+MjW/9N0ef+vYWX/aNf7/2fX/f9NsfL6////AFC4 + 9Fxaxvf/efH//3r///+Fjqf/sVZY/7ZRUP+1UlH/tlFQ/7FWWP+Fjqf/ev///3nx//9axvf/ULj0XP// + /wAAAAAAUbz1XFG89fpOwPv/Rcn/qQAAAAAAAAAAAAAAAAAAAAAAAAAARcn/qU7A+/9RvPX6Ubz1XAAA + AAD///8A//8AAIADAACAAwAAgAMAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAAABAAAAAQAAAAEAAAAB + AAAAAQAAh8MAAA== +</value> + </data> +</root> +\ No newline at end of file diff --git a/WorkTimeHero/Program.cs b/WorkTimeHero/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WorkTimeHero +{ + static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault( false ); + Application.Run( new MainForm() ); + } + } +} diff --git a/WorkTimeHero/Properties/AssemblyInfo.cs b/WorkTimeHero/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "WorkTimeHero" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "WorkTimeHero" )] +[assembly: AssemblyCopyright("Copyright © René Wagner 2016-2017")] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "5562d843-c5c9-4097-9e20-b280a410ee83" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/WorkTimeHero/Properties/Resources.Designer.cs b/WorkTimeHero/Properties/Resources.Designer.cs @@ -0,0 +1,113 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace WorkTimeHero.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WorkTimeHero.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// </summary> + internal static System.Drawing.Icon clock { + get { + object obj = ResourceManager.GetObject("clock", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// </summary> + internal static System.Drawing.Icon clock_15 { + get { + object obj = ResourceManager.GetObject("clock_15", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// </summary> + internal static System.Drawing.Icon clock_45 { + get { + object obj = ResourceManager.GetObject("clock_45", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// </summary> + internal static System.Drawing.Icon clock_error { + get { + object obj = ResourceManager.GetObject("clock_error", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// </summary> + internal static System.Drawing.Icon clock_red { + get { + object obj = ResourceManager.GetObject("clock_red", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} diff --git a/WorkTimeHero/Properties/Resources.resx b/WorkTimeHero/Properties/Resources.resx @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <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="clock" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\clock.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="clock_15" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\clock_15.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="clock_45" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\clock_45.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="clock_error" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\clock_error.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="clock_red" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\clock_red.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> +</root> +\ No newline at end of file diff --git a/WorkTimeHero/Properties/Settings.Designer.cs b/WorkTimeHero/Properties/Settings.Designer.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace WorkTimeHero.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.3.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("-10")] + public decimal StartTimePreamp { + get { + return ((decimal)(this["StartTimePreamp"])); + } + set { + this["StartTimePreamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("01/01/2016 08:00:00")] + public global::System.DateTime TargetTime { + get { + return ((global::System.DateTime)(this["TargetTime"])); + } + set { + this["TargetTime"] = value; + } + } + } +} diff --git a/WorkTimeHero/Properties/Settings.settings b/WorkTimeHero/Properties/Settings.settings @@ -0,0 +1,12 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="WorkTimeHero.Properties" GeneratedClassName="Settings"> + <Profiles /> + <Settings> + <Setting Name="StartTimePreamp" Type="System.Decimal" Scope="User"> + <Value Profile="(Default)">-10</Value> + </Setting> + <Setting Name="TargetTime" Type="System.DateTime" Scope="User"> + <Value Profile="(Default)">01/01/2016 08:00:00</Value> + </Setting> + </Settings> +</SettingsFile> +\ No newline at end of file diff --git a/WorkTimeHero/Properties/vssver2.scc b/WorkTimeHero/Properties/vssver2.scc Binary files differ. diff --git a/WorkTimeHero/WorkTimeCalculator.cs b/WorkTimeHero/WorkTimeCalculator.cs @@ -0,0 +1,150 @@ +using System; + +namespace WorkTimeHero +{ + public class WorkTimeCalculator + { + public bool NotificationShown + { + get; + set; + } + + public TimeSpan StartTime + { + get; + private set; + } + + /// <summary> + /// Anwesenheitszeit + /// </summary> + public TimeSpan BruttoTime + { + get + { + if (StartTime > DateTime.Now.TimeOfDay) + { + return new TimeSpan(); + } + + return new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, 0) - StartTime; + } + } + + /// <summary> + /// Sollzeit + /// </summary> + public TimeSpan TargetTime + { + get; + set; + } + + /// <summary> + /// minimale Anwesenheitszeit für Sollzeit + /// </summary> + public TimeSpan TimeDue + { + get + { + return StartTime + TargetTime + PlannedBreakTime; + } + } + + /// <summary> + /// Erledigte Arbeitszeit + /// </summary> + public TimeSpan DoneWorkTime + { + get + { + TimeSpan nettoTime = BruttoTime - CurrentBreakTime; + if (nettoTime.TotalMinutes < 0) { return new TimeSpan(); } + return nettoTime; + } + } + + /// <summary> + /// Pausenzeit für Sollzeit + /// </summary> + private TimeSpan PlannedBreakTime + { + get + { + if (IndividualBreakTime != null) + { + return IndividualBreakTime.Value; + } + + return TargetTime.CalculateBreak(); + } + } + + /// <summary> + /// aktueller Pausenabzug + /// </summary> + private TimeSpan CurrentBreakTime + { + get + { + if (IndividualBreakTime != null) + { + return IndividualBreakTime.Value; + } + + return BruttoTime.CalculateBreak(); + } + } + + /// <summary> + /// Überstunden + /// </summary> + public TimeSpan AdditionalWorkTime + { + get + { + TimeSpan additionalWorkTime = DoneWorkTime - TargetTime; + return additionalWorkTime < new TimeSpan() ? new TimeSpan() : additionalWorkTime; + } + } + + /// <summary> + /// Verbleibende Arbeitszeit + /// </summary> + public TimeSpan RemainingWorkTime + { + get + { + TimeSpan remainingTime = TargetTime - DoneWorkTime + PlannedBreakTime - CurrentBreakTime; + return remainingTime < new TimeSpan() ? new TimeSpan() : remainingTime; + } + } + + public int WorkTimePercentage + { + get + { + int percentage = Convert.ToInt32((BruttoTime.TotalMinutes / (TargetTime.TotalMinutes + PlannedBreakTime.TotalMinutes)) * 100); + return percentage > 100 ? 100 : percentage; + } + } + + public TimeSpan? IndividualBreakTime + { + get; + set; + } + + public WorkTimeCalculator(TimeSpan startTime) : this(startTime, new TimeSpan(8, 0, 0)) + { + } + + public WorkTimeCalculator(TimeSpan startTime, TimeSpan plannedWorkTime) + { + StartTime = startTime; + TargetTime = plannedWorkTime; + NotificationShown = false; + } + } +} +\ No newline at end of file diff --git a/WorkTimeHero/WorkTimeHero.csproj b/WorkTimeHero/WorkTimeHero.csproj @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{5562D843-C5C9-4097-9E20-B280A410EE83}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>WorkTimeHero</RootNamespace> + <AssemblyName>WorkTimeHero</AssemblyName> + <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <SccProjectName>SAK</SccProjectName> + <SccLocalPath>SAK</SccLocalPath> + <SccAuxPath>SAK</SccAuxPath> + <SccProvider>SAK</SccProvider> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <RunCodeAnalysis>true</RunCodeAnalysis> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <RunCodeAnalysis>true</RunCodeAnalysis> + </PropertyGroup> + <PropertyGroup> + <SignAssembly>true</SignAssembly> + </PropertyGroup> + <PropertyGroup> + <AssemblyOriginatorKeyFile>..\..\StrongName.snk</AssemblyOriginatorKeyFile> + </PropertyGroup> + <PropertyGroup> + <ApplicationIcon>clock.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup> + <StartupObject>WorkTimeHero.Program</StartupObject> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + </ItemGroup> + <ItemGroup> + <Compile Include="BreakCalculatorExtension.cs" /> + <Compile Include="MainForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="MainForm.Designer.cs"> + <DependentUpon>MainForm.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="WorkTimeCalculator.cs" /> + <EmbeddedResource Include="MainForm.resx"> + <DependentUpon>MainForm.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + <SubType>Designer</SubType> + </EmbeddedResource> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Resources.resx</DependentUpon> + <DesignTime>True</DesignTime> + </Compile> + <None Include="..\..\StrongName.snk"> + <Link>StrongName.snk</Link> + </None> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <Content Include="clock.ico" /> + <Content Include="clock_15.ico" /> + <Content Include="clock_45.ico" /> + <Content Include="clock_error.ico" /> + <Content Include="clock_red.ico" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> +\ No newline at end of file diff --git a/WorkTimeHero/WorkTimeHero.csproj.vspscc b/WorkTimeHero/WorkTimeHero.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "relative:WorkTimeHero" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/WorkTimeHero/clock.ico b/WorkTimeHero/clock.ico Binary files differ. diff --git a/WorkTimeHero/clock_15.ico b/WorkTimeHero/clock_15.ico Binary files differ. diff --git a/WorkTimeHero/clock_45.ico b/WorkTimeHero/clock_45.ico Binary files differ. diff --git a/WorkTimeHero/clock_error.ico b/WorkTimeHero/clock_error.ico Binary files differ. diff --git a/WorkTimeHero/clock_red.ico b/WorkTimeHero/clock_red.ico Binary files differ. diff --git a/WorkTimeHeroTest/BreakCalculatorExtensionText.cs b/WorkTimeHeroTest/BreakCalculatorExtensionText.cs @@ -0,0 +1,83 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using WorkTimeHero; + +namespace WorkTimeHeroTest +{ + [TestClass] + public class BreakCalculatorExtensionText + { + [TestMethod] + public void CalculateBreak_CalledOnWorkTime1Hour_ReturnsTimeSpan() + { + TimeSpan result = new TimeSpan( 1, 0, 0 ).CalculateBreak(); + + Assert.AreEqual( new TimeSpan(), result ); + } + + [TestMethod] + public void CalculateBreak_CalledOnWorkTime30Minutes_ReturnsTimeSpan() + { + TimeSpan result = new TimeSpan( 0, 30, 0 ).CalculateBreak(); + + Assert.AreEqual( new TimeSpan(), result ); + } + + [TestMethod] + public void CalculateBreak_CalledOnWorkTime2Hours30Minutes_ReturnsTimeSpan() + { + TimeSpan result = new TimeSpan( 2, 30, 0 ).CalculateBreak(); + + Assert.AreEqual( new TimeSpan(0, 15, 0), result ); + } + + [TestMethod] + public void CalculateBreak_CalledOnWorkTime2Hours5Minutes_ReturnsTimeSpan() + { + TimeSpan result = new TimeSpan( 2, 05, 0 ).CalculateBreak(); + + Assert.AreEqual( new TimeSpan( 0, 5, 0 ), result ); + } + + [TestMethod] + public void CalculateBreak_CalledOnWorkTime4Hours10Minutes_ReturnsTimeSpan() + { + TimeSpan result = new TimeSpan( 4, 10, 0 ).CalculateBreak(); + + Assert.AreEqual( new TimeSpan( 0, 15, 0 ), result ); + } + + [TestMethod] + public void CalculateBreak_CalledOnWorkTime4Hours24Minutes_ReturnsTimeSpan() + { + TimeSpan result = new TimeSpan( 4, 24, 0 ).CalculateBreak(); + + Assert.AreEqual( new TimeSpan( 0, 24, 0 ), result ); + } + + + [TestMethod] + public void CalculateBreak_CalledOnWorkTime5Hours2Minutes_ReturnsTimeSpan() + { + TimeSpan result = new TimeSpan( 5, 2, 0 ).CalculateBreak(); + + Assert.AreEqual( new TimeSpan( 0, 30, 0 ), result ); + } + + [TestMethod] + public void CalculateBreak_CalledOnWorkTime10Hours_ReturnsTimeSpan() + { + TimeSpan result = new TimeSpan( 10, 0, 0 ).CalculateBreak(); + + Assert.AreEqual( new TimeSpan( 0, 45, 0 ), result ); + } + + [TestMethod] + public void CalculateBreak_CalledOnWorkTime6Hours35_ReturnsTimeSpan() + { + TimeSpan result = new TimeSpan( 6, 35, 0 ).CalculateBreak(); + + Assert.AreEqual( new TimeSpan( 0, 35, 0 ), result ); + } + } +} diff --git a/WorkTimeHeroTest/Properties/AssemblyInfo.cs b/WorkTimeHeroTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "WorkTimeHeroTest" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "WorkTimeHeroTest" )] +[assembly: AssemblyCopyright( "Copyright © 2016" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "c5ebe147-90b4-47e5-8db2-4da723a3015c" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff --git a/WorkTimeHeroTest/Properties/vssver2.scc b/WorkTimeHeroTest/Properties/vssver2.scc Binary files differ. diff --git a/WorkTimeHeroTest/WorkTimeCalculatorTest.cs b/WorkTimeHeroTest/WorkTimeCalculatorTest.cs @@ -0,0 +1,14 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace WorkTimeCalculatorTest +{ + [TestClass] + public class WorkTimeCalculatorTest + { + [TestMethod] + public void RemainingWorkTime_CalledOnStartTime800AndCurrentTime() + { + } + } +} diff --git a/WorkTimeHeroTest/WorkTimeHeroTest.csproj b/WorkTimeHeroTest/WorkTimeHeroTest.csproj @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{C5EBE147-90B4-47E5-8DB2-4DA723A3015C}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>WorkTimeHeroTest</RootNamespace> + <AssemblyName>WorkTimeHeroTest</AssemblyName> + <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> + <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> + <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> + <IsCodedUITest>False</IsCodedUITest> + <TestProjectType>UnitTest</TestProjectType> + <SccProjectName>SAK</SccProjectName> + <SccLocalPath>SAK</SccLocalPath> + <SccAuxPath>SAK</SccAuxPath> + <SccProvider>SAK</SccProvider> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <Choose> + <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> + </ItemGroup> + </When> + <Otherwise> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" /> + </ItemGroup> + </Otherwise> + </Choose> + <ItemGroup> + <Compile Include="BreakCalculatorExtensionText.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="WorkTimeCalculatorTest.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\WorkTimeHero\WorkTimeHero.csproj"> + <Project>{5562D843-C5C9-4097-9E20-B280A410EE83}</Project> + <Name>WorkTimeHero</Name> + </ProjectReference> + </ItemGroup> + <Choose> + <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + </ItemGroup> + </When> + </Choose> + <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> +\ No newline at end of file diff --git a/WorkTimeHeroTest/WorkTimeHeroTest.csproj.vspscc b/WorkTimeHeroTest/WorkTimeHeroTest.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "relative:WorkTimeHeroTest" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +}