diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/DesktopClock.sln b/DesktopClock.sln new file mode 100644 index 0000000..e649831 --- /dev/null +++ b/DesktopClock.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesktopClock", "DesktopClock\DesktopClock.csproj", "{A608891B-0CC6-4A3D-8674-09D794DBB279}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A608891B-0CC6-4A3D-8674-09D794DBB279}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A608891B-0CC6-4A3D-8674-09D794DBB279}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A608891B-0CC6-4A3D-8674-09D794DBB279}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A608891B-0CC6-4A3D-8674-09D794DBB279}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AA8F0413-713A-48EE-8A0C-7FBFA008848A} + EndGlobalSection +EndGlobal diff --git a/DesktopClock/App.config b/DesktopClock/App.config new file mode 100644 index 0000000..787dcbe --- /dev/null +++ b/DesktopClock/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DesktopClock/App.xaml b/DesktopClock/App.xaml new file mode 100644 index 0000000..1b53e7a --- /dev/null +++ b/DesktopClock/App.xaml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/DesktopClock/App.xaml.cs b/DesktopClock/App.xaml.cs new file mode 100644 index 0000000..64ca46b --- /dev/null +++ b/DesktopClock/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace DesktopClock +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/DesktopClock/DesktopClock.csproj b/DesktopClock/DesktopClock.csproj new file mode 100644 index 0000000..f212644 --- /dev/null +++ b/DesktopClock/DesktopClock.csproj @@ -0,0 +1,134 @@ + + + + + Debug + AnyCPU + {A608891B-0CC6-4A3D-8674-09D794DBB279} + WinExe + DesktopClock + DesktopClock + v4.7.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + favicon.ico + + + + ..\packages\FluentWPF.0.3.0\lib\net45\FluentWPF.dll + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + False + Microsoft .NET Framework 4.7.1 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/DesktopClock/MainWindow.xaml b/DesktopClock/MainWindow.xaml new file mode 100644 index 0000000..08d4fbd --- /dev/null +++ b/DesktopClock/MainWindow.xaml @@ -0,0 +1,32 @@ + + + + + 09:24 pm + + + the date + + + + diff --git a/DesktopClock/MainWindow.xaml.cs b/DesktopClock/MainWindow.xaml.cs new file mode 100644 index 0000000..0f4cfcc --- /dev/null +++ b/DesktopClock/MainWindow.xaml.cs @@ -0,0 +1,31 @@ +using System; +using System.Windows.Threading; + +namespace DesktopClock +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow + { + TimeSpan timer = new TimeSpan(0, 0, 1); + DispatcherTimer updateTimer = new DispatcherTimer(); + + public MainWindow() + { + InitializeComponent(); + TimeBox.Text = DateTime.Now.ToShortTimeString(); + DateBox.Text = DateTime.Now.ToLongDateString(); + updateTimer.Interval = timer; + updateTimer.Tick += UpdateGUI; + updateTimer.Start(); + } + + private void UpdateGUI(object sender, EventArgs e) + { + TimeBox.Text = DateTime.Now.ToShortTimeString(); + DateBox.Text = DateTime.Now.ToLongDateString(); + if (updateTimer.IsEnabled) updateTimer.Start(); + } + } +} diff --git a/DesktopClock/Properties/AssemblyInfo.cs b/DesktopClock/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8b66718 --- /dev/null +++ b/DesktopClock/Properties/AssemblyInfo.cs @@ -0,0 +1,57 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("Desktop Clock")] +[assembly: AssemblyDescription("A WFP program for telling the date and time.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Desktop Clock")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[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)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// 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")] +[assembly: NeutralResourcesLanguage("af-ZA")] + diff --git a/DesktopClock/Properties/Resources.Designer.cs b/DesktopClock/Properties/Resources.Designer.cs new file mode 100644 index 0000000..ed5ecb4 --- /dev/null +++ b/DesktopClock/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 DesktopClock.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("DesktopClock.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/DesktopClock/Properties/Resources.resx b/DesktopClock/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/DesktopClock/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/DesktopClock/Properties/Settings.Designer.cs b/DesktopClock/Properties/Settings.Designer.cs new file mode 100644 index 0000000..223bd6d --- /dev/null +++ b/DesktopClock/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 DesktopClock.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/DesktopClock/Properties/Settings.settings b/DesktopClock/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/DesktopClock/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/DesktopClock/favicon.ico b/DesktopClock/favicon.ico new file mode 100644 index 0000000..6fb83d0 Binary files /dev/null and b/DesktopClock/favicon.ico differ diff --git a/DesktopClock/packages.config b/DesktopClock/packages.config new file mode 100644 index 0000000..8299ad3 --- /dev/null +++ b/DesktopClock/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index bde7fa0..ac7304a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ -# DesktopClock -A WPF program which displays the data and time so it is readable from a distance -- if needed. +# About Desktop Clock + +This is a basic WPF program which displays the data and time so it is readable from a distance -- if needed. + +Desktop Clock uses a NuGet package called [FluentWPF](https://github.com/sourcechord/FluentWPF). This allows the program to look like a Windows 10 UWP program. The most notable aspects being the translucent chrome and the highlighting of near-by buttons. + +[!(/desktop-screenshot-1.png)] + +## Publishing Information + +If you would like to use it you will need to build from the source provided. I did not want to mess around with ClickOnce or any other packaging mechanism. + +## Future Plans + +I do not intend to take this any further. It is a simple program which I have running 24/7, floating about on the screen. It sits there and does what I need it to do. Anything else seems like overkill and I do not find myself wanting it to do something extra. Therefore, if you want something adding to it, I recommend you fork it. diff --git a/desktop-clock-screenshot-1.png b/desktop-clock-screenshot-1.png new file mode 100644 index 0000000..89c2e6c Binary files /dev/null and b/desktop-clock-screenshot-1.png differ