コード例 #1
0
        /// <summary>
        /// Copy initializes a new instance of the <see cref="ModuleTranslationUnit"/> class.
        /// </summary>
        /// <param name="other"></param>
        /// <remarks>
        /// For testability.
        /// </remarks>
        public ModuleTranslationUnit(ModuleTranslationUnit other)
            : base()
        {
            this.classes    = other.classes;
            this.enums      = other.enums;
            this.interfaces = other.interfaces;

            this.name = other.name;
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NamespaceASTWalker"/> class.
        /// </summary>
        protected NamespaceASTWalker(CSharpSyntaxNode node)
        {
            var namespaceSyntaxNode = node as NamespaceDeclarationSyntax;
            if (namespaceSyntaxNode == null)
            {
                throw new ArgumentException(
                    string.Format("Specified node is not of type {0}",
                    typeof(NamespaceDeclarationSyntax).Name));
            }

            this.node = node;
            NamespaceDeclaration namespaceHelper = new NamespaceDeclaration(namespaceSyntaxNode);

            this.module = ModuleTranslationUnit.Create(
                IdentifierTranslationUnit.Create(namespaceHelper.Name));
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NamespaceASTWalker"/> class.
        /// </summary>
        /// <param name="node"></param>
        /// <param name="module"></param>
        /// <param name="semanticModel">The semantic model.</param>
        protected NamespaceASTWalker(CSharpSyntaxNode node, ModuleTranslationUnit module, SemanticModel semanticModel)
            : base(node, semanticModel)
        {
            var namespaceSyntaxNode = node as NamespaceDeclarationSyntax;
            if (namespaceSyntaxNode == null)
            {
                throw new ArgumentException(
                    string.Format("Specified node is not of type {0}",
                    typeof(NamespaceDeclarationSyntax).Name));
            }

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

            this.module = module;
        }
コード例 #4
0
 public static MockedModuleTranslationUnit Create(ModuleTranslationUnit moduleTranslationUnit)
 {
     return new MockedModuleTranslationUnit(moduleTranslationUnit);
 }
コード例 #5
0
 protected MockedModuleTranslationUnit(ModuleTranslationUnit original)
     : base(original)
 {
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NamespaceDefinitionASTWalker"/> class.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="module"></param>
 /// <param name="semanticModel">The semantic model.</param>
 protected NamespaceDefinitionASTWalker(CSharpSyntaxNode node, ModuleTranslationUnit module, SemanticModel semanticModel)
     : base(node, module, semanticModel)
 {
 }
コード例 #7
0
 /// <summary>
 /// Copy initializes a new instance of the <see cref="NamespaceASTWalker"/> class.
 /// </summary>
 /// <param name="other"></param>
 /// <remarks>
 /// For testability.
 /// </remarks>
 public NamespaceASTWalker(NamespaceASTWalker other)
     : base(other)
 {
     this.module = other.module;
 }