|
using System;
using System.Collections.Generic;
using System.Text;
namespace LineCount.CodeContainers
{
/// <summary>
/// Simple factory idiom for creating the appropriate code container based
/// on the path entered in the application
/// </summary>
class CodeContainerFactory
{
public CodeContainer CreateCodeContainer(string fullName)
{
CodeContainer result = null;
if (fullName.EndsWith(".sln"))
result = new Solution(fullName);
else if (fullName.EndsWith(".vbproj") || fullName.EndsWith(".csproj"))
result = new Project(fullName);
else if (fullName.EndsWith(".cs") || fullName.EndsWith(".vb"))
result = new CodeFile(fullName);
return result;
}
}
}
|
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 work in the investment banking division of a large American bank. I work in credit technology.
I write a blog about technical issues in
.Net and other computer technologies that interest me at
http://richnewman.wordpress.com/. I also write occasionally about
derivatives.