diff --git a/SweetLib.Demo/App.config b/SweetLib.Demo/App.config new file mode 100644 index 0000000..d1428ad --- /dev/null +++ b/SweetLib.Demo/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/SweetLib.Demo/MainForm.Designer.cs b/SweetLib.Demo/MainForm.Designer.cs new file mode 100644 index 0000000..51025fb --- /dev/null +++ b/SweetLib.Demo/MainForm.Designer.cs @@ -0,0 +1,183 @@ +namespace SweetLib.Demo +{ + partial class MainForm + { + /// + /// 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.tabMain = new System.Windows.Forms.TabControl(); + this.tpgTaskbar = new System.Windows.Forms.TabPage(); + this.gbxProgress = new System.Windows.Forms.GroupBox(); + this.rdbNoProgress = new System.Windows.Forms.RadioButton(); + this.rdbIndeterminate = new System.Windows.Forms.RadioButton(); + this.rdbNormal = new System.Windows.Forms.RadioButton(); + this.rdbError = new System.Windows.Forms.RadioButton(); + this.rdbPaused = new System.Windows.Forms.RadioButton(); + this.tbrTaskBarProgress = new System.Windows.Forms.TrackBar(); + this.tabMain.SuspendLayout(); + this.tpgTaskbar.SuspendLayout(); + this.gbxProgress.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbrTaskBarProgress)).BeginInit(); + this.SuspendLayout(); + // + // tabMain + // + this.tabMain.Controls.Add(this.tpgTaskbar); + this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabMain.Location = new System.Drawing.Point(0, 0); + this.tabMain.Name = "tabMain"; + this.tabMain.SelectedIndex = 0; + this.tabMain.Size = new System.Drawing.Size(546, 333); + this.tabMain.TabIndex = 0; + // + // tpgTaskbar + // + this.tpgTaskbar.Controls.Add(this.gbxProgress); + this.tpgTaskbar.Location = new System.Drawing.Point(4, 22); + this.tpgTaskbar.Name = "tpgTaskbar"; + this.tpgTaskbar.Padding = new System.Windows.Forms.Padding(3); + this.tpgTaskbar.Size = new System.Drawing.Size(538, 307); + this.tpgTaskbar.TabIndex = 0; + this.tpgTaskbar.Text = "TaskBar"; + this.tpgTaskbar.UseVisualStyleBackColor = true; + // + // gbxProgress + // + this.gbxProgress.Controls.Add(this.tbrTaskBarProgress); + this.gbxProgress.Controls.Add(this.rdbPaused); + this.gbxProgress.Controls.Add(this.rdbError); + this.gbxProgress.Controls.Add(this.rdbNormal); + this.gbxProgress.Controls.Add(this.rdbIndeterminate); + this.gbxProgress.Controls.Add(this.rdbNoProgress); + this.gbxProgress.Location = new System.Drawing.Point(8, 6); + this.gbxProgress.Name = "gbxProgress"; + this.gbxProgress.Size = new System.Drawing.Size(268, 143); + this.gbxProgress.TabIndex = 0; + this.gbxProgress.TabStop = false; + this.gbxProgress.Text = "Progress"; + // + // rdbNoProgress + // + this.rdbNoProgress.AutoSize = true; + this.rdbNoProgress.Checked = true; + this.rdbNoProgress.Location = new System.Drawing.Point(6, 28); + this.rdbNoProgress.Name = "rdbNoProgress"; + this.rdbNoProgress.Size = new System.Drawing.Size(80, 17); + this.rdbNoProgress.TabIndex = 1; + this.rdbNoProgress.TabStop = true; + this.rdbNoProgress.Tag = "0"; + this.rdbNoProgress.Text = "NoProgress"; + this.rdbNoProgress.UseVisualStyleBackColor = true; + this.rdbNoProgress.CheckedChanged += new System.EventHandler(this.radioProgressCheckedChanged); + // + // rdbIndeterminate + // + this.rdbIndeterminate.AutoSize = true; + this.rdbIndeterminate.Location = new System.Drawing.Point(6, 51); + this.rdbIndeterminate.Name = "rdbIndeterminate"; + this.rdbIndeterminate.Size = new System.Drawing.Size(89, 17); + this.rdbIndeterminate.TabIndex = 2; + this.rdbIndeterminate.Tag = "1"; + this.rdbIndeterminate.Text = "Indeterminate"; + this.rdbIndeterminate.UseVisualStyleBackColor = true; + this.rdbIndeterminate.CheckedChanged += new System.EventHandler(this.radioProgressCheckedChanged); + // + // rdbNormal + // + this.rdbNormal.AutoSize = true; + this.rdbNormal.Location = new System.Drawing.Point(6, 74); + this.rdbNormal.Name = "rdbNormal"; + this.rdbNormal.Size = new System.Drawing.Size(58, 17); + this.rdbNormal.TabIndex = 3; + this.rdbNormal.Tag = "2"; + this.rdbNormal.Text = "Normal"; + this.rdbNormal.UseVisualStyleBackColor = true; + this.rdbNormal.CheckedChanged += new System.EventHandler(this.radioProgressCheckedChanged); + // + // rdbError + // + this.rdbError.AutoSize = true; + this.rdbError.Location = new System.Drawing.Point(6, 97); + this.rdbError.Name = "rdbError"; + this.rdbError.Size = new System.Drawing.Size(47, 17); + this.rdbError.TabIndex = 4; + this.rdbError.Tag = "3"; + this.rdbError.Text = "Error"; + this.rdbError.UseVisualStyleBackColor = true; + this.rdbError.CheckedChanged += new System.EventHandler(this.radioProgressCheckedChanged); + // + // rdbPaused + // + this.rdbPaused.AutoSize = true; + this.rdbPaused.Location = new System.Drawing.Point(6, 120); + this.rdbPaused.Name = "rdbPaused"; + this.rdbPaused.Size = new System.Drawing.Size(61, 17); + this.rdbPaused.TabIndex = 5; + this.rdbPaused.Tag = "4"; + this.rdbPaused.Text = "Paused"; + this.rdbPaused.UseVisualStyleBackColor = true; + this.rdbPaused.CheckedChanged += new System.EventHandler(this.radioProgressCheckedChanged); + // + // tbrTaskBarProgress + // + this.tbrTaskBarProgress.Location = new System.Drawing.Point(128, 28); + this.tbrTaskBarProgress.Maximum = 100; + this.tbrTaskBarProgress.Name = "tbrTaskBarProgress"; + this.tbrTaskBarProgress.Size = new System.Drawing.Size(134, 45); + this.tbrTaskBarProgress.TabIndex = 6; + this.tbrTaskBarProgress.ValueChanged += new System.EventHandler(this.tbrTaskBarProgress_ValueChanged); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(546, 333); + this.Controls.Add(this.tabMain); + this.Name = "MainForm"; + this.Text = "SweetLib Demo"; + this.tabMain.ResumeLayout(false); + this.tpgTaskbar.ResumeLayout(false); + this.gbxProgress.ResumeLayout(false); + this.gbxProgress.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tbrTaskBarProgress)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl tabMain; + private System.Windows.Forms.TabPage tpgTaskbar; + private System.Windows.Forms.GroupBox gbxProgress; + private System.Windows.Forms.RadioButton rdbNormal; + private System.Windows.Forms.RadioButton rdbIndeterminate; + private System.Windows.Forms.RadioButton rdbNoProgress; + private System.Windows.Forms.RadioButton rdbPaused; + private System.Windows.Forms.RadioButton rdbError; + private System.Windows.Forms.TrackBar tbrTaskBarProgress; + } +} + diff --git a/SweetLib.Demo/MainForm.cs b/SweetLib.Demo/MainForm.cs new file mode 100644 index 0000000..781a429 --- /dev/null +++ b/SweetLib.Demo/MainForm.cs @@ -0,0 +1,37 @@ +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; +using SweetLib.Utils.TaskBar; + +namespace SweetLib.Demo +{ + public partial class MainForm : Form + { + public MainForm() + { + InitializeComponent(); + } + + private void radioProgressCheckedChanged(object sender, EventArgs e) + { + var radio = (RadioButton) sender; + if(!radio.Checked) + return; + + int state = Convert.ToInt32(radio.Tag); + TaskBarProgress.TaskbarStates realState = (TaskBarProgress.TaskbarStates)Convert.ToInt32(radio.Tag); + TaskBarProgress.SetState(Handle, TaskBarProgress.TaskbarStates.Indeterminate); + } + + private void tbrTaskBarProgress_ValueChanged(object sender, EventArgs e) + { + TaskBarProgress.SetValue(Handle, tbrTaskBarProgress.Value, tbrTaskBarProgress.Maximum); + } + } +} diff --git a/SweetLib.Demo/MainForm.resx b/SweetLib.Demo/MainForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SweetLib.Demo/MainForm.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/SweetLib.Demo/Program.cs b/SweetLib.Demo/Program.cs new file mode 100644 index 0000000..90260c5 --- /dev/null +++ b/SweetLib.Demo/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SweetLib.Demo +{ + static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/SweetLib.Demo/Properties/AssemblyInfo.cs b/SweetLib.Demo/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..20c2bdf --- /dev/null +++ b/SweetLib.Demo/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("SweetLib.Demo")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SweetLib.Demo")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[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 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("9350e0d4-9fe7-49d5-acde-e857e547889c")] + +// 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.12.0")] +[assembly: AssemblyFileVersion("1.0.12.0")] diff --git a/SweetLib.Demo/Properties/Resources.Designer.cs b/SweetLib.Demo/Properties/Resources.Designer.cs new file mode 100644 index 0000000..521306d --- /dev/null +++ b/SweetLib.Demo/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace SweetLib.Demo.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // 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() { + } + + /// + /// 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 (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SweetLib.Demo.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, 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/SweetLib.Demo/Properties/Resources.resx b/SweetLib.Demo/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/SweetLib.Demo/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/SweetLib.Demo/Properties/Settings.Designer.cs b/SweetLib.Demo/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6b14c21 --- /dev/null +++ b/SweetLib.Demo/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace SweetLib.Demo.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.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/SweetLib.Demo/Properties/Settings.settings b/SweetLib.Demo/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/SweetLib.Demo/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/SweetLib.Demo/SweetLib.Demo.csproj b/SweetLib.Demo/SweetLib.Demo.csproj new file mode 100644 index 0000000..31eaa9f --- /dev/null +++ b/SweetLib.Demo/SweetLib.Demo.csproj @@ -0,0 +1,98 @@ + + + + + Debug + AnyCPU + {9350E0D4-9FE7-49D5-ACDE-E857E547889C} + WinExe + Properties + SweetLib.Demo + SweetLib.Demo + v4.5 + 512 + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {02c1f8ef-32f2-4e77-a36d-79129402af37} + SweetLib + + + + + \ No newline at end of file diff --git a/SweetLib.sln b/SweetLib.sln index 14c1fdf..afbcc0d 100644 --- a/SweetLib.sln +++ b/SweetLib.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SweetLib", "SweetLib\SweetLib.csproj", "{02C1F8EF-32F2-4E77-A36D-79129402AF37}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SweetLib.Demo", "SweetLib.Demo\SweetLib.Demo.csproj", "{9350E0D4-9FE7-49D5-ACDE-E857E547889C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,16 +17,12 @@ Global {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Debug|Any CPU.Build.0 = Debug|Any CPU {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.ActiveCfg = Release|Any CPU {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.Build.0 = Release|Any CPU + {9350E0D4-9FE7-49D5-ACDE-E857E547889C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9350E0D4-9FE7-49D5-ACDE-E857E547889C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9350E0D4-9FE7-49D5-ACDE-E857E547889C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9350E0D4-9FE7-49D5-ACDE-E857E547889C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(AutomaticVersions) = postSolution - UpdateAssemblyVersion.Release|Any CPU = True - UpdateAssemblyFileVersion.Release|Any CPU = True - UpdateAssemblyInfoVersion.Release|Any CPU = True - AssemblyVersionSettings.Release|Any CPU = None.Increment.None.None - AssemblyFileVersionSettings.Release|Any CPU = None.Increment.None.None - AssemblyInfoVersionSettings.Release|Any CPU = None.Increment.None.None - EndGlobalSection EndGlobal diff --git a/SweetLib/Properties/AssemblyInfo.cs b/SweetLib/Properties/AssemblyInfo.cs index b151708..dfdc628 100644 --- a/SweetLib/Properties/AssemblyInfo.cs +++ b/SweetLib/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 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: AssemblyVersion("1.0.3.0")] +[assembly: AssemblyFileVersion("1.0.3.0")] diff --git a/SweetLib/SweetLib.csproj b/SweetLib/SweetLib.csproj index 0d64913..a58f2f8 100644 --- a/SweetLib/SweetLib.csproj +++ b/SweetLib/SweetLib.csproj @@ -42,7 +42,9 @@ + +