Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

TypeSelectAttribute

A topic by CatyboyStudio created Oct 14, 2022 Views: 76
Viewing posts 1 to 1

After entering the keyword, use the Enter key to activate the selection box,then select to set the System.Type data

[TypeSelect]
public string StringValue;

“System.Type” and “string” data type are supported

 TypeSelect can specify the data source for the selection box by setting “DataSource”. data sources support properties and methods. The method returns data support DropdownList, ICollection, IEnumerable

 Data source method sample

private static IEnumerable<Type> DataSource()
{
  yield return typeof(int);
  yield return typeof(bool);
}

 

TypeSelect can specify a Type file by setting “Filter”.

The filter method is defined as bool Filter(Type type, string input).

Filter method sample

private static bool DataFilter(Type type, string input)
{
    return type.Name.Contains(input);
}