private bool IsSeparatedSystemUsing(UsingDirectiveSyntax syntax) { if (!this.separateSystemDirectives) { return(false); } return(syntax.Alias == null && syntax.IsSystemUsingDirective() && !syntax.HasNamespaceAliasQualifier() && syntax.StaticKeyword.IsKind(SyntaxKind.None)); }
/// <summary> /// Get the <see cref="UsingGroup"/> for the give using directive. /// </summary> /// <param name="usingDirective">The <see cref="UsingDirectiveSyntax"/> that will be used.</param> /// <param name="settings">The <see cref="StyleCopSettings"/> that will be used.</param> /// <returns>The <see cref="UsingGroup"/> for the given <paramref name="usingDirective"/>.</returns> internal static UsingGroup GetUsingGroupType(this UsingDirectiveSyntax usingDirective, StyleCopSettings settings) { if (usingDirective.StaticKeyword.IsKind(SyntaxKind.StaticKeyword)) { return(UsingGroup.Static); } if (usingDirective.Alias != null) { return(UsingGroup.Alias); } if (settings.OrderingRules.SystemUsingDirectivesFirst && usingDirective.IsSystemUsingDirective()) { return(UsingGroup.System); } return(UsingGroup.Regular); }
private bool IsSeparatedSystemUsing(UsingDirectiveSyntax syntax) { if (!this.separateSystemDirectives) { return false; } return syntax.Alias == null && syntax.IsSystemUsingDirective() && !syntax.HasNamespaceAliasQualifier() && syntax.StaticKeyword.IsKind(SyntaxKind.None); }