/// <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;
        }
 public static MockedModuleTranslationUnit Create(ModuleTranslationUnit moduleTranslationUnit)
 {
     return new MockedModuleTranslationUnit(moduleTranslationUnit);
 }
 protected MockedModuleTranslationUnit(ModuleTranslationUnit original)
     : base(original)
 {
 }
 /// <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;
 }