-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
57 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,12 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using PKHeX.Core; | ||
|
||
namespace PKHeX.Mobile.Logic | ||
namespace PKHeX.Mobile.Logic | ||
{ | ||
public static class BindingUtil | ||
{ | ||
/// <summary> | ||
/// Binding with a struct-based item works fine on Windows Forms, but others require an actual object (class) reference. | ||
/// </summary> | ||
/// <param name="list">Input list</param> | ||
/// <returns>Wrapped list</returns> | ||
public static ComboObject[] Convert(this IEnumerable<ComboItem> list) => list.Select(z => new ComboObject(z)).ToArray(); | ||
|
||
public static int GetValue(object val) | ||
{ | ||
if (val is int i) | ||
return i; | ||
return int.TryParse(val as string, out int v) ? v : 0; | ||
} | ||
} | ||
|
||
public class ComboObject | ||
{ | ||
public string Text { get; set; } | ||
public int Value { get; set; } | ||
|
||
public ComboObject(ComboItem item) | ||
{ | ||
Text = item.Text; | ||
Value = item.Value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
using System.Collections.Generic; | ||
using PKHeX.Core; | ||
using PKHeX.Mobile.Logic; | ||
|
||
namespace PKHeX.ViewModels | ||
{ | ||
public class ComboSource | ||
{ | ||
public IReadOnlyList<ComboObject> SpeciesList { get; } = GameInfo.FilteredSources.Species.Convert(); | ||
public IReadOnlyList<ComboObject> MoveList { get; } = GameInfo.FilteredSources.Moves.Convert(); | ||
public IReadOnlyList<ComboObject> ItemList { get; } = GameInfo.FilteredSources.Items.Convert(); | ||
public IReadOnlyList<ComboObject> NatureList { get; } = GameInfo.FilteredSources.Natures.Convert(); | ||
public IReadOnlyList<ComboObject> Versions { get; } = GameInfo.FilteredSources.Games.Convert(); | ||
public IReadOnlyList<ComboObject> Balls { get; } = GameInfo.FilteredSources.Balls.Convert(); | ||
public IReadOnlyList<ComboItem> SpeciesList { get; } = GameInfo.FilteredSources.Species; | ||
public IReadOnlyList<ComboItem> MoveList { get; } = GameInfo.FilteredSources.Moves; | ||
public IReadOnlyList<ComboItem> ItemList { get; } = GameInfo.FilteredSources.Items; | ||
public IReadOnlyList<ComboItem> NatureList { get; } = GameInfo.FilteredSources.Natures; | ||
public IReadOnlyList<ComboItem> Versions { get; } = GameInfo.FilteredSources.Games; | ||
public IReadOnlyList<ComboItem> Balls { get; } = GameInfo.FilteredSources.Balls; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters