예제 #1
0
        /// <inheritdoc/>
        public override void VisitUsingDirective(UsingDirectiveSyntax node)
        {
            var nameTxt = node.Name.ToString();

            if (GeneratorAttributesNameSpace.Equals(nameTxt, StringComparison.Ordinal))
            {
                var txt = node.ToFullString();

                this.strategy.RepeatNameSpace(
                    ns =>
                {
                    this.Write(txt.Replace(GeneratorAttributesNameSpace, ns));
                });
            }
            else
            {
                if (!nameTxt.StartsWith("SoloX.GeneratorTools.Core.CSharp.Generator", StringComparison.Ordinal) &&
                    !nameTxt.StartsWith("SoloX.GeneratorTools.Attributes", StringComparison.Ordinal) &&
                    !nameTxt.StartsWith("SoloX.GeneratorTools.Generator.Patterns", StringComparison.Ordinal) &&
                    !this.strategy.IgnoreUsingDirective(nameTxt))
                {
                    this.Write(node.ToFullString());
                }
            }
        }
예제 #2
0
        public override void VisitUsingDirective(UsingDirectiveSyntax node)
        {
            var name = node.Name.ToString();

            if (debug)
            {
                Console.WriteLine(node.ToFullString());
            }
            var nl = OurLine.NewLine(LineKind.Decl, "UsingDirective");

            OurLine.AddEssentialInfo(ref nl, "name:" + name);
            OurLine.AddEssentialInfo(ref nl, "staticKeyword:" + node.StaticKeyword.Text);
            nl.Source     = node.ToFullString();
            nl.ParentKind = node.Parent.RawKind;
            nl.RawKind    = node.RawKind;
            LogCommand(nl);

            // System.Console.WriteLine("info: " + nodeContent);
            base.VisitUsingDirective(node);
        }
예제 #3
0
        /// <inheritdoc/>
        public override void VisitUsingDirective(UsingDirectiveSyntax node)
        {
            if (!this.writerSelector.SelectAndProcessWriter(node, this.Write))
            {
                var txt = node.ToFullString()
                          .Replace(this.implPattern.Name, this.implName)
                          .Replace(this.itfPattern.DeclarationNameSpace, this.declaration.DeclarationNameSpace);

                if (!txt.Contains("SoloX.GeneratorTools.Core.CSharp.Generator.Attributes"))
                {
                    this.Write(txt);
                }
            }
        }