-
Notifications
You must be signed in to change notification settings - Fork 173
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
2 changed files
with
48 additions
and
0 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
47 changes: 47 additions & 0 deletions
47
EDEngineer/Converters/EntryDataToMaterialTraderLocation.cs
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using System.Windows.Media; | ||
using EDEngineer.Localization; | ||
using EDEngineer.Models; | ||
using EDEngineer.Models.Loadout; | ||
|
||
namespace EDEngineer.Converters | ||
{ | ||
public class EntryDataToMaterialTraderLocation : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
{ | ||
return null; | ||
} | ||
|
||
var entryData = (EntryData) value; | ||
|
||
switch (entryData.Subkind) | ||
{ | ||
case Subkind.Manufactured: | ||
return Languages.Instance.Translate( | ||
"Materials Trader found at industrial economies, only trades in manufactured materials."); | ||
case Subkind.Raw: | ||
return Languages.Instance.Translate( | ||
"Materials Trader found at extraction and refinery economies, only trades in raw material found on planet surfaces and planetary rings."); | ||
default: | ||
switch (entryData.Kind) | ||
{ | ||
case Kind.Data: | ||
return Languages.Instance.Translate( | ||
"Materials Trader found at High Tech and Military economies, only trades in encoded materials."); | ||
default: | ||
return null; | ||
} | ||
} | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |