commit 29d2602d5f4013727d7fee5e232530b1db9f9579 Author: Eugen Höglinger Date: Wed Nov 25 13:39:28 2020 +0100 Initialize diff --git a/.vs/Event.git/v16/.suo b/.vs/Event.git/v16/.suo new file mode 100644 index 0000000..a906629 Binary files /dev/null and b/.vs/Event.git/v16/.suo differ diff --git a/Event.git.sln b/Event.git.sln new file mode 100644 index 0000000..0d58ec6 --- /dev/null +++ b/Event.git.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30611.23 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Event", "Event\Event.csproj", "{34367331-AA50-4E33-ACAB-6A78C8D7290A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {34367331-AA50-4E33-ACAB-6A78C8D7290A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {34367331-AA50-4E33-ACAB-6A78C8D7290A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34367331-AA50-4E33-ACAB-6A78C8D7290A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {34367331-AA50-4E33-ACAB-6A78C8D7290A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EDCC6199-9962-42DA-85D6-64D4B2EF0726} + EndGlobalSection +EndGlobal diff --git a/Event/App.config b/Event/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Event/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Event/Event.csproj b/Event/Event.csproj new file mode 100644 index 0000000..7391860 --- /dev/null +++ b/Event/Event.csproj @@ -0,0 +1,84 @@ + + + + + Debug + AnyCPU + {34367331-AA50-4E33-ACAB-6A78C8D7290A} + WinExe + Event + Event + v4.7.2 + 512 + true + false + + + 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 diff --git a/Event/Form1.Designer.cs b/Event/Form1.Designer.cs new file mode 100644 index 0000000..e505df3 --- /dev/null +++ b/Event/Form1.Designer.cs @@ -0,0 +1,73 @@ +namespace Event +{ + partial class Form1 + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.buttonStart = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // buttonStart + // + this.buttonStart.Location = new System.Drawing.Point(13, 61); + this.buttonStart.Name = "buttonStart"; + this.buttonStart.Size = new System.Drawing.Size(75, 23); + this.buttonStart.TabIndex = 0; + this.buttonStart.Text = "Start"; + this.buttonStart.UseVisualStyleBackColor = true; + this.buttonStart.Click += new System.EventHandler(this.buttonStart_Click); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(13, 13); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(333, 20); + this.textBox1.TabIndex = 1; + this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(358, 102); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.buttonStart); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonStart; + private System.Windows.Forms.TextBox textBox1; + } +} + diff --git a/Event/Form1.cs b/Event/Form1.cs new file mode 100644 index 0000000..2deee09 --- /dev/null +++ b/Event/Form1.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Event +{ + public partial class Form1 : Form + { + #region Version und Copyright + // Version und Copyright + string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen + string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + string copyright = GenerateCopyright(); + string icon = Application.StartupPath + "\\Info.bmp"; + //Assembly Datum und Zeit + static DateTime value = AssemblyDateTime(); + string date = value.ToShortDateString(); + string time = value.ToLongTimeString(); + private static DateTime AssemblyDateTime() + { + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision)); + //Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original) + return buildDateTime; + } + + private static string CurrentYear() + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + + private static string StartYear() + { + string startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + return startYear.Remove(0, startYear.LastIndexOf(" ") + 1); + } + + private static string GenerateCopyright() + { + string startYear = StartYear(); + string currentYear = CurrentYear(); + + if (startYear == currentYear) + { + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + } + else + { + return String.Concat(((AssemblyCopyrightAttribute)attributes[0]).Copyright, "-", currentYear); + } + } + #endregion + + #region Programm-Info + /// + /// Contains the name of the program file + /// + public static string ProgramName { set; get; } + + /// + /// Contains the version of the program file + /// + public static string ProgramVersion { set; get; } + + /// + /// Contains the copyright notice + /// + public static string Copyright { set; get; } + + private void SetProgramInfo() + { + //Name, Version und Copyright setzen + ProgramName = programName; + ProgramVersion = programVersion; + Copyright = copyright; + } + #endregion + public Form1() + { + SetProgramInfo(); + InitializeComponent(); + } + + private void buttonStart_Click(object sender, EventArgs e) + { + //Hier geht es los + MyClass myClass = new MyClass(); + myClass.MyEvent += MyClass_MyEvent; + myClass.DoSomething(); + } + + public void MyClass_MyEvent(object sender, EventArgs e) + { + MessageBox.Show("Event wurde aufgerufen"); + } + + private void textBox1_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + MessageBox.Show("Return wurde gdrückt"); + MyClass myClass = new MyClass(); + myClass.MyEvent += MyClass_MyEvent; + myClass.SimulatedoSomething(); + } + } + } +} diff --git a/Event/Form1.resx b/Event/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Event/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/Event/MyClass.cs b/Event/MyClass.cs new file mode 100644 index 0000000..7782581 --- /dev/null +++ b/Event/MyClass.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Event +{ + class MyClass + { + public MyClass() + { + DoSomething(); + } + + public event MyEventHandler MyEvent; + + public delegate void MyEventHandler(object sender, EventArgs e); + + public void DoSomething() + { + if (MyEvent != null) + { + MessageBox.Show("Tue was du machen sollst."); + MyEvent(this, EventArgs.Empty); + } + } + + public void SimulatedoSomething() + { + DoSomething(); + } + } +} diff --git a/Event/Program.cs b/Event/Program.cs new file mode 100644 index 0000000..6639523 --- /dev/null +++ b/Event/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Event +{ + static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Event/Properties/AssemblyInfo.cs b/Event/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5d8bc8e --- /dev/null +++ b/Event/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("Event")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Event")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("34367331-aa50-4e33-acab-6a78c8d7290a")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Event/Properties/Resources.Designer.cs b/Event/Properties/Resources.Designer.cs new file mode 100644 index 0000000..62c7142 --- /dev/null +++ b/Event/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion: 4.0.30319.42000 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code neu generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Event.Properties +{ + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder-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 Option /str erneut aus, oder erstellen Sie 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() + { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [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("Event.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// + [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/Event/Properties/Resources.resx b/Event/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Event/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/Event/Properties/Settings.Designer.cs b/Event/Properties/Settings.Designer.cs new file mode 100644 index 0000000..0429929 --- /dev/null +++ b/Event/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 Event.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/Event/Properties/Settings.settings b/Event/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Event/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Event/bin/Debug/Event.exe b/Event/bin/Debug/Event.exe new file mode 100644 index 0000000..138dca3 Binary files /dev/null and b/Event/bin/Debug/Event.exe differ diff --git a/Event/bin/Debug/Event.exe.config b/Event/bin/Debug/Event.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Event/bin/Debug/Event.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Event/bin/Debug/Event.pdb b/Event/bin/Debug/Event.pdb new file mode 100644 index 0000000..6f8b9c3 Binary files /dev/null and b/Event/bin/Debug/Event.pdb differ diff --git a/Event/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/Event/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/Event/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/Event/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Event/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..d277094 Binary files /dev/null and b/Event/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Event/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Event/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..265e049 Binary files /dev/null and b/Event/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Event/obj/Debug/Event.Form1.resources b/Event/obj/Debug/Event.Form1.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/Event/obj/Debug/Event.Form1.resources differ diff --git a/Event/obj/Debug/Event.Properties.Resources.resources b/Event/obj/Debug/Event.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/Event/obj/Debug/Event.Properties.Resources.resources differ diff --git a/Event/obj/Debug/Event.csproj.CoreCompileInputs.cache b/Event/obj/Debug/Event.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7eadb80 --- /dev/null +++ b/Event/obj/Debug/Event.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +d6a82ede70908e0a83b4875a58a94f2bcaf0f495 diff --git a/Event/obj/Debug/Event.csproj.FileListAbsolute.txt b/Event/obj/Debug/Event.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..bdcd638 --- /dev/null +++ b/Event/obj/Debug/Event.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\bin\Debug\Event.exe.config +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\bin\Debug\Event.exe +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\bin\Debug\Event.pdb +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\obj\Debug\Event.csprojAssemblyReference.cache +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\obj\Debug\Event.Form1.resources +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\obj\Debug\Event.Properties.Resources.resources +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\obj\Debug\Event.csproj.GenerateResource.cache +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\obj\Debug\Event.csproj.CoreCompileInputs.cache +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\obj\Debug\Event.exe +H:\Programmieren\Git-Repository\VisualStudio\2017\_TEST\Event.git\Event\obj\Debug\Event.pdb diff --git a/Event/obj/Debug/Event.csproj.GenerateResource.cache b/Event/obj/Debug/Event.csproj.GenerateResource.cache new file mode 100644 index 0000000..cc8d15a Binary files /dev/null and b/Event/obj/Debug/Event.csproj.GenerateResource.cache differ diff --git a/Event/obj/Debug/Event.csprojAssemblyReference.cache b/Event/obj/Debug/Event.csprojAssemblyReference.cache new file mode 100644 index 0000000..f42cdc6 Binary files /dev/null and b/Event/obj/Debug/Event.csprojAssemblyReference.cache differ diff --git a/Event/obj/Debug/Event.exe b/Event/obj/Debug/Event.exe new file mode 100644 index 0000000..138dca3 Binary files /dev/null and b/Event/obj/Debug/Event.exe differ diff --git a/Event/obj/Debug/Event.pdb b/Event/obj/Debug/Event.pdb new file mode 100644 index 0000000..6f8b9c3 Binary files /dev/null and b/Event/obj/Debug/Event.pdb differ