App.xaml.cs 935 B

1234567891011121314151617181920212223242526272829303132333435
  1. using Microsoft.CodeAnalysis.CodeActions;
  2. using RoslynPad.Roslyn.CodeActions;
  3. using System;
  4. using System.Globalization;
  5. using System.Windows;
  6. using System.Windows.Data;
  7. using System.Windows.Markup;
  8. namespace RoslynPadReplSample
  9. {
  10. /// <summary>
  11. /// Interaction logic for App.xaml
  12. /// </summary>
  13. public partial class App : Application
  14. {
  15. }
  16. internal sealed class CodeActionsConverter : MarkupExtension, IValueConverter
  17. {
  18. public override object ProvideValue(IServiceProvider serviceProvider)
  19. {
  20. return this;
  21. }
  22. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  23. {
  24. return ((CodeAction)value).GetCodeActions();
  25. }
  26. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  27. {
  28. throw new NotSupportedException();
  29. }
  30. }
  31. }