Game Development Reference
In-Depth Information
{
string fileType = null;
foreach (string fileName in fileNames)
{
string extension = Path.GetExtension(fileName);
if (fileType == null)
{
fileType = extension;
}
else if (fileType != extension)
{
throw new ArgumentException(“All source code files must be “ +
“written in the same language!”);
}
}
CodeDomProvider codeProvider = null;
switch (fileType)
{
case “.cs”:
{
codeProvider = new Microsoft.CSharp.CSharpCodeProvider();
break;
}
case “.vb”:
{
codeProvider = new Microsoft.CSharp.CSharpCodeProvider();
break;
}
case “.js”:
{
codeProvider = new Microsoft.VJSharp.VJSharpCodeProvider();
break;
}
default:
{
throw new InvalidOperationException(“Invalid source code “ +
“file extension!”);
}
}
Search Nedrilad ::




Custom Search