- Added AvailableImporters property to ImporterManager - Choosing importers via dropdown list in a propertyGrid is now possible.
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using System.Collections.Specialized;
|
|
using System.Linq;
|
|
using System.ComponentModel;
|
|
|
|
namespace ANX.Framework.Content.Pipeline.Tasks
|
|
{
|
|
/// <summary>
|
|
/// Class for enabling a dropdown list containing all available Importers for the PropertyGrid.
|
|
/// </summary>
|
|
public class ImporterConverter : StringConverter
|
|
{
|
|
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
|
|
{
|
|
//Show comboBox
|
|
return true;
|
|
}
|
|
|
|
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
|
{
|
|
//Non editable list
|
|
return true;
|
|
}
|
|
|
|
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
|
{
|
|
var iManager = new ImporterManager(); //<- No, thats not a new apple product :-)
|
|
return new StandardValuesCollection(iManager.AvailableImporters.Select(availableImporter => availableImporter.Key).ToArray()); //TODO: Implement correct call to get available Importers
|
|
}
|
|
}
|
|
}
|