Skip to content

Commit

Permalink
! Code refactoring and display optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
wmjordan committed May 4, 2018
1 parent b876045 commit 02ee3f7
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 177 deletions.
1 change: 0 additions & 1 deletion Codist/Helpers/CodeAnalysisHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ public static StandardGlyphItem GetGlyphItem(this ISymbol symbol) {
}
public static ITypeSymbol GetReturnType(this ISymbol symbol) {
switch (symbol.Kind) {
case SymbolKind.Event: return (symbol as IEventSymbol).RaiseMethod.ReturnType;
case SymbolKind.Field: return (symbol as IFieldSymbol).Type;
case SymbolKind.Local: return (symbol as ILocalSymbol).Type;
case SymbolKind.Method: return (symbol as IMethodSymbol).ReturnType;
Expand Down
10 changes: 10 additions & 0 deletions Codist/Helpers/UIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ public static TextBlock AddText(this TextBlock block, string text, bool bold) {
public static TextBlock AddText(this TextBlock block, string text, WpfBrush brush) {
return block.AddText(text, false, false, brush);
}
public static TextBlock AddSymbolDisplayParts(this TextBlock block, System.Collections.Immutable.ImmutableArray<SymbolDisplayPart> parts, SymbolFormatter formatter) {
return formatter.ToUIText(block, parts, Int32.MinValue);
}
public static TextBlock AddSymbolDisplayParts(this TextBlock block, System.Collections.Immutable.ImmutableArray<SymbolDisplayPart> parts, SymbolFormatter formatter, int argIndex) {
return formatter.ToUIText(block, parts, argIndex);
}
public static TextBlock AddSymbol(this TextBlock block, ISymbol symbol, SymbolFormatter formatter) {
formatter.ToUIText(block.Inlines, symbol);
return block;
}
public static TextBlock AddSymbol(this TextBlock block, ISymbol symbol, bool bold, WpfBrush brush) {
block.Inlines.Add(Render(symbol, bold, brush));
return block;
Expand Down
2 changes: 1 addition & 1 deletion Codist/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.7.0.0")]
[assembly: AssemblyFileVersion("2.7.0.980")]
[assembly: AssemblyFileVersion("2.7.0.989")]
Loading

0 comments on commit 02ee3f7

Please sign in to comment.