/// <summary> /// Determines if the specified code property is an explicit interface implementation. /// </summary> /// <param name="codeProperty">The code property.</param> /// <returns>True if an explicit interface implementation, otherwise false.</returns> public static bool IsExplicitInterfaceImplementation(CodeProperty codeProperty) { // In some VS editions, the name may be reported including the interface name. if (codeProperty.Name.Contains(".")) { return(true); } // Otherwise, look for the element name with a preceding dot. var declaration = CodeElementHelper.GetPropertyDeclaration(codeProperty); var matchString = @"\." + codeProperty.Name; return(RegexNullSafe.IsMatch(declaration, matchString)); }
/// <summary> /// Inserts a blank line after the specified point except where adjacent to a brace. /// </summary> /// <param name="point">The point.</param> internal static void InsertBlankLineAfterPoint(EditPoint point) { if (point.AtEndOfDocument) { return; } point.LineDown(1); point.StartOfLine(); string text = point.GetLine(); if (RegexNullSafe.IsMatch(text, @"^\s*[^\s\}]")) { point.Insert(Environment.NewLine); } }
/// <summary> /// Inserts a blank line before the specified point except where adjacent to a brace. /// </summary> /// <param name="point">The point.</param> internal static void InsertBlankLineBeforePoint(EditPoint point) { if (point.Line <= 1) { return; } point.LineUp(1); point.StartOfLine(); string text = point.GetLine(); if (RegexNullSafe.IsMatch(text, @"^\s*[^\s\{]")) // If it is not a scope boundary, insert newline. { point.EndOfLine(); point.Insert(Environment.NewLine); } }