Init of TimeKeeper
This commit is contained in:
commit
dc7ee1b321
26
TimeKeeper.sln
Normal file
26
TimeKeeper.sln
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TimeKeeper", "TimeKeeper\TimeKeeper.csproj", "{25F58397-71CB-4298-979E-BAACE80C61CB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils", "..\Utils\Utils\Utils.csproj", "{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{25F58397-71CB-4298-979E-BAACE80C61CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{25F58397-71CB-4298-979E-BAACE80C61CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{25F58397-71CB-4298-979E-BAACE80C61CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{25F58397-71CB-4298-979E-BAACE80C61CB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FAC8CE64-BF13-4ECE-8097-AEB5DD060098}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
47
TimeKeeper/Controller/CTray.cs
Normal file
47
TimeKeeper/Controller/CTray.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using BlubbFish.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TimeKeeper.Controller {
|
||||
class Tray : OwnController {
|
||||
private static View.Tray tray;
|
||||
private static Controller.Window window;
|
||||
|
||||
override protected void init() {
|
||||
tray = new View.Tray();
|
||||
window = new Controller.Window();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// User klickt Doppelt auf das TrayIcon
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
internal static void Click_Tray(object sender, EventArgs e) {
|
||||
Click_Open(sender, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// User klickt auf den Eintrag Öffnen
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
internal static void Click_Open(object sender, EventArgs e) {
|
||||
window.execute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// User klickt auf den Eintrag Beenden
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
internal static void Click_Quit(object sender, EventArgs e) {
|
||||
tray.Dispose();
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
25
TimeKeeper/Controller/CWindow.cs
Normal file
25
TimeKeeper/Controller/CWindow.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using BlubbFish.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TimeKeeper.Controller {
|
||||
class Window : OwnController {
|
||||
private static View.Window window;
|
||||
|
||||
public Window() {
|
||||
|
||||
}
|
||||
|
||||
override protected void init() {
|
||||
window = new View.Window();
|
||||
}
|
||||
|
||||
public static void FormClosed(object sender, FormClosedEventArgs e) {
|
||||
window.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
16
TimeKeeper/Models/MTray.cs
Normal file
16
TimeKeeper/Models/MTray.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using BlubbFish.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TimeKeeper.Models {
|
||||
class Tray : OwnModel<Tray> {
|
||||
private Tray() {
|
||||
this.init();
|
||||
}
|
||||
override protected void init() {
|
||||
}
|
||||
}
|
||||
}
|
19
TimeKeeper/Models/MWindow.cs
Normal file
19
TimeKeeper/Models/MWindow.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using BlubbFish.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TimeKeeper.Models {
|
||||
class Window : OwnModel<Window> {
|
||||
|
||||
private Window() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
override protected void init() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
20
TimeKeeper/Program.cs
Normal file
20
TimeKeeper/Program.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TimeKeeper {
|
||||
class Program {
|
||||
static void Main(string[] args) {
|
||||
try {
|
||||
Controller.Tray t = new Controller.Tray();
|
||||
t.execute();
|
||||
Application.Run();
|
||||
} catch(Exception e) {
|
||||
MessageBox.Show("Fehler: " + e.Message + "\nStack: " + e.StackTrace, "Exception: " + e.GetType().ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
38
TimeKeeper/Properties/AssemblyInfo.cs
Normal file
38
TimeKeeper/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Resources;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die mit einer Assembly verknüpft sind.
|
||||
[assembly: AssemblyTitle("TimeKeeper")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("TimeKeeper")]
|
||||
[assembly: AssemblyCopyright("Copyright BlubbFish © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("7df6ab3d-639f-4549-a770-10ba3540a26b")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: NeutralResourcesLanguageAttribute("de-DE")]
|
83
TimeKeeper/Properties/Resources.Designer.cs
generated
Normal file
83
TimeKeeper/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,83 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.34209
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace TimeKeeper.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[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>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </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("TimeKeeper.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol).
|
||||
/// </summary>
|
||||
internal static System.Drawing.Icon IconMain {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("IconMain", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap MenuImagesQuit {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("MenuImagesQuit", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
127
TimeKeeper/Properties/Resources.resx
Normal file
127
TimeKeeper/Properties/Resources.resx
Normal file
@ -0,0 +1,127 @@
|
||||
<?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="IconMain" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Icons\main.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="MenuImagesQuit" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Icons\door_open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
TimeKeeper/Resources/Icons/door_open.png
Normal file
BIN
TimeKeeper/Resources/Icons/door_open.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 508 B |
BIN
TimeKeeper/Resources/Icons/main.ico
Normal file
BIN
TimeKeeper/Resources/Icons/main.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
98
TimeKeeper/TimeKeeper.csproj
Normal file
98
TimeKeeper/TimeKeeper.csproj
Normal file
@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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>{25F58397-71CB-4298-979E-BAACE80C61CB}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TimeKeeper</RootNamespace>
|
||||
<AssemblyName>TimeKeeper</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</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>
|
||||
</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>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>TimeKeeper.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\Icons\main.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controller\CTray.cs" />
|
||||
<Compile Include="Controller\CWindow.cs" />
|
||||
<Compile Include="Models\MTray.cs" />
|
||||
<Compile Include="Models\MWindow.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\ViewWindowForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="View\ViewWindowForm.Designer.cs">
|
||||
<DependentUpon>ViewWindowForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\VTray.cs" />
|
||||
<Compile Include="View\VWindow.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Utils\Utils\Utils.csproj">
|
||||
<Project>{fac8ce64-bf13-4ece-8097-aeb5dd060098}</Project>
|
||||
<Name>Utils</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Icons\main.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\Icons\door_open.png" />
|
||||
</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>
|
69
TimeKeeper/View/VTray.cs
Normal file
69
TimeKeeper/View/VTray.cs
Normal file
@ -0,0 +1,69 @@
|
||||
using BlubbFish.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using TimeKeeper.Properties;
|
||||
using System.Drawing;
|
||||
|
||||
namespace TimeKeeper.View {
|
||||
class Tray : OwnView {
|
||||
public Models.Tray Model { get; private set; }
|
||||
private NotifyIcon trayi;
|
||||
|
||||
|
||||
public Tray() {
|
||||
this.init();
|
||||
this.Model = Models.Tray.Instance;
|
||||
this.Model.setObserver(this);
|
||||
}
|
||||
|
||||
public override void update() {
|
||||
this.trayi.ContextMenuStrip = this.genMenu();
|
||||
}
|
||||
|
||||
override protected void init() {
|
||||
this.trayi = new NotifyIcon();
|
||||
this.trayi.Visible = true;
|
||||
this.trayi.Icon = new Icon(Resources.IconMain, 40, 40);
|
||||
this.trayi.Text = "TimeKeeper";
|
||||
this.trayi.DoubleClick += Controller.Tray.Click_Tray;
|
||||
}
|
||||
|
||||
override public void Dispose() {
|
||||
this.trayi.Visible = false;
|
||||
Application.ExitThread();
|
||||
}
|
||||
|
||||
private ContextMenuStrip genMenu() {
|
||||
ContextMenuStrip menu = new ContextMenuStrip();
|
||||
ToolStripMenuItem mo = new ToolStripMenuItem("Öffnen");
|
||||
mo.Image = Resources.MenuImagesQuit;
|
||||
mo.Click += Controller.Tray.Click_Open;
|
||||
mo.Name = "Open";
|
||||
menu.Items.Add(mo);
|
||||
|
||||
menu.Items.Add(new ToolStripSeparator());
|
||||
|
||||
ToolStripMenuItem mq = new ToolStripMenuItem("Beenden");
|
||||
mq.Image = Resources.MenuImagesQuit;
|
||||
mq.Click += Controller.Tray.Click_Quit;
|
||||
mq.Name = "Quit";
|
||||
menu.Items.Add(mq);
|
||||
return menu;
|
||||
}
|
||||
|
||||
private void showBallonTooltip(string text, ToolTipIcon toolTipIcon, string title = "TimeKeeper Tray") {
|
||||
this.trayi.BalloonTipIcon = toolTipIcon;
|
||||
this.trayi.BalloonTipText = text;
|
||||
this.trayi.BalloonTipTitle = title;
|
||||
this.trayi.ShowBalloonTip(100);
|
||||
}
|
||||
|
||||
internal void showError(string text) {
|
||||
this.showBallonTooltip(text, ToolTipIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
35
TimeKeeper/View/VWindow.cs
Normal file
35
TimeKeeper/View/VWindow.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using BlubbFish.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TimeKeeper.View {
|
||||
class Window : OwnView {
|
||||
private ViewWindowForm form;
|
||||
public Window() {
|
||||
this.form = new ViewWindowForm();
|
||||
this.init();
|
||||
this.Model.setObserver(this);
|
||||
}
|
||||
|
||||
public override void update() {
|
||||
this.form.UpdateForm();
|
||||
}
|
||||
|
||||
protected override void init() {
|
||||
this.Model = Models.Window.Instance;
|
||||
this.form.SetModel(this.Model);
|
||||
this.form.Show();
|
||||
}
|
||||
|
||||
public override void Dispose() {
|
||||
this.form.BeginInvoke((Action)(() => {
|
||||
this.form.Dispose();
|
||||
}));
|
||||
}
|
||||
|
||||
public Models.Window Model { get; private set; }
|
||||
}
|
||||
}
|
33
TimeKeeper/View/ViewWindowForm.Designer.cs
generated
Normal file
33
TimeKeeper/View/ViewWindowForm.Designer.cs
generated
Normal file
@ -0,0 +1,33 @@
|
||||
namespace TimeKeeper.View {
|
||||
partial class ViewWindowForm {
|
||||
/// <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();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Text = "ViewWindowForm";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
31
TimeKeeper/View/ViewWindowForm.cs
Normal file
31
TimeKeeper/View/ViewWindowForm.cs
Normal file
@ -0,0 +1,31 @@
|
||||
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 TimeKeeper.View {
|
||||
public partial class ViewWindowForm : Form {
|
||||
private Models.Window model;
|
||||
|
||||
public ViewWindowForm() {
|
||||
InitializeComponent();
|
||||
this.FormClosed += Controller.Window.FormClosed;
|
||||
this.Icon = TimeKeeper.Properties.Resources.IconMain;
|
||||
}
|
||||
|
||||
public void UpdateForm() {
|
||||
this.BeginInvoke((Action)(() => {
|
||||
|
||||
}));
|
||||
}
|
||||
|
||||
internal void SetModel(Models.Window window) {
|
||||
this.model = window;
|
||||
}
|
||||
}
|
||||
}
|
BIN
TimeKeeper/bin/Release/TimeKeeper.exe
Normal file
BIN
TimeKeeper/bin/Release/TimeKeeper.exe
Normal file
Binary file not shown.
BIN
TimeKeeper/bin/Release/Utils.dll
Normal file
BIN
TimeKeeper/bin/Release/Utils.dll
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user