diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f6f63c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin/ +obj/ + diff --git a/WFA.sln b/WFA.sln new file mode 100644 index 0000000..718607c --- /dev/null +++ b/WFA.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WFA", "WFA\WFA.csproj", "{29F4D0A9-C27B-4585-AD65-F9C79E7D5BB3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29F4D0A9-C27B-4585-AD65-F9C79E7D5BB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29F4D0A9-C27B-4585-AD65-F9C79E7D5BB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29F4D0A9-C27B-4585-AD65-F9C79E7D5BB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29F4D0A9-C27B-4585-AD65-F9C79E7D5BB3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/WFA/App.config b/WFA/App.config new file mode 100644 index 0000000..d740e88 --- /dev/null +++ b/WFA/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/WFA/Form1.Designer.cs b/WFA/Form1.Designer.cs new file mode 100644 index 0000000..1258a58 --- /dev/null +++ b/WFA/Form1.Designer.cs @@ -0,0 +1,74 @@ +namespace WFA +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.ClockTimer = new System.Windows.Forms.Timer(this.components); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // ClockTimer + // + this.ClockTimer.Enabled = true; + this.ClockTimer.Interval = 1000; + this.ClockTimer.Tick += new System.EventHandler(this.ClockTimer_Tick); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.label1.Location = new System.Drawing.Point(12, 211); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(164, 42); + this.label1.TabIndex = 0; + this.label1.Text = "00:00:00"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(184, 262); + this.Controls.Add(this.label1); + this.Name = "Form1"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Form1"; + this.TopMost = true; + this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Timer ClockTimer; + private System.Windows.Forms.Label label1; + } +} + diff --git a/WFA/Form1.cs b/WFA/Form1.cs new file mode 100644 index 0000000..6f86757 --- /dev/null +++ b/WFA/Form1.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WFA +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + ClockTimer_Tick(null, null); + } + + private void Form1_Paint(object sender, PaintEventArgs e) + { + e.Graphics.Clear(this.BackColor); + e.Graphics.DrawEllipse(Pens.Black, 20, 20, this.ClientSize.Width - 40, this.ClientSize.Width - 40); + label1.Location = new Point(0, this.ClientSize.Width); + this.Height = 40 + this.ClientSize.Width + label1.Height; + int p1 = this.ClientSize.Width / 2; + double angle = DateTime.Now.Second * 6 - 90; + int p2x = (int)(p1 + Math.Cos((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 20)); + int p2y = (int)(p1 + Math.Sin((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 20)); + e.Graphics.DrawLine(Pens.Black, p1, p1, p2x, p2y); + angle = (DateTime.Now.Minute + DateTime.Now.Second / 60f) * 6 - 90; + p2x = (int)(p1 + Math.Cos((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 40)); + p2y = (int)(p1 + Math.Sin((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 40)); + e.Graphics.DrawLine(Pens.Black, p1, p1, p2x, p2y); + angle = (DateTime.Now.Hour + DateTime.Now.Minute / 60f + DateTime.Now.Second / 3600f) * 30 - 90; + p2x = (int)(p1 + Math.Cos((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 60)); + p2y = (int)(p1 + Math.Sin((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 60)); + e.Graphics.DrawLine(Pens.Black, p1, p1, p2x, p2y); + for (int i = 0; i < 12; i++) + { + angle = i * 30 - 90; + int p1x = (int)(p1 + Math.Cos((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 20)); + int p1y = (int)(p1 + Math.Sin((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 20)); + p2x = (int)(p1 + Math.Cos((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 20 - this.ClientSize.Width / 12)); + p2y = (int)(p1 + Math.Sin((Math.PI / 180.0) * angle) * (this.ClientSize.Width / 2 - 20 - this.ClientSize.Width / 12)); + e.Graphics.DrawLine(Pens.Black, p1x, p1y, p2x, p2y); + } + } + + private void ClockTimer_Tick(object sender, EventArgs e) + { + this.Refresh(); + label1.Text = DateTime.Now.ToString("HH:mm:ss"); + } + } +} diff --git a/WFA/Form1.resx b/WFA/Form1.resx new file mode 100644 index 0000000..3414b7d --- /dev/null +++ b/WFA/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/WFA/Program.cs b/WFA/Program.cs new file mode 100644 index 0000000..90c78ed --- /dev/null +++ b/WFA/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WFA +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/WFA/Properties/AssemblyInfo.cs b/WFA/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9bf6cb0 --- /dev/null +++ b/WFA/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("WFA")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WFA")] +[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("29f4d0a9-c27b-4585-ad65-f9c79e7d5bb3")] + +// 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/WFA/Properties/Resources.Designer.cs b/WFA/Properties/Resources.Designer.cs new file mode 100644 index 0000000..a7d895c --- /dev/null +++ b/WFA/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace WFA.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WFA.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/WFA/Properties/Resources.resx b/WFA/Properties/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/WFA/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WFA/Properties/Settings.Designer.cs b/WFA/Properties/Settings.Designer.cs new file mode 100644 index 0000000..ca4a44f --- /dev/null +++ b/WFA/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace WFA.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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; + } + } + } +} diff --git a/WFA/Properties/Settings.settings b/WFA/Properties/Settings.settings new file mode 100644 index 0000000..abf36c5 --- /dev/null +++ b/WFA/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/WFA/WFA.csproj b/WFA/WFA.csproj new file mode 100644 index 0000000..66b3a99 --- /dev/null +++ b/WFA/WFA.csproj @@ -0,0 +1,90 @@ + + + + + Debug + AnyCPU + {29F4D0A9-C27B-4585-AD65-F9C79E7D5BB3} + WinExe + Properties + WFA + WFA + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + \ No newline at end of file