|
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace Senthil.Tools
{
class Program
{
static void Main(string[] args)
{
if (args.Length == 0 || !File.Exists(args[0]))
{
ShowHelp("Valid assembly path required");
return;
}
List<string> includedNamespaces;
List<string> excludedNamespaces;
ParseArguments(args, out includedNamespaces, out excludedNamespaces);
FindRefs.FindReferences(args[0], new TypeFilter(includedNamespaces, excludedNamespaces));
FindRefs.GenerateXML(Path.GetFileNameWithoutExtension(args[0]) + ".xml");
}
private static void ShowHelp(string message)
{
Console.WriteLine("FindRefs - Find outgoing references from your assembly");
Console.WriteLine("Written by : S. Senthil Kumar");
Console.WriteLine("Error : " + message);
}
static void ParseArguments(string[] args, out List<string> includeList, out List<string> excludeList)
{
bool parsingIncludes = false;
bool parsingExcludes = false;
includeList = new List<string>();
excludeList = new List<string>();
for (int i = 1; i < args.Length; ++i) // 0 is the input assembly, so skip it
{
if (args[i] == "-include")
{
parsingIncludes = true;
parsingExcludes = false;
continue;
}
if (args[i] == "-exclude")
{
parsingExcludes = true;
parsingIncludes = false;
continue;
}
if (parsingIncludes)
{
includeList.Add(args[i]);
}
else if (parsingExcludes)
{
excludeList.Add(args[i]);
}
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm a 27 yrs old developer working with Atmel R&D India Pvt. Ltd., Chennai. I'm currently working in C# and C++, but I've done some Java programming as well. I was a Microsoft MVP in Visual C# from 2007 to 2009.
You can read
My Blog here. I've also done some open source software - please visit my
website to know more.