Class describing properties.
Internal members protected for testability.
Inheritance: Rosetta.Translation.MemberTranslationUnit, ITranslationUnit, ICompoundTranslationUnit
 /// <summary>
 /// Copy initializes a new instance of the <see cref="MethodDeclarationTranslationUnit"/> class.
 /// </summary>
 /// <param name="other"></param>
 /// <remarks>
 /// For testability.
 /// </remarks>
 public PropertyDeclarationTranslationUnit(PropertyDeclarationTranslationUnit other)
     : base((MemberTranslationUnit)other)
 {
     this.getStatements = other.getStatements;
     this.setStatements = other.setStatements;
     this.type          = other.type;
     this.hasGet        = other.hasGet;
     this.hasSet        = other.hasSet;
 }
 /// <summary>
 /// Copy initializes a new instance of the <see cref="MethodDeclarationTranslationUnit"/> class.
 /// </summary>
 /// <param name="other"></param>
 /// <remarks>
 /// For testability.
 /// </remarks>
 public PropertyDeclarationTranslationUnit(PropertyDeclarationTranslationUnit other)
     : base((MemberTranslationUnit)other)
 {
     this.getStatements = other.getStatements;
     this.setStatements = other.setStatements;
     this.type = other.type;
     this.hasGet = other.hasGet;
     this.hasSet = other.hasSet;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyASTWalker"/> class.
        /// </summary>
        /// <param name="node"></param>
        /// <param name="propertyDeclaration"></param>
        /// <param name="semanticModel">The semantic model.</param>
        protected PropertyASTWalker(CSharpSyntaxNode node, PropertyDeclarationTranslationUnit propertyDeclaration, SemanticModel semanticModel)
            : base(node, semanticModel)
        {
            var propertyDeclarationSyntaxNode = node as PropertyDeclarationSyntax;
            if (propertyDeclarationSyntaxNode == null)
            {
                throw new ArgumentException(
                    string.Format("Specified node is not of type {0}",
                    typeof(PropertyDeclarationSyntax).Name));
            }

            if (propertyDeclaration == null)
            {
                throw new ArgumentNullException(nameof(propertyDeclaration));
            }

            this.propertyDeclaration = propertyDeclaration;

            // Going through accessors in the node and filling the translation unit with initial data
            this.VisitNode(propertyDeclarationSyntaxNode);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Copy initializes a new instance of the <see cref="PropertyASTWalker"/> class.
 /// </summary>
 /// <param name="other"></param>
 /// <remarks>
 /// For testability.
 /// </remarks>
 public PropertyASTWalker(PropertyASTWalker other)
     : base(other)
 {
     this.propertyDeclaration = other.propertyDeclaration;
 }