Skip to content

Commit

Permalink
fix: code clean up for codefactor
Browse files Browse the repository at this point in the history
  • Loading branch information
FreakyAli committed Sep 8, 2023
1 parent 348b7e7 commit 6f0fd74
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@ namespace Maui.FreakyControls.Extensions;

public static class ExceptionExtensions
{

public static void TraceException(this Exception exception)
{
var stringBuilder = new StringBuilder();

while (exception != null)
{
stringBuilder.AppendLine(exception.Message);
stringBuilder.AppendLine(exception.StackTrace);

exception = exception.InnerException;
}

Trace.TraceError(stringBuilder.ToString());
}
}
1 change: 0 additions & 1 deletion MAUI.FreakyControls/Samples/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ public AppShell()
Routing.RegisterRoute(radioButtons, typeof(RadioButtons.RadioButtonsView));
Routing.RegisterRoute(buttons, typeof(ButtonsView.ButtonsView));
Routing.RegisterRoute(jumpList, typeof(JumpList.JumpListView));

}
}
28 changes: 13 additions & 15 deletions MAUI.FreakyControls/Samples/JumpList/EnglishAlphabetProvider.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
using Maui.FreakyControls;

namespace Samples.JumpList
{
public class EnglishAlphabetProvider : IAlphabetProvider
{
private string alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ#";
namespace Samples.JumpList;

public IEnumerable<char> GetAlphabet()
{
foreach (var c in alphabets)
{
yield return c;
}
}
public class EnglishAlphabetProvider : IAlphabetProvider
{
private string alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ#";

public int GetCount()
public IEnumerable<char> GetAlphabet()
{
foreach (var c in alphabets)
{
return alphabets.Length;
yield return c;
}
}
}

public int GetCount()
{
return alphabets.Length;
}
}
3 changes: 1 addition & 2 deletions MAUI.FreakyControls/Samples/JumpList/JumpListViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ public JumpListViewModel()

Names = names.OrderBy(x => x).ToList();
}
}

}
2 changes: 0 additions & 2 deletions MAUI.FreakyControls/Samples/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace Samples
{
public class MainViewModel : BaseViewModel
{

private ObservableCollection<string> items;

public MainViewModel()
Expand All @@ -26,7 +25,6 @@ public MainViewModel()
AppShell.radioButtons,
AppShell.buttons,
AppShell.jumpList

};
}

Expand Down
3 changes: 1 addition & 2 deletions MAUI.FreakyControls/Samples/PermissionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ public static async Task<PermissionStatus> CheckAndRequestPermissionAsync<T>(Fun
status = await Permissions.RequestAsync<T>();
return status;
}
}

}

0 comments on commit 6f0fd74

Please sign in to comment.