GetAllTypes() public method

public GetAllTypes ( ) : string[]
return string[]
Esempio n. 1
0
    private void ResetTest()
    {
        tests.Clear();
        var types = env.GetAllTypes();

        foreach (var t in types)
        {
            var tclr = env.GetType(t) as CLRSharp.Type_Common_CLRSharp;
            if (tclr != null && tclr.type_CLRSharp.HasMethods)
            {
                foreach (var m in tclr.type_CLRSharp.Methods)
                {
                    var mm = tclr.GetMethod(m.Name, CLRSharp.MethodParamList.constEmpty());
                    if (mm != null)
                    {
                        if (mm.Name.IndexOf("UnitTest") == 0)
                        {
                            tests.Add(new TestItem(tclr, m.Name));
                        }
                    }
                }
                if (tclr.type_CLRSharp.HasNestedTypes)
                {
                    foreach (var ttt in tclr.type_CLRSharp.NestedTypes)
                    {
                        var tclr2 = env.GetType(ttt.FullName) as CLRSharp.Type_Common_CLRSharp;

                        foreach (var m in tclr2.GetAllMethods())
                        {
                            if (m.ParamList.Count == 0)
                            {
                                if (m.Name.Contains("UnitTest"))
                                {
                                    tests.Add(new TestItem(tclr, m.Name));
                                }
                            }
                        }
                    }
                }
            }
        }
    }