示例#1
0
        static bool IsBlacklisted(Type t, NSInput nsi)
        {
            bool startBlacklisted    = !string.IsNullOrEmpty(nsi.StartsWithBlacklist) && t.Name.StartsWith(nsi.StartsWithBlacklist);
            bool containsBlacklisted = nsi.ContainsBlacklist != null && nsi.ContainsBlacklist.Any(c => t.Name.Contains(c));

            return(startBlacklisted || containsBlacklisted);
        }
示例#2
0
        static bool IsValidNamespace(Type t, NSInput nsi)
        {
            if (string.IsNullOrEmpty(t.Namespace))
            {
                return(false);
            }

            return(t.Namespace == nsi.NameSpace);
        }
示例#3
0
        static string[] GetFilteredTypeTitles(NSInput nsi)
        {
            var all           = GetAssemblyByName(nsi.Asm).GetTypes();
            var valid         = all.Where(c => IsValidNamespace(c, nsi));
            var filtered      = valid.Where(c => nsi.Filter(c));
            var ordered       = filtered.OrderBy(c => c.Name);
            var whitelisted   = ordered.Where(c => !IsBlacklisted(c, nsi));
            var friendlyNamed = whitelisted.Select(c => new FriendlyNameResolver(c).GetTypeTitle());

            return(friendlyNamed.ToArray());
        }
示例#4
0
 public NSResult GetTypesInNS(NSInput nsi) => new NSResult(nsi.ToString(), GetFilteredTypeTitles(nsi));