#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

93 lines
2.4 KiB

// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using Boo.Lang.Compiler;
namespace NRefactoryToBooConverter
{
public sealed class ConverterSettings
{
CompilerErrorCollection errors;
CompilerWarningCollection warnings;
string fileName;
StringComparer nameComparer;
public const string DefaultNameGenerationPrefix = "converterGeneratedName";
public string NameGenerationPrefix = DefaultNameGenerationPrefix;
public bool SimplifyTypeNames = true;
static StringComparer GetComparer(string fileName)
{
if (System.IO.Path.GetExtension(fileName).ToLower() == ".vb")
return StringComparer.InvariantCultureIgnoreCase;
else
return StringComparer.InvariantCulture;
}
public bool IsVisualBasic {
get {
return System.IO.Path.GetExtension(fileName).ToLower() == ".vb";
}
}
public ConverterSettings(string fileName)
: this(fileName, GetComparer(fileName))
{
}
public ConverterSettings(string fileName, StringComparer nameComparer)
: this(fileName, nameComparer, new CompilerErrorCollection(), new CompilerWarningCollection())
{
}
public ConverterSettings(string fileName, CompilerErrorCollection errors, CompilerWarningCollection warnings)
: this(fileName, GetComparer(fileName), errors, warnings)
{
}
public ConverterSettings(string fileName, StringComparer nameComparer, CompilerErrorCollection errors, CompilerWarningCollection warnings)
{
if (fileName == null)
throw new ArgumentNullException("fileName");
if (nameComparer == null)
throw new ArgumentNullException("nameComparer");
if (errors == null)
throw new ArgumentNullException("errors");
if (warnings == null)
throw new ArgumentNullException("warnings");
this.errors = errors;
this.warnings = warnings;
this.fileName = fileName;
this.nameComparer = nameComparer;
}
public CompilerErrorCollection Errors {
get {
return errors;
}
}
public CompilerWarningCollection Warnings {
get {
return warnings;
}
}
public string FileName {
get {
return fileName;
}
}
public StringComparer NameComparer {
get {
return nameComparer;
}
}
}
}