Beispiel #1
0
    // Searchs for the passed string in the type names of all
    // assemblies in the specified paths.
    public void Search(String theSearchString)
    {
        //
        // Search the directory where mscorlib is located.
        //
        Assembly testAssy = Assembly.Load("mscorlib.dll");

        myVerboseWriter.WriteLine("Searching BCL");
        String dirFrameworks = Path.GetDirectoryName(testAssy.Location);

        ArrayList l = new ArrayList();

        BuildDLLFileList(dirFrameworks, l);
        for (int j = 0; j < l.Count; j++)
        {
            Search(theSearchString, (String)l[j]);
        }

        //
        // Search the current directory
        //
        myVerboseWriter.WriteLine("Searching the current directory...");
        l = new ArrayList();
        BuildDLLFileList(".", l);
        for (int j = 0; j < l.Count; j++)
        {
            Search(theSearchString, (String)l[j]);
        }

        //
        // Search the specified directories
        //
        Object[] dir = DirList.ToArray();
        for (int i = 0; i < dir.Length; i++)
        {
            myVerboseWriter.WriteLine("Searching directory  {0}...", dir[i]);

            l = new ArrayList();
            BuildDLLFileList((String)dir[i], l);

            for (int j = 0; j < l.Count; j++)
            {
                Search(theSearchString, (String)l[j]);
            }
        }
    }
Beispiel #2
0
        // Searchs for the passed string in the type names of all
        // .NET Framework assemblies and all DLLs in the specified paths.
        public void Search(String theSearchString)
        {
            //
            // Search the .NET Framework Directory
            //
            Assembly testAssy = typeof(object).Assembly;

            myVerboseWriter.WriteLine("Searching System Libraries");

            String    dirFrameworks = Path.GetDirectoryName(testAssy.Location);
            ArrayList l             = new ArrayList();

            BuildDLLFileList(dirFrameworks, l);
            for (int j = 0; j < l.Count; j++)
            {
                Search(theSearchString, (String)l[j]);
            }

            //
            // Search the current directory
            //
            myVerboseWriter.WriteLine("Searching the current directory...");
            l = new ArrayList();
            BuildDLLFileList(".", l);
            for (int j = 0; j < l.Count; j++)
            {
                Search(theSearchString, (String)l[j]);
            }

            //
            // Search the specified directories
            //
            Object[] dir = DirList.ToArray();

            for (int i = 0; i < dir.Length; i++)
            {
                myVerboseWriter.WriteLine("Searching directory  {0}...", dir[i]);
                l = new ArrayList();
                BuildDLLFileList((String)dir[i], l);
                for (int j = 0; j < l.Count; j++)
                {
                    Search(theSearchString, (String)l[j]);
                }
            }
        }
Beispiel #3
0
    // Searchs for the passed string in the type names of all
    // assemblies in the specified paths.
    public void Search(String theSearchString)
    {
        //
        // Search the directory where mscorlib is located.
        //
        myVerboseWriter.WriteLine("Searching BCL");

        ArrayList l = new ArrayList();

        BuildDLLFileList(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), l);
        for (int j = 0; j < l.Count; j++)
        {
            Search(theSearchString, (String)l[j]);
        }

        //
        // Search the current directory
        //
        myVerboseWriter.WriteLine("Searching the current directory...");
        l = new ArrayList();
        BuildDLLFileList(".", l);
        for (int j = 0; j < l.Count; j++)
        {
            Search(theSearchString, (String)l[j]);
        }

        //
        // Search the specified directories
        //
        Object[] dir = DirList.ToArray();
        for (int i = 0; i < dir.Length; i++)
        {
            myVerboseWriter.WriteLine("Searching directory  {0}...", dir[i]);

            l = new ArrayList();
            BuildDLLFileList((String)dir[i], l);

            for (int j = 0; j < l.Count; j++)
            {
                Search(theSearchString, (String)l[j]);
            }
        }
    }