// // CodePropertyElement.cs - represents a CodeElement that defines a property // // Author: // Michael Becker // // Copyright (c) 2011-2020 Mike Becker's Software // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . using System; namespace UniversalEditor.ObjectModels.SourceCode.CodeElements { /// /// Represents a that defines a property. /// public class CodePropertyElement : CodeElement, INamedCodeElement, IAccessModifiableCodeElement { public string Name { get; set; } = String.Empty; public string GetFullName(string separator = ".") { return CodeElement.GetFullName(this, separator); } public CodeAccessModifiers AccessModifiers { get; set; } = CodeAccessModifiers.None; public CodeMethodElement GetMethod { get; set; } = null; public CodeMethodElement SetMethod { get; set; } = null; /// /// Gets or sets the data type of the property. /// /// The data type of the property. public string DataType { get; set; } = null; /// /// Gets or sets a value indicating whether this /// represents an abstract property (one that must be /// overridden in a derived class). /// /// true if the property is abstract; otherwise, false. public bool IsAbstract { get; set; } = false; /// /// Gets or sets a value indicating whether this /// represents a virtual property (one that may be overridden /// in a derived class). /// /// true if the property is virtual; otherwise, false. public bool IsVirtual { get; set; } = false; /// /// Gets or sets a value indicating whether this /// represents a property that is overriding a property in a /// derived class. /// /// true if the property is overriding a property in a derived class; otherwise, false. public bool IsOverriding { get; set; } = false; /// /// Gets a collection of instances representing the parameters accepted by the property indexer. /// /// The parameters accepted by the property indexer. public CodeVariableElement.CodeVariableElementCollection Parameters { get; } = new CodeVariableElement.CodeVariableElementCollection(); /// /// Gets or sets a value indicating whether this /// contains an auto-generated get method. /// /// true if the property contains an auto-generated get method; otherwise, false. public bool AutoGenerateGetMethod { get; set; } = false; /// /// Gets or sets a value indicating whether this /// contains an auto-generated set method. /// /// true if the property contains an auto-generated set method; otherwise, false. public bool AutoGenerateSetMethod { get; set; } = false; /// /// Gets or sets a value indicating whether this /// represents a property that is static (l /// /// true if the property contains an auto-generated get method; otherwise, false. public bool IsStatic { get; set; } = false; } }