From d25b2cda8ec176cb4272ee99b93eb1537621368b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Kr=C3=BCger?= Date: Fri, 8 Jul 2022 15:24:48 +0200 Subject: [PATCH] =?UTF-8?q?Projektdateien=20hinzuf=C3=BCgen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WindowsFormsApp1.sln | 25 ++++ WindowsFormsApp1/App.config | 6 + WindowsFormsApp1/ClassDiagram1.cd | 4 + WindowsFormsApp1/Form1.Designer.cs | 98 ++++++++++++++ WindowsFormsApp1/Form1.cs | 40 ++++++ WindowsFormsApp1/Form1.resx | 120 ++++++++++++++++++ WindowsFormsApp1/OP/ClassObserver.cs | 12 ++ WindowsFormsApp1/OP/IObserver.cs | 16 +++ WindowsFormsApp1/OP/ISubject.cs | 23 ++++ WindowsFormsApp1/OP/PropertyObserver.cs | 20 +++ WindowsFormsApp1/OP/Subject.cs | 43 +++++++ WindowsFormsApp1/Program.cs | 22 ++++ WindowsFormsApp1/Properties/AssemblyInfo.cs | 36 ++++++ .../Properties/Resources.Designer.cs | 71 +++++++++++ WindowsFormsApp1/Properties/Resources.resx | 117 +++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ WindowsFormsApp1/Properties/Settings.settings | 7 + WindowsFormsApp1/Test/BaseTextBox.cs | 29 +++++ WindowsFormsApp1/Test/ExtendedTB.cs | 34 +++++ WindowsFormsApp1/WindowsFormsApp1.csproj | 98 ++++++++++++++ WindowsFormsApp1/classes/ATextBox.cs | 23 ++++ 21 files changed, 874 insertions(+) create mode 100644 WindowsFormsApp1.sln create mode 100644 WindowsFormsApp1/App.config create mode 100644 WindowsFormsApp1/ClassDiagram1.cd create mode 100644 WindowsFormsApp1/Form1.Designer.cs create mode 100644 WindowsFormsApp1/Form1.cs create mode 100644 WindowsFormsApp1/Form1.resx create mode 100644 WindowsFormsApp1/OP/ClassObserver.cs create mode 100644 WindowsFormsApp1/OP/IObserver.cs create mode 100644 WindowsFormsApp1/OP/ISubject.cs create mode 100644 WindowsFormsApp1/OP/PropertyObserver.cs create mode 100644 WindowsFormsApp1/OP/Subject.cs create mode 100644 WindowsFormsApp1/Program.cs create mode 100644 WindowsFormsApp1/Properties/AssemblyInfo.cs create mode 100644 WindowsFormsApp1/Properties/Resources.Designer.cs create mode 100644 WindowsFormsApp1/Properties/Resources.resx create mode 100644 WindowsFormsApp1/Properties/Settings.Designer.cs create mode 100644 WindowsFormsApp1/Properties/Settings.settings create mode 100644 WindowsFormsApp1/Test/BaseTextBox.cs create mode 100644 WindowsFormsApp1/Test/ExtendedTB.cs create mode 100644 WindowsFormsApp1/WindowsFormsApp1.csproj create mode 100644 WindowsFormsApp1/classes/ATextBox.cs diff --git a/WindowsFormsApp1.sln b/WindowsFormsApp1.sln new file mode 100644 index 0000000..bc38958 --- /dev/null +++ b/WindowsFormsApp1.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32616.157 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{79AF4BD6-6931-4E8C-81D1-6464F70C480D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {79AF4BD6-6931-4E8C-81D1-6464F70C480D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79AF4BD6-6931-4E8C-81D1-6464F70C480D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79AF4BD6-6931-4E8C-81D1-6464F70C480D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79AF4BD6-6931-4E8C-81D1-6464F70C480D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A9D8D780-7933-4C17-A237-4CA5415FEBA1} + EndGlobalSection +EndGlobal diff --git a/WindowsFormsApp1/App.config b/WindowsFormsApp1/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/WindowsFormsApp1/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/WindowsFormsApp1/ClassDiagram1.cd b/WindowsFormsApp1/ClassDiagram1.cd new file mode 100644 index 0000000..0cc622e --- /dev/null +++ b/WindowsFormsApp1/ClassDiagram1.cd @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/WindowsFormsApp1/Form1.Designer.cs b/WindowsFormsApp1/Form1.Designer.cs new file mode 100644 index 0000000..4c29815 --- /dev/null +++ b/WindowsFormsApp1/Form1.Designer.cs @@ -0,0 +1,98 @@ +namespace WindowsFormsApp1 +{ + 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.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.extendedTB1 = new WindowsFormsApp1.Test.ExtendedTB(); + this.baseTextBox1 = new WindowsFormsApp1.Test.BaseTextBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(227, 125); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 2; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(227, 200); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 27); + this.button2.TabIndex = 3; + this.button2.Text = "button2"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // extendedTB1 + // + this.extendedTB1.ForeColor = System.Drawing.Color.White; + this.extendedTB1.Location = new System.Drawing.Point(216, 174); + this.extendedTB1.Name = "extendedTB1"; + this.extendedTB1.Size = new System.Drawing.Size(100, 20); + this.extendedTB1.TabIndex = 1; + // + // baseTextBox1 + // + this.baseTextBox1.BackColor = System.Drawing.Color.DarkOrange; + this.baseTextBox1.Location = new System.Drawing.Point(216, 99); + this.baseTextBox1.Name = "baseTextBox1"; + this.baseTextBox1.Size = new System.Drawing.Size(100, 20); + this.baseTextBox1.TabIndex = 0; + this.baseTextBox1.TextChanged += new System.EventHandler(this.baseTextBox1_TextChanged); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1222, 710); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.extendedTB1); + this.Controls.Add(this.baseTextBox1); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Test.BaseTextBox baseTextBox1; + private Test.ExtendedTB extendedTB1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + } +} + diff --git a/WindowsFormsApp1/Form1.cs b/WindowsFormsApp1/Form1.cs new file mode 100644 index 0000000..9b0a929 --- /dev/null +++ b/WindowsFormsApp1/Form1.cs @@ -0,0 +1,40 @@ +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 WindowsFormsApp1.OP; + +namespace WindowsFormsApp1 +{ + public partial class Form1 : Form + { + Subject Subject = new Subject(); + + public Form1() + { + InitializeComponent(); + Subject.Subscribe(new ClassObserver()); + Subject.Subscribe(new PropertyObserver()); + } + + private void baseTextBox1_TextChanged(object sender, EventArgs e) + { + Subject.SetState(baseTextBox1.Text); + } + + private void button1_Click(object sender, EventArgs e) + { + baseTextBox1.Reset(); + } + + private void button2_Click(object sender, EventArgs e) + { + extendedTB1.Reset(); + } + } +} diff --git a/WindowsFormsApp1/Form1.resx b/WindowsFormsApp1/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/WindowsFormsApp1/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/WindowsFormsApp1/OP/ClassObserver.cs b/WindowsFormsApp1/OP/ClassObserver.cs new file mode 100644 index 0000000..25d37d2 --- /dev/null +++ b/WindowsFormsApp1/OP/ClassObserver.cs @@ -0,0 +1,12 @@ +using System.Windows.Forms; + +namespace WindowsFormsApp1.OP +{ + public class ClassObserver: IObserver + { + public void Update(ISubject subject) + { + MessageBox.Show(subject.GetState().ToString()); + } + } +} diff --git a/WindowsFormsApp1/OP/IObserver.cs b/WindowsFormsApp1/OP/IObserver.cs new file mode 100644 index 0000000..5a9ffec --- /dev/null +++ b/WindowsFormsApp1/OP/IObserver.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WindowsFormsApp1.OP +{ + public interface IObserver + { + /// + /// Receive update from subject + /// + void Update(ISubject subject); + } +} diff --git a/WindowsFormsApp1/OP/ISubject.cs b/WindowsFormsApp1/OP/ISubject.cs new file mode 100644 index 0000000..26ae701 --- /dev/null +++ b/WindowsFormsApp1/OP/ISubject.cs @@ -0,0 +1,23 @@ +namespace WindowsFormsApp1.OP +{ + public interface ISubject + { + /// + /// Attach an observer to the object. + /// + /// Your Observer. + void Subscribe(IObserver observer); + /// + /// Detach an observer from an object. + /// + /// Your observer. + void Unsubscribe(IObserver observer); + /// + /// Notify all observers about an event. + /// + void Notify(); + + void SetState(T state); + T GetState(); + } +} diff --git a/WindowsFormsApp1/OP/PropertyObserver.cs b/WindowsFormsApp1/OP/PropertyObserver.cs new file mode 100644 index 0000000..47a6b83 --- /dev/null +++ b/WindowsFormsApp1/OP/PropertyObserver.cs @@ -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 WindowsFormsApp1.OP +{ + public class PropertyObserver : IObserver + { + public PropertyObserver() + { } + + public void Update(ISubject subject) + { + MessageBox.Show(subject.GetState()); + } + } +} diff --git a/WindowsFormsApp1/OP/Subject.cs b/WindowsFormsApp1/OP/Subject.cs new file mode 100644 index 0000000..2a7b3c2 --- /dev/null +++ b/WindowsFormsApp1/OP/Subject.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; + +namespace WindowsFormsApp1.OP +{ + /// + /// Owns some important state and notifies observers when the state changes. + /// + public class Subject : ISubject + { + private protected List> _observers = null; + private object state { get;set; } + + public Subject() + { + _observers = new List>(); + } + + public virtual void Subscribe(IObserver observer) + { + _observers.Add(observer); + } + public virtual void Unsubscribe(IObserver observer) + { + _observers.Remove(observer); + } + public void Notify() + { + foreach (IObserver observer in _observers) + { + observer.Update(this); + } + } + public virtual void SetState(T state) + { + this.state = state; + Notify(); + } + public virtual T GetState() + { + return (T)state; + } + } +} diff --git a/WindowsFormsApp1/Program.cs b/WindowsFormsApp1/Program.cs new file mode 100644 index 0000000..4587d92 --- /dev/null +++ b/WindowsFormsApp1/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WindowsFormsApp1 +{ + internal 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/WindowsFormsApp1/Properties/AssemblyInfo.cs b/WindowsFormsApp1/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..54f799e --- /dev/null +++ b/WindowsFormsApp1/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("WindowsFormsApp1")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WindowsFormsApp1")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[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("79af4bd6-6931-4e8c-81d1-6464f70c480d")] + +// 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.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WindowsFormsApp1/Properties/Resources.Designer.cs b/WindowsFormsApp1/Properties/Resources.Designer.cs new file mode 100644 index 0000000..2261462 --- /dev/null +++ b/WindowsFormsApp1/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 WindowsFormsApp1.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("WindowsFormsApp1.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/WindowsFormsApp1/Properties/Resources.resx b/WindowsFormsApp1/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/WindowsFormsApp1/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/WindowsFormsApp1/Properties/Settings.Designer.cs b/WindowsFormsApp1/Properties/Settings.Designer.cs new file mode 100644 index 0000000..438df21 --- /dev/null +++ b/WindowsFormsApp1/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 WindowsFormsApp1.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/WindowsFormsApp1/Properties/Settings.settings b/WindowsFormsApp1/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/WindowsFormsApp1/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/WindowsFormsApp1/Test/BaseTextBox.cs b/WindowsFormsApp1/Test/BaseTextBox.cs new file mode 100644 index 0000000..a2bfae7 --- /dev/null +++ b/WindowsFormsApp1/Test/BaseTextBox.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using WindowsFormsApp1.classes; +using WindowsFormsApp1.OP; + +namespace WindowsFormsApp1.Test +{ + public class BaseTextBox : ABaseTexBox, OP.IObserver + { + public BaseTextBox() : base() + { + ForeColor = Color.White; + BackColor = Color.DarkOrange; + } + + public override string Description { get; set; } + + public void Update(ISubject subject) + { + + MessageBox.Show(subject.GetState()); + } + } +} diff --git a/WindowsFormsApp1/Test/ExtendedTB.cs b/WindowsFormsApp1/Test/ExtendedTB.cs new file mode 100644 index 0000000..b58eaf8 --- /dev/null +++ b/WindowsFormsApp1/Test/ExtendedTB.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.ComponentModel; + +namespace WindowsFormsApp1.Test +{ + public class ExtendedTB : BaseTextBox + { + public ExtendedTB() : base() + { + ForeColor = Color.White; + BackColor = Color.Red; + } + + public override void Reset() + { + base.Reset(); + Text = "Resetted!"; + } + + [DefaultValue(typeof(Color), "Red")] + public Color BackColor + { + get { return base.BackColor; } + set { base.BackColor = value; } + } + + public override string Description { get => base.Description; set => base.Description = value; } + } +} diff --git a/WindowsFormsApp1/WindowsFormsApp1.csproj b/WindowsFormsApp1/WindowsFormsApp1.csproj new file mode 100644 index 0000000..a940097 --- /dev/null +++ b/WindowsFormsApp1/WindowsFormsApp1.csproj @@ -0,0 +1,98 @@ + + + + + Debug + AnyCPU + {79AF4BD6-6931-4E8C-81D1-6464F70C480D} + WinExe + WindowsFormsApp1 + WindowsFormsApp1 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Component + + + Form + + + Form1.cs + + + + + + + + + + Component + + + Component + + + 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/WindowsFormsApp1/classes/ATextBox.cs b/WindowsFormsApp1/classes/ATextBox.cs new file mode 100644 index 0000000..ac4d18e --- /dev/null +++ b/WindowsFormsApp1/classes/ATextBox.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using WindowsFormsApp1.Test; + +namespace WindowsFormsApp1.classes +{ + public abstract class ABaseTexBox : TextBox + { + public virtual void Reset() => Text = string.Empty; + + private protected void ResetProperties() + { + Name = string.Empty; + Description = string.Empty; + } + + abstract public string Description { get; set; } + } +}