From 3689238cb9ca77cbd7fa34dbd15003af87266e36 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 4 Dec 2017 18:44:33 +0200 Subject: Added Code Generation Library. --- .../Visual_Studio/Tango.CodeGeneration/Property.cs | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/Property.cs (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Property.cs') diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Property.cs b/Software/Visual_Studio/Tango.CodeGeneration/Property.cs new file mode 100644 index 000000000..d7ca5f4a8 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/Property.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + /// + /// Represents a property code object. + /// + /// + public class Property : CodeObject + { + /// + /// Gets or sets the property name. + /// + public String Name { get; set; } + + /// + /// Gets or sets the property type. + /// + public String Type { get; set; } + + /// + /// Gets or sets the property setter modifier. + /// + public CodeObjectModifier SetterModifier { get; set; } + + /// + /// Gets or sets a value indicating whether this property has a setter. + /// + public bool HasSetter { get; set; } + + /// + /// Gets or sets the content of the setter. + /// + public String SetterContent { get; set; } + + /// + /// Gets or sets the content of the getter. + /// + public String GetterContent { get; set; } + + /// + /// Gets the private field. + /// + /// + public virtual String GetPrivateField() + { + return "_" + Name.ToLower(); + } + + /// + /// Initializes a new instance of the class. + /// + public Property() + : base() + { + Name = "MyProperty"; + Type = "int"; + SetterModifier = CodeObjectModifier.None; + } + + /// + /// Initializes a new instance of the class. + /// + /// The name. + /// The type. + public Property(String name, String type) + : this() + { + Name = name; + Type = type; + } + } +} -- cgit v1.3.1