Exemple #1
0
        S IAstVisitor <T, S> .VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, T data)
        {
            var handler = FixedFieldDeclarationVisited;

            if (handler != null)
            {
                handler(fixedFieldDeclaration, data);
            }
            return(VisitChildren(fixedFieldDeclaration, data));
        }
        public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
        {
            FixAttributesAndDocComment(fixedFieldDeclaration);

            FormatCommas(fixedFieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma);

            var lastLoc = fixedFieldDeclaration.StartLocation;

            curIndent.Push(IndentType.Block);
            foreach (var initializer in fixedFieldDeclaration.Variables)
            {
                if (lastLoc.Line != initializer.StartLocation.Line)
                {
                    FixStatementIndentation(initializer.StartLocation);
                    lastLoc = initializer.StartLocation;
                }
                initializer.AcceptVisitor(this);
            }
            curIndent.Pop();
            FixSemicolon(fixedFieldDeclaration.SemicolonToken);
        }
Exemple #3
0
        public bool CheckField(ICS.FixedFieldDeclaration node, InspectionData data)
        {
            if ((MatchKind != 0 && (MatchKind & DeclarationKinds.Field) == 0))
            {
                return(false);
            }

            if (!CheckAttributedNode(node, ICS.Modifiers.Private))
            {
                return(false);
            }

            foreach (var v in node.Variables)
            {
                string name = v.Name;
                if (IsValid(name))
                {
                    continue;
                }
                data.Add(GetFixableResult(v.NameToken.StartLocation, null, name));
            }

            return(true);
        }
 void IAstVisitor.VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     Visit(EnterFixedFieldDeclaration, LeaveFixedFieldDeclaration, fixedFieldDeclaration);
 }
 public virtual S VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, T data)
 {
     return(VisitChildren(fixedFieldDeclaration, data));
 }
 public virtual S VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, T data)
 {
     throw new NotImplementedException();
 }