public override DotnetStyleRequireAccessibilityModifiersStyle Add(DotnetStyleRequireAccessibilityModifiersStyle style) { if (style is null) { throw new ArgumentNullException(nameof(style)); } return(new DotnetStyleRequireAccessibilityModifiersStyle(this.Data.Add(style.Data), this.Severity)); }
public override DotnetStyleRequireAccessibilityModifiersStyle Update(NodeInformation <MemberDeclarationSyntax> information) { if (information is null) { throw new ArgumentNullException(nameof(information)); } var node = information.Node; if (!node.ContainsDiagnostics) { var modifiers = node.ChildTokens().Where( _ => DotnetStyleRequireAccessibilityModifiersStyle.AccessibilityModifiers.Contains(_.Text)).ToList(); var(occurence, isFromPublicInterfaceMember) = DotnetStyleRequireAccessibilityModifiersStyle.GetOccurence(node, modifiers); return(new DotnetStyleRequireAccessibilityModifiersStyle(this.Data.Update(occurence, isFromPublicInterfaceMember), this.Severity)); } return(new DotnetStyleRequireAccessibilityModifiersStyle(this.Data, this.Severity)); }