Forge/Editor/AddDataPopupWindow.cs
/// <summary>
/// Returns the list of data types available after being filtered by the given filter.
/// </summary>
Returns the list of data types available after being filtered by the given filter.
Returns the list of data types available after being filtered by the given filter .
private List<Type> GetFilteredTypes(string filter) {
            List<Type> result = new List<Type>();
            foreach (var candidateType in _cachedDataSubtypes.Value) {
                string candidateName = candidateType.FullName;
                string[] subwords = filter.Split(new[] { ' ', '.' },
                    StringSplitOptions.RemoveEmptyEntries);
                bool contains = true;
                foreach (string subword in subwords) {
                    if (candidateName.IndexOf(subword, StringComparison.OrdinalIgnoreCase) < 0) {
                        contains = false;
                        break;
                    }
                }
                if (contains) {
                    result.Add(candidateType);
                }
            }
            return result;
        }
private List < Type > GetFilteredTypes ( string filter ) { List < Type > result = new List < Type > ( ) ; foreach ( var candidateType in _cachedDataSubtypes . Value ) { string candidateName = candidateType . FullName ; string [ ] subwords = filter . Split ( new [ ] { ' ' , ' ' } , StringSplitOptions . RemoveEmptyEntries ) ; bool contains = true ; foreach ( string subword in subwords ) { if ( candidateName . IndexOf ( subword , StringComparison . OrdinalIgnoreCase ) < 0 ) { contains = false ; break ; } } if ( contains ) { result . Add ( candidateType ) ; } } return result ; }
Returns the list of data types available after being filtered by the given filter.
Returns the list of data types available after being filtered by the given filter .
filter
string