Esempio n. 1
0
		/// <summary>
		/// Makes the given node [EditorBrowsable(Never)].
		/// </summary>
		public static void MakeNonBrowsable(AttributedNode node)
		{
			AttributeSection section = new AttributeSection();
			ICSharpCode.NRefactory.Parser.AST.Attribute attribute =
				new ICSharpCode.NRefactory.Parser.AST.Attribute("System.ComponentModel.EditorBrowsable",
				new List<Expression>(), null);

			attribute.PositionalArguments.Add(new FieldReferenceExpression(new TypeReferenceExpression(
				"System.ComponentModel.EditorBrowsableState"), "Never"));

			section.Attributes.Add(attribute);
			node.Attributes.Add(section);
		}
Esempio n. 2
0
        /// <summary>
        /// Makes the given node [EditorBrowsable(Never)].
        /// </summary>
        public static void MakeNonBrowsable(AttributedNode node)
        {
            AttributeSection section = new AttributeSection();

            ICSharpCode.NRefactory.Parser.AST.Attribute attribute =
                new ICSharpCode.NRefactory.Parser.AST.Attribute("System.ComponentModel.EditorBrowsable",
                                                                new List <Expression>(), null);

            attribute.PositionalArguments.Add(new FieldReferenceExpression(new TypeReferenceExpression(
                                                                               "System.ComponentModel.EditorBrowsableState"), "Never"));

            section.Attributes.Add(attribute);
            node.Attributes.Add(section);
        }
 public virtual object Visit(ICSharpCode.NRefactory.Parser.AST.Attribute attribute, object data)
 {
     Debug.Assert(attribute != null);
     Debug.Assert(attribute.PositionalArguments != null);
     Debug.Assert(attribute.NamedArguments != null);
     foreach (Expression e in attribute.PositionalArguments)
     {
         Debug.Assert(e != null);
         e.AcceptVisitor(this, data);
     }
     foreach (NamedArgumentExpression n in attribute.NamedArguments)
     {
         Debug.Assert(n != null);
         n.AcceptVisitor(this, data);
     }
     return(data);
 }
Esempio n. 4
0
 private void Attribute(out ICSharpCode.NRefactory.Parser.AST.Attribute attribute)
 {
     string str;
     string val = null;
     if ((this.la.kind == 1) && (this.Peek(1).kind == 10))
     {
         base.lexer.NextToken();
         val = this.t.val;
         base.Expect(10);
     }
     this.Qualident(out str);
     List<Expression> positional = new List<Expression>();
     List<NamedArgumentExpression> named = new List<NamedArgumentExpression>();
     string name = ((val != null) && (val != "global")) ? (val + "." + str) : str;
     if (this.la.kind == 20)
     {
         this.AttributeArguments(positional, named);
     }
     attribute = new ICSharpCode.NRefactory.Parser.AST.Attribute(name, positional, named);
 }