diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Doc/TODO.txt b/src/AddIns/BackendBindings/CPPNetBinding/Doc/TODO.txt deleted file mode 100644 index 9049e7ac7d..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Doc/TODO.txt +++ /dev/null @@ -1,3 +0,0 @@ -- dependencies should be maintained during editing -- folding -- autocomplete diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Resources/CPPNetBinding.addin b/src/AddIns/BackendBindings/CPPNetBinding/Project/Resources/CPPNetBinding.addin deleted file mode 100644 index 34d665c283..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Resources/CPPNetBinding.addin +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/AssemblyInfo.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/AssemblyInfo.cs deleted file mode 100644 index 3ee3fc7ef1..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/AssemblyInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following -// attributes. -// -// change them to the information which is associated with the assembly -// you compile. - -[assembly: AssemblyTitle("CPPNetBinding")] -[assembly: AssemblyDescription("C++.NET language binding for #develop")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("www.icsharpcode.net")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("(c) 2004 Mike Krueger")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("2.0.0.1")] - -// The following attributes specify the key for the sign of your assembly. See the -// .NET Framework documentation for more information about signing. -// This is not required, if you don't want signing let these attributes like they're. -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetBindingCompilerManager.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetBindingCompilerManager.cs deleted file mode 100644 index 81dbc30508..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetBindingCompilerManager.cs +++ /dev/null @@ -1,565 +0,0 @@ -// -// -// -// -// -// - -using System; -using System.Collections; -using System.IO; -using System.Diagnostics; -using System.Text; -using System.Text.RegularExpressions; -using System.CodeDom.Compiler; - -using ICSharpCode.Core; - -using ICSharpCode.SharpDevelop.Internal.Project; -using ICSharpCode.SharpDevelop.Gui; -using System.Windows.Forms; - -namespace CPPBinding -{ - /// - /// This class controls the compilation of C Sharp files and C Sharp projects - /// - public class CPPBindingCompilerManager - { - private FileUtilityService _fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService)); - private StringBuilder _inputFiles = new StringBuilder(); - private StringBuilder _buildProcess = new StringBuilder(); - private StringBuilder _results = new StringBuilder(); - private bool _treatWarningsAsErrors; - - - // we have 2 formats for the error output the csc gives : - // d:\vc\include\xstring(1466) : warning C4701: local variable '_Ptr' may be used without hav - readonly static Regex normalError = new Regex(@"(?.*)\((?\d+)\)\s+\:\s+(?.+?)\s+(?[\d\w]+):\s+(?.*)", RegexOptions.Compiled); - // cl : Command line error D2016 : '/clr' and '/ML' command-line options are incompatible - readonly static Regex generalError = new Regex(@"(?.+)\s+(?[\d\w]+)\s*:\s+(?.*)", RegexOptions.Compiled); - - - public string GetCompiledOutputName(string fileName) - { - return Path.ChangeExtension(fileName, ".exe"); - } - - public string GetCompiledOutputName(IProject project) - { - CPPCompilerParameters compilerparameters = (CPPCompilerParameters)project.ActiveConfiguration; - return compilerparameters.OutputFile; - } - - public bool CanCompile(string fileName) - { - return Path.GetExtension(fileName) == ".cpp" || Path.GetExtension(fileName) == ".c" || Path.GetExtension(fileName) == ".cxx"; - } - - public ICompilerResult CompileFile(string filename, CPPCompilerParameters compilerparameters) - { - - if (!CanCompile(filename)) - { - MessageBox.Show("File " + filename + " is not a source file.", "Compilation Error", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); - return new DefaultCompilerResult(new CompilerResults(new TempFileCollection()), ""); - } - string output = ""; - string error = ""; - string exe = Path.ChangeExtension(filename, ".exe"); - if (compilerparameters.OutputAssembly != null && compilerparameters.OutputAssembly.Length > 0) { - exe = compilerparameters.OutputAssembly; - } - _treatWarningsAsErrors = compilerparameters.TreatWarningsAsErrors; - string responseFileName = Path.GetTempFileName(); - - StreamWriter writer = new StreamWriter(responseFileName); - - writer.WriteLine("/nologo"); - if (compilerparameters.UseManagedExtensions) - { - writer.WriteLine("/clr"); - } - writer.WriteLine("/Fe\"" + exe + "\""); - - writer.WriteLine('"' + filename + '"'); - - TempFileCollection tf = new TempFileCollection(); - - writer.Close(); - - string compilerName = GetCompilerName(); - string outstr = compilerName + " \"@" + responseFileName + "\""; - string currDir = Directory.GetCurrentDirectory(); - string intDir = compilerparameters.IntermediateDirectory; - if (intDir == null || intDir.Length == 0) { - intDir = compilerparameters.OutputDirectory; - } - - Directory.SetCurrentDirectory(intDir); - ICompilerResult result; - try { - Executor.ExecWaitWithCapture(outstr, currDir, tf, ref output, ref error); - result = ParseOutput(tf, output, error); - } - catch (System.Runtime.InteropServices.ExternalException e) { - ShowErrorBox(e); - result = CreateErrorCompilerResult(tf, e); - } - finally { - File.Delete(responseFileName); - File.Delete(output); - File.Delete(error); - Directory.SetCurrentDirectory(currDir); - } - return result; - } - - private void ShowErrorBox(System.Runtime.InteropServices.ExternalException e) - { - MessageBox.Show("It seems cl.exe is not installed or not found.\n\nInstall compiler and set PATH environment variable.\n\nException: " + e, "Compile Error", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); - } - - public ICompilerResult CompileProject(IProject project, bool force) - { - _inputFiles = new StringBuilder(); - _buildProcess = new StringBuilder(); - _results = new StringBuilder(); - - CPPProject p = (CPPProject)project; - CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration; - _treatWarningsAsErrors = compilerparameters.TreatWarningsAsErrors; - - CheckDirectory(Path.GetDirectoryName(compilerparameters.OutputFile)); - CheckDirectory(Path.GetDirectoryName(compilerparameters.IntermediateDirectory)); - - StringBuilder output = new StringBuilder(); - - ICompilerResult result; - - if (compilerparameters.PreCompileHeader) { - result = InternalCompileProject(p, true, force); - if (result != null) { - output.Append(result.CompilerOutput); - if (HasErrors(result)) { - goto exit; - } - } - } - - result = InternalCompileProject(p, false, force); - if (result != null) { - output.Append(result.CompilerOutput); - if (HasErrors(result)) { - goto exit; - } - } - if (result != null || !File.Exists(Path.GetFullPath(compilerparameters.OutputFile))) { - result = LinkProject(p); - output.Append(result.CompilerOutput); - } - exit: - WriteResultFile(p); - CompilerResults cr = result != null ? result.CompilerResults : new CompilerResults(new TempFileCollection()); - return new DefaultCompilerResult(cr, output.ToString()); - } - - private bool HasErrors(ICompilerResult compilerResult) - { - bool result = false; - if (compilerResult.CompilerResults.Errors.Count > 0) - { - if (_treatWarningsAsErrors) - { - result = true; - } - else { - foreach (CompilerError error in compilerResult.CompilerResults.Errors) - { - if (!error.IsWarning) - { - result = true; - break; - } - } - } - } - return result; - } - - private void CheckDirectory(string directory) - { - if (!Directory.Exists(directory)) { - Directory.CreateDirectory(directory); - } - } - - private void WriteResultFile(CPPProject p) - { - CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration; - string directory = Path.GetDirectoryName(compilerparameters.OutputFile); - string resultFile = Path.Combine(directory, "BuildLog.html"); - _results.Append("writing result file to : " + resultFile); - - StreamWriter writer = new StreamWriter(resultFile); - writer.Write(""); - writer.Write("
Build Log from: " + p.Name + "(" + compilerparameters.Name + ")
"); - writer.Write("Build started."); - writer.Write("
Command Line
"); - writer.WriteLine(_inputFiles.ToString()); - - writer.Write("
Output
"); - writer.Write("
");
-			writer.WriteLine(_buildProcess.ToString());
-			writer.Write("
"); - - writer.Write("
Results
"); - writer.Write("
");
-			writer.WriteLine(_results.ToString());
-			writer.Write("
"); - writer.Write("Build finished."); - writer.Write(""); - writer.Close(); - } - - #region COMPILER - private string GetCompilerName() - { - return @"cl.exe"; - } - - private string WriteCompilerParameters(CPPProject p, bool preCompiledHeader, bool force) - { - CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration; - StringBuilder sb = new StringBuilder(); - - sb.Append("/c\n"); - - if (compilerparameters.UseManagedExtensions) { - sb.Append("/clr\n"); - } - string directory = Path.GetDirectoryName(compilerparameters.OutputFile); - sb.Append("/Fo\""); - sb.Append(directory); - sb.Append("/\"\n"); - - IProjectService projectService = (IProjectService)ICSharpCode.Core.ServiceManager.Services.GetService(typeof(IProjectService)); - ArrayList allProjects = Combine.GetAllProjects(projectService.CurrentOpenCombine); - if (preCompiledHeader) { - sb.Append(compilerparameters.GetPreCompiledHeaderOptions()); - } else { - sb.Append(compilerparameters.GetCompilerOptions()); - } - if (compilerparameters.AdditionalCompilerOptions != null && compilerparameters.AdditionalCompilerOptions.Length > 0) { - foreach (string option in compilerparameters.AdditionalCompilerOptions.Split(';')) { - sb.Append(option); - sb.Append("\n"); - } - } - - foreach (ProjectReference lib in p.ProjectReferences) { - sb.Append("/FU\""); - sb.Append(lib.GetReferencedFileName(p)); - sb.Append("\"\n"); - } - - switch (compilerparameters.ConfigurationType) { - case ConfigurationType.Dll: - sb.Append("/LD\n"); - break; - } - bool includedFile = false; - foreach (ProjectFile finfo in p.ProjectFiles) { - if (finfo.Subtype != Subtype.Directory) { - switch (finfo.BuildAction) { - case BuildAction.Compile: - if (CanCompile(finfo.Name)) - { - string fileName = Path.GetFileNameWithoutExtension(Path.GetFullPath(finfo.Name)).ToLower(); - string headerFile = Path.GetFileNameWithoutExtension(compilerparameters.preCompiledHeaderCPPOptions.HeaderFile).ToLower(); - bool isPreHeader = fileName == headerFile; - - if (!(preCompiledHeader ^ isPreHeader)) { - if (force || ShouldCompileFile(p, finfo.Name)) { - includedFile = true; - sb.Append("\""); - sb.Append(Path.GetFullPath(finfo.Name)); - sb.Append("\"\n"); - } - } - } - break; - } - } - } - if (!includedFile) { - return null; - } - string responseFileName = Path.GetTempFileName(); - StreamWriter writer = new StreamWriter(responseFileName, false); -// string standardIncludes = Environment.GetEnvironmentVariable("INCLUDE"); -// if (standardIncludes != null && standardIncludes.Length > 0) { -// writer.WriteLine("/I\"" + standardIncludes + "\""); -// } - - writer.Write(sb.ToString()); - writer.Close(); - - _inputFiles.Append("Creating temporary file "); - _inputFiles.Append(responseFileName); - _inputFiles.Append(" with following content:
"); - _inputFiles.Append("
");
-			_inputFiles.Append(sb.ToString());
-			_inputFiles.Append("
"); - - return responseFileName; - } - - Hashtable lastCompiledFiles = new Hashtable(); - - private bool ShouldCompileFile(CPPProject p, string fileName) - { - CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration; - string directory = Path.GetDirectoryName(compilerparameters.OutputFile); - string objectFile = Path.Combine(directory, Path.ChangeExtension(Path.GetFileName(fileName), ".obj")); - if (!File.Exists(objectFile)) { - return true; - } - - string[] additinalIncludeDirs = compilerparameters.AdditionalCompilerOptions.Split(';'); - ArrayList dirs = new ArrayList(additinalIncludeDirs.Length+1); - dirs.Add(Path.GetDirectoryName(fileName)); - foreach (string dir in additinalIncludeDirs) - { - dirs.Add(dir); - } - - DateTime lastWriteTime = new IncludeParser(fileName, dirs, true).Parse().GetLastWriteTime(); -// DateTime lastWriteTime = File.GetLastWriteTime(fileName); - - bool shouldCompile; - if (lastCompiledFiles[fileName] == null) { - shouldCompile = true; - } else { - shouldCompile = lastWriteTime != (DateTime)lastCompiledFiles[fileName]; - } - - lastCompiledFiles[fileName] = lastWriteTime; - return shouldCompile; - } - - private ICompilerResult InternalCompileProject(CPPProject p, bool preCompiledHeader, bool force) - { - CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration; - - string responseFileName = WriteCompilerParameters(p, preCompiledHeader, force); - if (responseFileName == null) { - return null; - } - string output = String.Empty; - string error = String.Empty; - - string compilerName = GetCompilerName(); - string clstr = compilerName + " \"@" + responseFileName + "\""; - - TempFileCollection tf = new TempFileCollection(); - - string currDir = Directory.GetCurrentDirectory(); - string intDir = compilerparameters.IntermediateDirectory; - if (intDir == null || intDir.Length == 0) { - intDir = compilerparameters.OutputDirectory; - } - _inputFiles.Append("Executing command: " + clstr + "
"); - - ICompilerResult result; - try { - Executor.ExecWaitWithCapture(clstr, tf, ref output, ref error); - result = ParseOutput(tf, output, error); - } - catch (System.Runtime.InteropServices.ExternalException e) { - ShowErrorBox(e); - result = CreateErrorCompilerResult(tf, e); - } - finally { - File.Delete(responseFileName); - File.Delete(output); - File.Delete(error); - } - - return result; - } - #endregion - - #region LINKER - private string GetLinkerName() - { - return @"link.exe"; - } - - private string WriteLinkerOptions(CPPProject p) - { - CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration; - - StringBuilder sb = new StringBuilder(); - - string exe = compilerparameters.OutputFile; - string dir = Path.GetDirectoryName(Path.GetFullPath(exe)); - sb.Append("/OUT:\"");sb.Append(exe);sb.Append("\"\n"); - foreach (ProjectFile finfo in p.ProjectFiles) { - if (finfo.Subtype != Subtype.Directory) { - switch (finfo.BuildAction) { - case BuildAction.Compile: - if (CanCompile(finfo.Name)) - { - sb.Append('"'); - sb.Append(Path.Combine(dir, - Path.ChangeExtension(Path.GetFileName(finfo.Name), - ".obj"))); - sb.Append("\"\n"); - } - break; - case BuildAction.EmbedAsResource: - sb.Append("/ASSEMBLYRESOURCE:\"");sb.Append(Path.GetFullPath(finfo.Name));sb.Append("\"\n"); - break; - } - } - } - switch (compilerparameters.ConfigurationType) { - case ConfigurationType.Dll: - sb.Append("/DLL\n"); - break; - } - - sb.Append(compilerparameters.GetLinkerOptionsForCompiler()); - - // write to response file - string responseFileName = Path.GetTempFileName(); - StreamWriter writer = new StreamWriter(responseFileName); -// string standardLibs = Environment.GetEnvironmentVariable("LIB"); -// if (standardLibs != null && standardLibs.Length > 0) { -// foreach (string lib in standardLibs.Split(';')) { -// if (lib.Length > 0) { -// writer.WriteLine("/LIBPATH:\"" + lib + "\""); -// } -// } -// } - writer.Write(sb.ToString()); - writer.Close(); - - _inputFiles.Append("Creating temporary file " + responseFileName + " with following content:
"); - _inputFiles.Append("
");
-			_inputFiles.Append(sb.ToString());
-			_inputFiles.Append("
"); - return responseFileName; - } - - private ICompilerResult LinkProject(CPPProject p) - { - CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration; - - string responseFileName = WriteLinkerOptions(p); - - string output = String.Empty; - string error = String.Empty; - - string compilerName = GetLinkerName(); - string clstr = compilerName + " \"@" + responseFileName + "\""; - - TempFileCollection tf = new TempFileCollection(); - - string currDir = Directory.GetCurrentDirectory(); - string intDir = compilerparameters.IntermediateDirectory; - if (intDir == null || intDir.Length == 0) { - intDir = compilerparameters.OutputDirectory; - } - - _inputFiles.Append("Executing command : "); - _inputFiles.Append(clstr); - _inputFiles.Append("
"); - Executor.ExecWaitWithCapture(clstr, tf, ref output, ref error); - - ICompilerResult result = ParseOutput(tf, output, error); - -// File.Delete(responseFileName); - File.Delete(output); - File.Delete(error); - - return result; - } - #endregion - - private ICompilerResult CreateErrorCompilerResult(TempFileCollection tf, System.Runtime.InteropServices.ExternalException e) - { - CompilerError error = new CompilerError(); - error.Line = 0; - error.FileName = ""; - error.IsWarning = false; - error.ErrorNumber = ""; - error.ErrorText = e.Message; - CompilerResults cr = new CompilerResults(tf); - cr.Errors.Add(error); - return new DefaultCompilerResult(cr, ""); - } - - private void InternalParseOutputFile(StringBuilder compilerOutput, CompilerResults cr, string file) - { - StreamReader sr = new StreamReader(File.OpenRead(file), Encoding.Default); - - // skip fist whitespace line - sr.ReadLine(); - - - while (true) { - string curLine = sr.ReadLine(); - _buildProcess.Append(curLine); - _buildProcess.Append("\n"); - compilerOutput.Append(curLine); - compilerOutput.Append('\n'); - if (curLine == null) { - break; - } - curLine = curLine.Trim(); - if (curLine.Length == 0) { - continue; - } - - CompilerError error = new CompilerError(); - - // try to match standard errors - Match match = normalError.Match(curLine); - if (match.Success) { - error.Line = Int32.Parse(match.Result("${line}")); - try { - error.FileName = Path.GetFullPath(match.Result("${file}")); - } catch (Exception) { - error.FileName = ""; - } - error.IsWarning = match.Result("${error}").EndsWith("warning"); - error.ErrorNumber = match.Result("${number}"); - error.ErrorText = match.Result("${message}"); - } else { - match = generalError.Match(curLine); // try to match general csc errors - if (match.Success) { - error.IsWarning = match.Result("${error}").EndsWith("warning"); - error.ErrorNumber = match.Result("${number}"); - error.ErrorText = match.Result("${message}"); - } else { // give up and skip the line - continue; - } - } - - cr.Errors.Add(error); - } - sr.Close(); - } - - private ICompilerResult ParseOutput(TempFileCollection tf, string outputFile, string errorFile) - { - StringBuilder compilerOutput = new StringBuilder(); - CompilerResults cr = new CompilerResults(tf); - InternalParseOutputFile(compilerOutput, cr, outputFile); - InternalParseOutputFile(compilerOutput, cr, errorFile); - return new DefaultCompilerResult(cr, compilerOutput.ToString()); - } - } -} diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetBindingExecutionManager.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetBindingExecutionManager.cs deleted file mode 100644 index 054795f8b3..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetBindingExecutionManager.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// -// -// -// -// - -using System; -using System.IO; -using System.Diagnostics; -using System.Collections; -using System.Reflection; -using System.Resources; -using System.Windows.Forms; -using System.Xml; -using System.CodeDom.Compiler; -using System.Threading; - -using ICSharpCode.SharpDevelop.Internal.Project; -using ICSharpCode.SharpDevelop.Gui; - -using ICSharpCode.Core; - -namespace CPPBinding -{ - /// - /// This class describes the main functionalaty of a language codon - /// - public class CPPBindingExecutionManager - { - public void Execute(string filename, bool debug) - { - string exe = Path.ChangeExtension(filename, ".exe"); - ProcessStartInfo psi = new ProcessStartInfo(Environment.GetEnvironmentVariable("ComSpec"), "/c " + "\"" + exe + "\"" + " & pause"); - psi.WorkingDirectory = Path.GetDirectoryName(exe); - psi.UseShellExecute = false; - try { - Process p = new Process(); - p.StartInfo = psi; - p.Start(); - } catch (Exception) { - throw new ApplicationException("Can't execute " + "\"" + exe + "\"\n(.NET bug? Try restaring SD or manual start)"); - } - } - - public void Execute(IProject project, bool debug) - { - CPPCompilerParameters parameters = (CPPCompilerParameters)project.ActiveConfiguration; - - - string exe = ((CPPCompilerParameters)project.ActiveConfiguration).OutputFile; - - //string args = ((CPPCompilerParameters)project.ActiveConfiguration).CommandLineParameters; - string args = ""; - - ProcessStartInfo psi; - string runtimeStarter = String.Empty; - - psi = new ProcessStartInfo(runtimeStarter + "\"" + exe + "\""); - psi.Arguments = args; - - try { - psi.WorkingDirectory = Path.GetDirectoryName(exe); - psi.UseShellExecute = false; - - Process p = new Process(); - p.StartInfo = psi; - p.Start(); - } catch (Exception) { - throw new ApplicationException("Can't execute " + "\"" + exe + "\""); - } - } - } -} diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetLanguageBinding.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetLanguageBinding.cs deleted file mode 100644 index 5aabddf21c..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetLanguageBinding.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// -// -// -// -// - -using System; -using System.IO; -using System.Diagnostics; -using System.Collections; -using System.Reflection; -using System.Resources; -using System.Windows.Forms; -using System.Xml; -using System.CodeDom.Compiler; -using System.Threading; - -using ICSharpCode.SharpDevelop.Internal.Project; -using ICSharpCode.SharpDevelop.Internal.Templates; -using ICSharpCode.SharpDevelop.Gui; - -namespace CPPBinding -{ - public class CPPLanguageBinding : ILanguageBinding - { - public const string LanguageName = "C++.NET"; - - CPPBindingCompilerManager compilerManager = new CPPBindingCompilerManager(); - CPPBindingExecutionManager executionManager = new CPPBindingExecutionManager(); - - public string Language { - get { - return LanguageName; - } - } - - public void Execute(string filename, bool debug) - { - Debug.Assert(executionManager != null); - executionManager.Execute(filename, debug); - } - - public void Execute(IProject project, bool debug) - { - Debug.Assert(executionManager != null); - executionManager.Execute(project, debug); - } - - public string GetCompiledOutputName(string fileName) - { - Debug.Assert(compilerManager != null); - return compilerManager.GetCompiledOutputName(fileName); - } - - public string GetCompiledOutputName(IProject project) - { - Debug.Assert(compilerManager != null); - return compilerManager.GetCompiledOutputName(project); - } - - public bool CanCompile(string fileName) - { - Debug.Assert(compilerManager != null); - return compilerManager.CanCompile(fileName); - } - - public ICompilerResult CompileFile(string fileName) - { - MessageBox.Show("Cannot compile a single file. Create a project first.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); - return null; - } - - public ICompilerResult CompileProject(IProject project) - { - return CompileProject(project, false); - } - - public ICompilerResult RecompileProject(IProject project) - { - return CompileProject(project, true); - } - - public IProject CreateProject(ProjectCreateInformation info, XmlElement projectOptions) - { - return new CPPProject(info, projectOptions); - } - - private ICompilerResult CompileProject(IProject project, bool force) - { - Debug.Assert(compilerManager != null); - return compilerManager.CompileProject(project, force); - } - } -} diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Dependences.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Dependences.cs deleted file mode 100644 index 834fc36d1d..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Dependences.cs +++ /dev/null @@ -1,218 +0,0 @@ -// -// -*- C# -*- -// -// Author: Roman Taranchenko -// Copyright: (c) 2004 Roman Taranchenko -// Copying Policy: GNU General Public License -// - -using System; -using System.Collections; -using System.IO; - -namespace CPPBinding -{ - - public interface IDependence - { - - string Name - { - get; - } - - DependenceTree DependsOn - { - get; - } - - DependenceTree Children - { - get; - } - - void Add(IDependence dependence); - - DateTime GetLastWriteTime(); - - bool Exists - { - get; - } - - bool Contains(IDependence dep); - - bool Contains(string dep); - - } - - public class SourceFile: IDependence - { - - private string _name; - private DependenceTree _dependences = new DependenceTree(); - - public SourceFile(string name) - { - _name = name; - } - - public string Name - { - get - { - return _name; - } - } - - public DependenceTree Children - { - get - { - return _dependences; - } - } - - public DependenceTree DependsOn - { - get - { - DependenceTree listOfNames = new DependenceTree(); - FillListOfNames(this, listOfNames); - return listOfNames; - } - } - - public void Add(IDependence dependence) - { - _dependences.Add(dependence); - } - - private static void FillListOfNames(IDependence dependence, DependenceTree list) - { - foreach (IDependence dep in dependence.Children) - { - list.Add(dep); - FillListOfNames(dep, list); - } - } - - public DateTime GetLastWriteTime() - { - DateTime result = DateTime.MinValue; - if (Exists) - { - result = File.GetLastWriteTime(_name); - foreach (IDependence dep in _dependences) - { - DateTime dt = dep.GetLastWriteTime(); - if (dt.CompareTo(result) > 0) - { - result = dt; - } - } - } - return result; - } - - public bool Exists - { - get - { - return File.Exists(_name); - } - } - - public override string ToString() - { - return _name; - } - - public bool Contains(IDependence dep) - { - return Contains(dep.Name); - } - - public bool Contains(string dep) - { - if (_name.Equals(dep)) { - return true; - } - return _dependences.Contains(dep); - } - } - - public class DependenceTree: IEnumerable - { - - private SortedList _list; - - public DependenceTree() - { - _list = new SortedList(); - } - - public void Add(IDependence value) - { - if (!Contains(value)) - { - _list.Add(value.Name, value); - } - } - - public IDependence Get(string name) - { - return (IDependence) _list.GetByIndex(_list.IndexOfKey(name)); - } - - public IDependence Get(IDependence dep) - { - return Get(dep.Name); - } - - public bool Contains(IDependence dep) - { - return Contains(dep.Name); - } - - public bool Contains(string name) - { - return _list.ContainsKey(name); - } - - public IEnumerator GetEnumerator() - { - return new DependenceTreeEnumerator(_list.GetEnumerator()); - } - - } - - class DependenceTreeEnumerator: IEnumerator - { - private IDictionaryEnumerator _enum; - - public DependenceTreeEnumerator(IDictionaryEnumerator e) - { - _enum = e; - } - - public object Current - { - get - { - return ((DictionaryEntry)_enum.Current).Value; - } - } - - public bool MoveNext() - { - return _enum.MoveNext(); - } - - public void Reset() - { - _enum.Reset(); - } - } - -} diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/FormattingStrategy/CPPNetFormattingStrategy.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/FormattingStrategy/CPPNetFormattingStrategy.cs deleted file mode 100644 index 92d5cced34..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/FormattingStrategy/CPPNetFormattingStrategy.cs +++ /dev/null @@ -1,343 +0,0 @@ -// -// -// -// -// -// - -using System; -using System.Collections; -using System.Diagnostics; -using System.Drawing; -using System.Text; - -using ICSharpCode.TextEditor; -using ICSharpCode.TextEditor.Document; -using ICSharpCode.Core; - -namespace CPPBinding.FormattingStrategy -{ - /// - /// This class handles the auto and smart indenting in the textbuffer while - /// you type. - /// - public class CSharpFormattingStrategy : DefaultFormattingStrategy - { - public CSharpFormattingStrategy() - { - } - - /// - /// Define CSharp specific smart indenting for a line :) - /// - protected override int SmartIndentLine(TextArea textArea, int lineNr) - { - if (lineNr > 0) { - LineSegment lineAbove = textArea.Document.GetLineSegment(lineNr - 1); - string lineAboveText = lineAbove == null ? "" : textArea.Document.GetText(lineAbove).Trim(); - - LineSegment curLine = textArea.Document.GetLineSegment(lineNr); - string curLineText = textArea.Document.GetText(curLine.Offset, curLine.Length).Trim(); - - if ((lineAboveText.EndsWith(")") && curLineText.StartsWith("{")) || // after for, while, etc. - (lineAboveText.EndsWith("else") && curLineText.StartsWith("{"))) // after else - { - string indentation = GetIndentation(textArea, lineNr - 1); - textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText); - return indentation.Length; - } - - if (curLineText.StartsWith("}")) { // indent closing bracket. - int closingBracketOffset = TextUtilities.SearchBracketBackward(textArea.Document, curLine.Offset + textArea.Document.GetText(curLine.Offset, curLine.Length).IndexOf('}') - 1, '{', '}'); - if (closingBracketOffset == -1) { // no closing bracket found -> autoindent - return AutoIndentLine(textArea, lineNr); - } - - string indentation = GetIndentation(textArea, textArea.Document.GetLineNumberForOffset(closingBracketOffset)); - - textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText); - return indentation.Length; - } - - if (lineAboveText.EndsWith(";")) { // expression ended, reset to valid indent. - int closingBracketOffset = TextUtilities.SearchBracketBackward(textArea.Document, curLine.Offset + textArea.Document.GetText(curLine.Offset, curLine.Length).IndexOf('}') - 1, '{', '}'); - - if (closingBracketOffset == -1) { // no closing bracket found -> autoindent - return AutoIndentLine(textArea, lineNr); - } - - int closingBracketLineNr = textArea.Document.GetLineNumberForOffset(closingBracketOffset); - LineSegment closingBracketLine = textArea.Document.GetLineSegment(closingBracketLineNr); - string closingBracketLineText = textArea.Document.GetText(closingBracketLine.Offset, closingBracketLine.Length).Trim(); - - string indentation = GetIndentation(textArea, closingBracketLineNr); - - // special handling for switch statement formatting. - if (closingBracketLineText.StartsWith("switch")) { - if (lineAboveText.StartsWith("break;") || - lineAboveText.StartsWith("goto") || - lineAboveText.StartsWith("return")) { - // nothing - } else { - indentation += ICSharpCode.TextEditor.Actions.Tab.GetIndentationString(textArea.Document); - } - } - indentation += ICSharpCode.TextEditor.Actions.Tab.GetIndentationString(textArea.Document); - - textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText); - return indentation.Length; - } - - if (lineAboveText.EndsWith("{") || // indent opening bracket. - lineAboveText.EndsWith(":") || // indent case xyz: - (lineAboveText.EndsWith(")") && // indent single line if, for ... etc - (lineAboveText.StartsWith("if") || - lineAboveText.StartsWith("while") || - lineAboveText.StartsWith("for"))) || - lineAboveText.EndsWith("else")) { - string indentation = GetIndentation(textArea, lineNr - 1) + ICSharpCode.TextEditor.Actions.Tab.GetIndentationString(textArea.Document); - textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText); - return indentation.Length; - } else { - // try to indent linewrap - ArrayList bracketPos = new ArrayList(); - for (int i = 0; i < lineAboveText.Length; ++i) { // search for a ( bracket that isn't closed - switch (lineAboveText[i]) { - case '(': - bracketPos.Add(i); - break; - case ')': - if (bracketPos.Count > 0) { - bracketPos.RemoveAt(bracketPos.Count - 1); - } - break; - } - } - - if (bracketPos.Count > 0) { - int bracketIndex = (int)bracketPos[bracketPos.Count - 1]; - string indentation = GetIndentation(textArea, lineNr - 1); - - for (int i = 0; i <= bracketIndex; ++i) { // insert enough spaces to match - indentation += " "; // brace start in the next line - } - - textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText); - return indentation.Length; - } - } - } - return AutoIndentLine(textArea, lineNr); - } - - bool NeedCurlyBracket(string text) - { - int curlyCounter = 0; - - bool inString = false; - bool inChar = false; - - bool lineComment = false; - bool blockComment = false; - - for (int i = 0; i < text.Length; ++i) { - switch (text[i]) { - case '\r': - case '\n': - lineComment = false; - break; - case '/': - if (blockComment) { - Debug.Assert(i > 0); - if (text[i - 1] == '*') { - blockComment = false; - } - } - if (!inString && !inChar && i + 1 < text.Length) { - if (!blockComment && text[i + 1] == '/') { - lineComment = true; - } - if (!lineComment && text[i + 1] == '*') { - blockComment = true; - } - } - break; - case '"': - if (!(inChar || lineComment || blockComment)) { - inString = !inString; - } - break; - case '\'': - if (!(inString || lineComment || blockComment)) { - inChar = !inChar; - } - break; - case '{': - if (!(inString || inChar || lineComment || blockComment)) { - ++curlyCounter; - } - break; - case '}': - if (!(inString || inChar || lineComment || blockComment)) { - --curlyCounter; - } - break; - } - } - return curlyCounter > 0; - } - - bool IsInsideStringOrComment(TextArea textArea, LineSegment curLine, int cursorOffset) - { - // scan cur line if it is inside a string or single line comment (//) - bool isInsideString = false; - bool isInsideComment = false; - for (int i = curLine.Offset; i < cursorOffset; ++i) { - char ch = textArea.Document.GetCharAt(i); - if (ch == '"') { - isInsideString = !isInsideString; - } - if (ch == '/' && i + 1 < cursorOffset && textArea.Document.GetCharAt(i + 1) == '/') { - isInsideComment = true; - break; - } - } - - return isInsideString || isInsideComment; - } - - bool IsInsideDocumentationComment(TextArea textArea, LineSegment curLine, int cursorOffset) - { - // scan cur line if it is inside a string or single line comment (//) - bool isInsideString = false; - bool isInsideComment = false; - for (int i = curLine.Offset; i < cursorOffset; ++i) { - char ch = textArea.Document.GetCharAt(i); - if (ch == '"') { - isInsideString = !isInsideString; - } - if (!isInsideString) { - if (ch == '/' && i + 2 < cursorOffset && textArea.Document.GetCharAt(i + 1) == '/' && textArea.Document.GetCharAt(i + 2) == '/') { - isInsideComment = true; - break; - } - } - } - - return isInsideComment; - } - - public override int FormatLine(TextArea textArea, int lineNr, int cursorOffset, char ch) // used for comment tag formater/inserter - { - LineSegment curLine = textArea.Document.GetLineSegment(lineNr); - LineSegment lineAbove = lineNr > 0 ? textArea.Document.GetLineSegment(lineNr - 1) : null; - - //// local string for curLine segment - string curLineText=""; - - if (ch != '\n' && ch != '>') { - if (IsInsideStringOrComment(textArea, curLine, cursorOffset)) { - return 0; - } - } - - switch (ch) { - case '>': - if (IsInsideDocumentationComment(textArea, curLine, cursorOffset)) { - curLineText = textArea.Document.GetText(curLine.Offset, curLine.Length); - int column = textArea.Caret.Offset - curLine.Offset; - int index = Math.Min(column - 1, curLineText.Length - 1); - - while (index >= 0 && curLineText[index] != '<') { - --index; - if(curLineText[index] == '/') - return 0; // the tag was an end tag or already - } - - if (index > 0) { - StringBuilder commentBuilder = new StringBuilder(""); - for (int i = index; i < curLineText.Length && i < column && !Char.IsWhiteSpace(curLineText[ i]); ++i) { - commentBuilder.Append(curLineText[ i]); - } - string tag = commentBuilder.ToString().Trim(); - if (!tag.EndsWith(">")) { - tag += ">"; - } - if (!tag.StartsWith("/")) { - textArea.Document.Insert(textArea.Caret.Offset, " 0) { - curLineText = textArea.Document.GetText(curLine.Offset,curLine.Length); - } - - LineSegment nextLine = lineNr + 1 < textArea.Document.TotalNumberOfLines ? textArea.Document.GetLineSegment(lineNr + 1) : null; - string nextLineText = lineNr + 1 < textArea.Document.TotalNumberOfLines ? textArea.Document.GetText(nextLine.Offset, nextLine.Length) : ""; - - if (lineAbove.HighlightSpanStack != null && lineAbove.HighlightSpanStack.Count > 0) { - if (!((Span)lineAbove.HighlightSpanStack.Peek()).StopEOL) { // case for /* style comments - int index = lineAboveText == null ? -1 : lineAboveText.IndexOf("/*"); - - if (index > 0) { - string indentation = GetIndentation(textArea, lineNr - 1); - for (int i = indentation.Length; i < index; ++ i) { - indentation += ' '; - } - //// adding curline text - textArea.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + " * "+curLineText); - return indentation.Length + 3+curLineText.Length; - } - - index = lineAboveText.IndexOf("*"); - if (index > 0) { - string indentation = GetIndentation(textArea, lineNr - 1); - for (int i = indentation.Length; i < index; ++ i) { - indentation += ' '; - } - //// adding curline if present - textArea.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + "* "+curLineText); - return indentation.Length + 2 + curLineText.Length; - } - } else { // don't handle // lines, because they're only one lined comments - int indexAbove = lineAboveText.IndexOf("///"); - int indexNext = nextLineText.IndexOf("///"); - if (indexAbove > 0 && (indexNext != -1 || indexAbove + 4 < lineAbove.Length)) { - string indentation = GetIndentation(textArea, lineNr - 1); - for (int i = indentation.Length; i < indexAbove; ++ i) { - indentation += ' '; - } - //// adding curline text if present - textArea.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + "/// " + curLineText); - return indentation.Length + 4 /*+ curLineText.Length*/; - } - } - } - return IndentLine(textArea, lineNr); - } - return 0; - } - } -} diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Gui/CPPCodeGenerationPanel.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Gui/CPPCodeGenerationPanel.cs deleted file mode 100644 index 6fe9e2ff03..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Gui/CPPCodeGenerationPanel.cs +++ /dev/null @@ -1,152 +0,0 @@ -// -// -// -// -// -// - -using System; -using System.IO; -using System.Drawing; -using System.Windows.Forms; - -using ICSharpCode.SharpDevelop.Internal.Project; -using ICSharpCode.SharpDevelop.Internal.ExternalTool; -using ICSharpCode.SharpDevelop.Gui; -using ICSharpCode.Core; - -namespace CPPBinding -{ - public abstract class AbstractCPPConfigPanel : AbstractOptionPanel - { - protected CPPCompilerParameters compilerParameters; - protected System.Windows.Forms.PropertyGrid grid = new System.Windows.Forms.PropertyGrid(); - - protected abstract void SetGridObject(); - - public override void LoadPanelContents() - { - compilerParameters = (CPPCompilerParameters)((Properties)CustomizationObject).Get("Config"); - - grid.Dock = DockStyle.Fill; - SetGridObject(); - Controls.Add(grid); - } - - public override bool StorePanelContents() - { - return true; - } - } - - public class CPPCodeGenerationPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters; - } - } - #region compiler panels - public class GeneralCPPOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.generalCPPOptions; - } - } - public class OptimizeCPPOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.optimizeCPPOptions; - } - } - public class PreProcessorCPPOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.preProcessorCPPOptions; - } - } - - public class CodeGenerationCPPOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.codeGenerationCPPOptions; - } - } - - public class LanguageCPPOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.languageCPPOptions; - } - } - - public class PreCompiledHeaderCPPOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.preCompiledHeaderCPPOptions; - } - } - - public class OutputFileCPPOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.outputFileCPPOptions; - } - } - - public class InformationSearchCPPOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.informationSearchCPPOptions; - } - } - - public class ExtendedCPPOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.extendedCPPOptions; - } - } - #endregion - - public class GeneralLinkerOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.generalLinkerOptions; - } - } - public class InputLinkerOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.inputLinkerOptions; - } - } - public class DebugLinkerOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.debugLinkerOptions; - } - } - - public class SystemLinkerOptionsPanel : AbstractCPPConfigPanel - { - protected override void SetGridObject() - { - grid.SelectedObject = this.compilerParameters.systemLinkerOptions; - } - } - -} - diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/IncludeParser.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/IncludeParser.cs deleted file mode 100644 index 0ec1df84d7..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/IncludeParser.cs +++ /dev/null @@ -1,123 +0,0 @@ -// -// -*- C# -*- -// -// Author: Roman Taranchenko -// Copyright: (c) 2004 Roman Taranchenko -// Copying Policy: GNU General Public License -// - -using System; -using System.Collections; -using System.IO; - -namespace CPPBinding -{ - - /// - /// Description of IncludeParser. - /// - public class IncludeParser - { - private IDependence _owner; - private IList _includeDirectories; - private bool _onlyProjectInclude; - - public IncludeParser(IDependence owner, IList includeDirectories, bool onlyProjectInclude) - { - _includeDirectories = includeDirectories; - _owner = owner; - _onlyProjectInclude = onlyProjectInclude; - } - - public IncludeParser(String fileName, IList includeDirectories, bool onlyProjectInclude) - { - _includeDirectories = includeDirectories; - _owner = new SourceFile(fileName); - _onlyProjectInclude = onlyProjectInclude; - } - - public IDependence Parse() - { - ParseFile(_owner); - return _owner; - } - - private void ParseFile(IDependence parent) - { - if (!parent.Exists) - { - return; - } - ArrayList includes = new ArrayList(); - StreamReader reader = File.OpenText(parent.Name); - using (reader) - { - string line = null; - while ((line = reader.ReadLine()) != null) - { - line = line.TrimStart(' ', '\t'); - if (line.StartsWith("#include")) - { - IDependence include = GetInclude(line); - if (include != null) - { - includes.Add(include); - } - } - } - } - foreach (IDependence include in includes) - { - parent.Add(include); - ParseFile(include); - } - } - - private IDependence GetInclude(string line) - { - IDependence result = null; - int start = -1, end = -1; - bool quotes = false; - - // find first index - for (int i = 8; i < line.Length; ++i) - { - if (!_onlyProjectInclude && line[i] == '<') - { - start = i+1; - break; - } - if (line[i] == '"') - { - start = i+1; - quotes = true; - break; - } - } - - // find second index - if (start > 0 && start + 1 < line.Length) - { - end = line.IndexOf(quotes ? '"' : '>', start + 1); - } - - // create include - if (start > 0 && end > start) - { - string includeName = line.Substring(start, end-start); - foreach (string dir in _includeDirectories) - { - string fullName = Path.Combine(dir, includeName); - if (!_owner.Contains(fullName) && File.Exists(fullName)) - { - result = new SourceFile(fullName); - } - } - } - - return result; - } - - } - -} diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetCompilerParameters.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetCompilerParameters.cs deleted file mode 100644 index 10b0efb584..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetCompilerParameters.cs +++ /dev/null @@ -1,2257 +0,0 @@ -// -// -// -// -// -// - -using System; -using System.ComponentModel; -using System.Text; -using System.Xml; -using System.Diagnostics; - -using ICSharpCode.SharpDevelop.Gui; -using ICSharpCode.SharpDevelop.Internal.Project; - -namespace CPPBinding -{ - #region OPTIMIZATION - public enum OptimizeLevel { - Deactivated, // /Od - MinimizeSize, // /O1 - MaximizeSpeed, // /O2 - CompleteOptimize // /Ox - } - - public enum FloatingPointConsistency { - Standard, - Enhanced // /Op - } - - public enum InlineFunctionExpansion - { - Standard, // /Ob0 - Manual, // /Ob1 - Automatic // /Ob2 - } - - public enum SizeOrSpeedOptimization - { - Neither, - Size, - Speed - } - - #endregion - - #region CODE GENERATION - public enum Architecture { - Mixed, - i386, // /G3 - i486, // /G4 - Pentium, // /G5 - PentiumPRO, // /G6 - Pentium4 // /G7 - } - - public enum CallingConvention { - __cdecl, // default (/Gd) - __fastcall, // /Gr - __stdcall // /Gz - } - - public enum EnhancedInstructionSet { - NotSpecified, - SSE, // /arch:SSE - SSE2 // /arch:SSE2 - } - - public enum RunTimeObservation { - Standard, - Stack, // /RTCs - UninitializedVariables, // /RTCu - Both // /RTCs /RTCu - } - - public enum ExceptionHandling { - None, - SynchronousExceptionHandling, // /GX - AsynchronousExceptionHandling // /EHa - } - - public enum StringPooling { - Disabled, - Enabled, - EnabledReadOnlyPooling - } - - #endregion - - #region DEBUGGING - public enum DebugInformationFormat { - Deactivated, - C7, // /Z7 - OnlyLineNumbers, // /Zd - ProgramDatabase, // /Zi - ProgramDatabaseWithEditAndContinue // /ZI - } - - #endregion - - #region PREPROCESSOR - public enum PreProcessorRun { - No, - WithLineNumbers, // /E - WithoutLineNumbers // /EP - } - #endregion - - #region LANGUAGE - public enum StructMemberAlignment { - Standard, - Byte1, // /Zp1 - Byte2, // /Zp2 - Byte4, // /Zp4 - Byte8, // /Zp8 - Byte16, // /Zp16 - } - - public enum LanguageExtensions { - Enable, // /Ze - Disable // /Za - } - - #endregion - - #region LINKING - public enum RunTimeLibrary { - MultiThreaded, // /MT - MultiThreadedDebug, // /MTd - MultiThreadedDLL, // /MD - MultiThreadedDebugDLL, // /MDd - SingleThreaded, // /ML - SingleThreadedDebug // /MLd - } - - public enum ConfigurationType { - Exe, - Dll - } - - #endregion - - #region PRECOMPILED HEADER - public enum PreCompiledHeader { - DontUsePre, // /Y- - Create, // /Yc - CreateAutomatically, // /YX - Use // /Yu - } - #endregion - - #region MISCELLANEOUS - public enum CompileType { - Standard, - C, // /TC - CPP // /TP - } - - #endregion - - - - public enum AssemblyOutput { - NoList, - ListAssembly, - ListAssemblyWithSource, - ListAssemblyWithCode, - ListAssemblyWithCodeAndSource, - } - - public enum ShowLinkerStatus { - Unselected, - ShowAll, - ShowSome - } - public enum IncrementalLinking { - Standard, - Yes, - No - } - - public enum DebuggableAssembly { - DontEmitDebuggable, - EnableDebugToRuntimeDisableOptimization, - DisableDebugToRuntimEnableOptimization - } - - public enum LinkerSubSystem { - Unselected, - Console, - Windows - } - public enum ActivateBigAddresses { - Standard, - NoSupport, - Supported - } - public enum TerminalServer { - Standard, - NotBound, - Bound - } - - /// - /// This class handles project specific compiler parameters - /// - public class CPPCompilerParameters : AbstractProjectConfiguration - { - - private static bool IsNotEmpty(string arg) - { - return arg != null && arg.Length > 0; - } - - private static void AppendOption(StringBuilder sb, String opt, String val) - { - AppendOption(sb, opt, val, true); - } - - private static void AppendOption(StringBuilder sb, String opt, String val, bool quote) - { - - sb.Append(opt); - if (quote) - sb.Append('"'); - sb.Append(val); - if (quote) - sb.Append('"'); - sb.Append("\n"); - } - - private static void AppendList(StringBuilder sb, String opt, String values) - { - AppendList(sb, opt, values, true); - } - - private static void AppendList(StringBuilder sb, String opt, String values, bool quote) - { - foreach (string val in values.Split(';')) - { - AppendOption(sb, opt, val, quote); - } - } - - #region Misc Options - [XmlNodeName("MiscOptions")] - public class MiscCPPOptions - { - [ConvertToRelativePath()] - [XmlAttribute("OutputDirectory")] - public string outputDirectory = ""; - - [ConvertToRelativePath()] - [XmlAttribute("IntermediateDirectory")] - public string intermediateDirectory = ""; - - [XmlAttribute("ConfigurationType")] - public ConfigurationType configurationType = ConfigurationType.Exe; - - [XmlAttribute("UseManagedExtensions")] - public bool useManagedExtensions = true; - - [XmlAttribute("additionalCompilerOptions")] - public string additionalCompilerOptions = ""; - } - #endregion - - #region General Options - [XmlNodeName("GeneralCPPOptions")] - public class GeneralCPPOptions - { - [XmlAttribute("additionalIncludeDirectories")] - public string additionalIncludeDirectories = ""; - - [XmlAttribute("additionalAssemblySearchPaths")] - public string additionalAssemblySearchPaths = ""; - - [XmlAttribute("debugInformationFormat")] - public DebugInformationFormat debugInformationFormat = DebugInformationFormat.Deactivated; - - [XmlAttribute("noStartLogo")] - public bool noStartLogo = true; - - [XmlAttribute("warningLevel")] - public int warningLevel = 4; - - [XmlAttribute("search64BitPortabilityProblems")] - public bool search64BitPortabilityProblems = false; - -// [XmlAttribute("treatWarningsAsErrors")] -// public bool treatWarningsAsErrors = false; - - [DefaultValue("")] - [LocalizedProperty("Additional include paths", - Description = "Specifies one or more semi-colon delimited additonal paths to search for includes. (/I[path])")] - public string AdditionalIncludeDirectories { - get { - return additionalIncludeDirectories; - } - set { - additionalIncludeDirectories = value; - } - } - - [DefaultValue("")] - [LocalizedProperty("Additional assembly search", - Description = "Specifies one or more semi-colon delimited additonal paths to search for #using assemblies. (/AI[path])")] - public string AdditionalAssemblySearchPaths { - get { - return additionalAssemblySearchPaths; - } - set { - additionalAssemblySearchPaths = value; - } - } - - [LocalizedProperty("Debug information format", - Description = "(/Z7, /Zd, /Zi. /ZI)")] - public DebugInformationFormat DebugInformationFormat { - get { - return debugInformationFormat; - } - set { - debugInformationFormat = value; - } - } - - [DefaultValue(true)] - [LocalizedProperty("Surpress Startup Logo", - Description = "Surpress the display of the startup logo and information messages. (/nologo)")] - public bool NoStartLogo { - get { - return noStartLogo; - } - set { - noStartLogo = value; - } - } - - [DefaultValue(4)] - [LocalizedProperty("Warning level", - Description = "(/W0 - /W4)")] - public int WarningLevel { - get { - return warningLevel; - } - set { - warningLevel = value; - } - } - - [DefaultValue(false)] - [LocalizedProperty("Search for 64-Bit portability problems", - Description = "(/Wp64)")] - public bool Search64BitPortabilityProblems { - get { - return search64BitPortabilityProblems; - } - set { - search64BitPortabilityProblems = value; - } - } - -// [DefaultValue(false)] -// [LocalizedProperty("Treat warnings as errors", -// Description = "(/WX)")] -// public bool TreatWarningsAsErrors { -// get { -// return treatWarningsAsErrors; -// } -// set { -// treatWarningsAsErrors = value; -// } -// } - - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - if (IsNotEmpty(AdditionalIncludeDirectories)) { - AppendList(result, "/I", AdditionalIncludeDirectories, true); - } - if (IsNotEmpty(AdditionalAssemblySearchPaths)) { - AppendList(result, "/AI", AdditionalAssemblySearchPaths, true); - } - switch (DebugInformationFormat) { - case DebugInformationFormat.Deactivated: - break; - case DebugInformationFormat.C7: - result.Append("/Z7\n"); - break; - case DebugInformationFormat.OnlyLineNumbers: - result.Append("/Zd\n"); - break; - case DebugInformationFormat.ProgramDatabase: - result.Append("/Zi\n"); - break; - case DebugInformationFormat.ProgramDatabaseWithEditAndContinue: - result.Append("/ZI\n"); - break; - - } - if (NoStartLogo) { - result.Append("/nologo\n"); - } - AppendOption(result, "/W", WarningLevel.ToString()); - if (Search64BitPortabilityProblems) { - result.Append("/Wp64\n"); - } -// if (TreatWarningsAsErrors) { -// result.Append("/WX\n"); -// } - - return result.ToString(); - } - } - #endregion - - #region Optimize Options - [XmlNodeName("OptimizeCPPOptions")] - public class OptimizeCPPOptions - { - [XmlAttribute("optimizeLevel")] - public OptimizeLevel optimizeLevel = OptimizeLevel.Deactivated; - - [XmlAttribute("useGlobalOptimize")] - public bool useGlobalOptimize = false; - - [XmlAttribute("inlineFunctionExtension")] - public InlineFunctionExpansion inlineFunctionExpansion = InlineFunctionExpansion.Standard; - - [XmlAttribute("activateSysInternalFunctions")] - public bool activateSysInternalFunctions = false; - - [XmlAttribute("floatingPointConsistency")] - public FloatingPointConsistency floatingPointConsistency = FloatingPointConsistency.Standard; - - [XmlAttribute("sizeOrSpeedOptimization")] - public SizeOrSpeedOptimization sizeOrSpeedOptimization = SizeOrSpeedOptimization.Neither; - - [XmlAttribute("surpressFramePointer")] - public bool surpressFramePointer = false; - - [XmlAttribute("enableFiberSaveOptimize")] - public bool enableFiberSaveOptimize = false; - - [XmlAttribute("architecture")] - public Architecture architecture = Architecture.Mixed; - - [XmlAttribute("optimizeForWindowsExecutable")] - public bool optimizeForWindowsExecutable = false; - - [LocalizedProperty("Optimize Level", - Description = "/Od,/O1,/O2,/Ox")] - public OptimizeLevel OptimizeLevel { - get { - return optimizeLevel; - } - set { - optimizeLevel = value; - } - } - - [DefaultValue(false)] - [LocalizedProperty("Use Global Optimization", - Description = "/Og")] - public bool UseGlobalOptimize { - get { - return useGlobalOptimize; - } - set { - useGlobalOptimize = value; - } - } - [LocalizedProperty("Inline Functions Expansion", - Description = "/Ob1,/Ob2")] - public InlineFunctionExpansion InlineFunctionExpansion { - get { - return inlineFunctionExpansion; - } - set { - inlineFunctionExpansion = value; - } - } -// [DefaultValue(false)] -// [LocalizedProperty("", -// Description = "")] -// public bool ActivateSysInternalFunctions { -// get { -// return activateSysInternalFunctions; -// } -// set { -// activateSysInternalFunctions = value; -// } -// } - [LocalizedProperty("Floating Point Consistency", - Description = "/Op")] - public FloatingPointConsistency FloatingPointConsistency { - get { - return floatingPointConsistency; - } - set { - floatingPointConsistency = value; - } - } - [LocalizedProperty("Size Or Speed Optimization", - Description = "/Ot,/Os")] - public SizeOrSpeedOptimization SizeOrSpeedOptimization { - get { - return sizeOrSpeedOptimization; - } - set { - sizeOrSpeedOptimization = value; - } - } - [DefaultValue(false)] - [LocalizedProperty("Suppress Frame Pointer", - Description = "/Oy")] - public bool SurpressFramePointer { - get { - return surpressFramePointer; - } - set { - surpressFramePointer = value; - } - } - [DefaultValue(false)] - [LocalizedProperty("Fiber Safety Support", - Description = "/GT")] - public bool EnableFiberSaveOptimize { - get { - return enableFiberSaveOptimize; - } - set { - enableFiberSaveOptimize = value; - } - } - [LocalizedProperty("Optimize for Processor", - Description = "/G3,/G4,/G5,/G6,/G7")] - public Architecture Architecture { - get { - return architecture; - } - set { - architecture = value; - } - } - [DefaultValue(false)] - [LocalizedProperty("Optimizes for Windows Application", - Description = "/GA")] - public bool OptimizeForWindowsExecutable { - get { - return optimizeForWindowsExecutable; - } - set { - optimizeForWindowsExecutable = value; - } - } - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - switch (OptimizeLevel) { - case OptimizeLevel.CompleteOptimize: - result.Append("/Ox\n"); - break; - case OptimizeLevel.Deactivated: -// result.Append("/Od\n"); - break; - case OptimizeLevel.MaximizeSpeed: - result.Append("/O2\n"); - break; - case OptimizeLevel.MinimizeSize: - result.Append("/O1\n"); - break; - } - switch (FloatingPointConsistency) { - case FloatingPointConsistency.Enhanced: - result.Append("/Op\n"); - break; - } - switch (architecture) { - case Architecture.Mixed: - break; - case Architecture.i386: - result.Append("/G3\n"); - break; - case Architecture.i486: - result.Append("/G4\n"); - break; - case Architecture.Pentium: - result.Append("/G5\n"); - break; - case Architecture.PentiumPRO: - result.Append("/G6\n"); - break; - case Architecture.Pentium4: - result.Append("/G7\n"); - break; - } - if (UseGlobalOptimize) { - result.Append("/Og\n"); - } -// if (activateSysInternalFunctions) { -// result.Append("/\n"); -// } - if (surpressFramePointer) { - result.Append("/Oy\n"); - } - if (enableFiberSaveOptimize) { - result.Append("/GT\n"); - } - if (optimizeForWindowsExecutable) { - result.Append("/GA\n"); - } - switch (InlineFunctionExpansion) { - case InlineFunctionExpansion.Automatic: - result.Append("/Ob2\n"); - break; - case InlineFunctionExpansion.Manual: - result.Append("/Ob1\n"); - break; - case InlineFunctionExpansion.Standard: - break; - } - switch (SizeOrSpeedOptimization) { - case SizeOrSpeedOptimization.Neither: - break; - case SizeOrSpeedOptimization.Size: - result.Append("/Os\n"); - break; - case SizeOrSpeedOptimization.Speed: - result.Append("/Ot\n"); - break; - } - return result.ToString(); - } - } - #endregion - - #region Preprocessor Options - [XmlNodeName("PreProcessorCPPOptions")] - public class PreProcessorCPPOptions - { - [XmlAttribute("additionalDirectives")] - public string additionalDirectives = ""; - - [XmlAttribute("ignoreStandardIncludePath")] - public bool ignoreStandardIncludePath = false; - - [XmlAttribute("preProcessorRun")] - public PreProcessorRun preProcessorRun = PreProcessorRun.No; - - [XmlAttribute("keepComments")] - public bool keepComments = true; - - [LocalizedProperty("Pre Processor Directives", - Description = "Specifies additional pre processor directives. (/D[macro])")] - public string AdditionalDirectives { - get { - return additionalDirectives; - } - set { - additionalDirectives = value; - } - } - - [LocalizedProperty("Ignore standard search paths", - Description = "If true, standard search paths are ignored. (/X)")] - public bool IgnoreStandardIncludePath { - get { - return ignoreStandardIncludePath; - } - set { - ignoreStandardIncludePath = value; - } - } - - [LocalizedProperty("Pre Processor Run", - Description = "Specifies the pre processor options for this configuration. (/E, /P, /EP)")] - public PreProcessorRun PreProcessorRun { - get { - return preProcessorRun; - } - set { - preProcessorRun = value; - } - } - - [LocalizedProperty("Keep comments", - Description = "Specifies if comments should be removed from the source code. (/C)")] - public bool KeepComments { - get { - return keepComments; - } - set { - keepComments = value; - } - } - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - if (IsNotEmpty(additionalDirectives)) { - AppendList(result, "/D", additionalDirectives); - } - if (ignoreStandardIncludePath) { - result.Append("/X\n"); - } - switch (preProcessorRun) { - case PreProcessorRun.No: - break; - case PreProcessorRun.WithLineNumbers: - result.Append("/P\n"); - if (keepComments) { - result.Append("/C\n"); - } - break; - case PreProcessorRun.WithoutLineNumbers: - result.Append("/EP\n/P\n"); - if (keepComments) { - result.Append("/C\n"); - } - break; - } - return result.ToString(); - } - } - #endregion - - #region Code Generation Options - [XmlNodeName("CodeGenerationCPPOptions")] - public class CodeGenerationCPPOptions - { - [XmlAttribute("activateStringPooling")] - public bool activateStringPooling = false; - - [XmlAttribute("activateMinimalRecompilation")] - public bool activateMinimalRecompilation = false; - - [XmlAttribute("activateCPPExceptions")] - public bool activateCPPExceptions = true; - - [XmlAttribute("observeSmallTypes")] - public bool observeSmallTypes = false; - - [XmlAttribute("runTimeObservation")] - public RunTimeObservation runTimeObservation = RunTimeObservation.Standard; - - [XmlAttribute("runTimeLibrary")] - public RunTimeLibrary runTimeLibrary = RunTimeLibrary.MultiThreaded; - - [XmlAttribute("structMemberAlignment")] - public StructMemberAlignment structMemberAlignment = StructMemberAlignment.Standard; - - [XmlAttribute("bufferOverflowCheck")] - public bool bufferOverflowCheck = false; - - [XmlAttribute("functionLevelLinking")] - public bool functionLevelLinking = false; - - [XmlAttribute("enhancedInstructionSet")] - public EnhancedInstructionSet enhancedInstructionSet = EnhancedInstructionSet.NotSpecified; - - [LocalizedProperty("Activate String Pooling", - Description = "(/GF)")] - public bool ActivateStringPooling { - get { - return activateStringPooling; - } - set { - activateStringPooling = value; - } - } - - [LocalizedProperty("Activate minimal recompilation", - Description = "(/Gm)")] - public bool ActivateMinimalRecompilation { - get { - return activateMinimalRecompilation; - } - set { - activateMinimalRecompilation = value; - } - } - - [LocalizedProperty("Activate C++ exceptions", - Description = "(/EHsc)")] - public bool ActivateCPPExceptions { - get { - return activateCPPExceptions; - } - set { - activateCPPExceptions = value; - } - } - - [LocalizedProperty("Observe small types", - Description = "(/RTCc)")] - public bool ObserveSmallTypes { - get { - return observeSmallTypes; - } - set { - observeSmallTypes = value; - } - } - - [LocalizedProperty("Full Runtimeobservation", - Description = "(/RTCs, /RTCu, /RTC1)")] - public RunTimeObservation RunTimeObservation { - get { - return runTimeObservation; - } - set { - runTimeObservation = value; - } - } - - [LocalizedProperty("Runtime library", - Description = "(/MT, /MTd, /MD, /MDd, /ML, /MLd)")] - public RunTimeLibrary RunTimeLibrary { - get { - return runTimeLibrary; - } - set { - runTimeLibrary = value; - } - } - - [LocalizedProperty("Struct member alignment", - Description = "1, 2, 4, 8 or 16 byte. (/Zp[number])")] - public StructMemberAlignment StructMemberAlignment { - get { - return structMemberAlignment; - } - set { - structMemberAlignment = value; - } - } - - [LocalizedProperty("Buffer overwflow check", - Description = "(/GS)")] - public bool BufferOverflowCheck { - get { - return bufferOverflowCheck; - } - set { - bufferOverflowCheck = value; - } - } - - [LocalizedProperty("Activate function level linking", - Description = "(/Gy)")] - public bool FunctionLevelLinking { - get { - return functionLevelLinking; - } - set { - functionLevelLinking = value; - } - } - - [LocalizedProperty("Activate enhanced instruction set", - Description = "(/arch:SSE, /arch:SSE2)")] - public EnhancedInstructionSet EnhancedInstructionSet { - get { - return enhancedInstructionSet; - } - set { - enhancedInstructionSet = value; - } - } - - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - if (activateStringPooling) { - result.Append("/GF\n"); - } - if (activateMinimalRecompilation) { - result.Append("/Gm\n"); - } - if (activateCPPExceptions) { - result.Append("/EHsc\n"); - } - - if (observeSmallTypes) { - result.Append("/RTCc\n"); - } - switch (runTimeObservation) { - case RunTimeObservation.Both: - result.Append("/RTCsu\n"); - break; - case RunTimeObservation.Stack: - result.Append("/RTCs\n"); - break; - case RunTimeObservation.UninitializedVariables: - result.Append("/RTCu\n"); - break; - } - switch (runTimeLibrary) { - case RunTimeLibrary.MultiThreaded: - result.Append("/MT\n"); - break; - case RunTimeLibrary.MultiThreadedDebug: - result.Append("/MTd\n"); - break; - case RunTimeLibrary.MultiThreadedDLL: - result.Append("/MD\n"); - break; - case RunTimeLibrary.MultiThreadedDebugDLL: - result.Append("/MDd\n"); - break; - case RunTimeLibrary.SingleThreaded: - result.Append("/ML\n"); - break; - case RunTimeLibrary.SingleThreadedDebug: - result.Append("/MLd\n"); - break; - } - - switch (structMemberAlignment) { - case StructMemberAlignment.Standard: - break; - case StructMemberAlignment.Byte1: - result.Append("/Zp1\n"); - break; - case StructMemberAlignment.Byte2: - result.Append("/Zp2\n"); - break; - case StructMemberAlignment.Byte4: - result.Append("/Zp4\n"); - break; - case StructMemberAlignment.Byte8: - result.Append("/Zp8\n"); - break; - case StructMemberAlignment.Byte16: - result.Append("/Zp16\n"); - break; - } - - if (bufferOverflowCheck) { - result.Append("/GS\n"); - } - if (functionLevelLinking) { - result.Append("/Gy\n"); - } - - switch (EnhancedInstructionSet) { - case EnhancedInstructionSet.NotSpecified: - break; - case EnhancedInstructionSet.SSE: - result.Append("/arch:SSE\n"); - break; - case EnhancedInstructionSet.SSE2: - result.Append("/arch:SSE2\n"); - break; - } - return result.ToString(); - } - } - #endregion - - #region Language Options - [XmlNodeName("LanguageCPPOptions")] - public class LanguageCPPOptions - { - [XmlAttribute("deactivateLanuageExtensions")] - public bool deactivateLanuageExtensions = false; - - [XmlAttribute("standardCharTypeIsUnsigned")] - public bool standardCharTypeIsUnsigned = true; - - [XmlAttribute("wchar_tIsBuiltIn")] - public bool wchar_tIsBuiltIn = false; - - [XmlAttribute("forceForScope")] - public bool forceForScope = false; - - [XmlAttribute("addRuntimeTypeInformation")] - public bool addRuntimeTypeInformation = true; - - public bool DeactivateLanuageExtensions { - get { - return deactivateLanuageExtensions; - } - set { - deactivateLanuageExtensions = value; - } - } - public bool StandardCharTypeIsUnsigned { - get { - return standardCharTypeIsUnsigned; - } - set { - standardCharTypeIsUnsigned = value; - } - } - public bool Wchar_tIsBuiltIn { - get { - return wchar_tIsBuiltIn; - } - set { - wchar_tIsBuiltIn = value; - } - } - public bool ForceForScope { - get { - return forceForScope; - } - set { - forceForScope = value; - } - } - public bool AddRuntimeTypeInformation { - get { - return addRuntimeTypeInformation; - } - set { - addRuntimeTypeInformation = value; - } - } - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - - if (deactivateLanuageExtensions) { - result.Append("/Za\n"); - } - - if (standardCharTypeIsUnsigned) { - result.Append("/J\n"); - } - - if (wchar_tIsBuiltIn) { - result.Append("/Zc:wchar_t\n"); - } - - if (forceForScope) { - result.Append("/Zc:forScope\n"); - } - - if (addRuntimeTypeInformation) { - result.Append("/GR\n"); - } - - return result.ToString(); - } - } - #endregion - - #region PreCompiler Header Options - [XmlNodeName("PreCompiledHeaderCPPOptions")] - public class PreCompiledHeaderCPPOptions - { - [XmlAttribute("preCompiledHeader")] - public PreCompiledHeader preCompiledHeader = PreCompiledHeader.DontUsePre; - - [XmlAttribute("headerFile")] - public string headerFile = "Stdafx.H"; - - [ConvertToRelativePath()] - [XmlAttribute("preCompiledHeaderFile")] - public string preCompiledHeaderFile = ""; - - public PreCompiledHeader PreCompiledHeader { - get { - return preCompiledHeader; - } - set { - preCompiledHeader = value; - } - } - public string HeaderFile { - get { - return headerFile; - } - set { - headerFile = value; - } - } - public string PreCompiledHeaderFile - { - get - { - return preCompiledHeaderFile; - } - set - { - preCompiledHeaderFile = value; - } - } - - private void AppendHeaderFile(StringBuilder result) - { - if (IsNotEmpty(headerFile)) { - result.Append("\""); - result.Append(headerFile); - result.Append("\""); - } - result.Append("\n"); - } - - public string GetCreatePreCompiledHeaderParameter() - { - StringBuilder result = new StringBuilder(); - result.Append("/Yc"); - AppendHeaderFile(result); - - if (IsNotEmpty(preCompiledHeaderFile)) { - AppendOption(result, "/Fp", preCompiledHeaderFile); - } - - return result.ToString(); - } - - public bool PreCompileHeader { - get { - return preCompiledHeader == PreCompiledHeader.Create || - preCompiledHeader == PreCompiledHeader.Use; - } - } - - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - switch (preCompiledHeader) { - case PreCompiledHeader.DontUsePre: - result.Append("/Y-\n"); - break; - case PreCompiledHeader.Create: - case PreCompiledHeader.Use: - result.Append("/Yu"); - AppendHeaderFile(result); - break; - case PreCompiledHeader.CreateAutomatically: - result.Append("/YX"); - AppendHeaderFile(result); - break; - -// case PreCompiledHeader.Create: -// result.Append("/Yc"); -// AppendHeaderFile(result); -// break; -// case PreCompiledHeader.Use: -// result.Append("/Yu"); -// AppendHeaderFile(result); -// break; -// case PreCompiledHeader.CreateAutomatically: -// result.Append("/YX"); -// AppendHeaderFile(result); -// break; - } - - if (IsNotEmpty(preCompiledHeaderFile)) { - AppendOption(result, "/Fp", preCompiledHeaderFile); - } - - return result.ToString(); - } - } - #endregion - - #region Output File Options - [XmlNodeName("OutputFileCPPOptions")] - public class OutputFileCPPOptions - { - [XmlAttribute("extendSourceWithAttributes")] - public bool extendSourceWithAttributes = false; - - [XmlAttribute("assemblyOutput")] - public AssemblyOutput assemblyOutput = AssemblyOutput.NoList; - - [XmlAttribute("assemblerListSaveLocation")] - public string assemblerListSaveLocation = ""; - - [XmlAttribute("objectName")] - public string objectName = ""; - - [XmlAttribute("programDatabaseName")] - public string programDatabaseName = ""; - - public bool ExtendSourceWithAttributes { - get { - return extendSourceWithAttributes; - } - set { - extendSourceWithAttributes = value; - } - } - public AssemblyOutput AssemblyOutput { - get { - return assemblyOutput; - } - set { - assemblyOutput = value; - } - } - public string AssemblerListSaveLocation { - get { - return assemblerListSaveLocation; - } - set { - assemblerListSaveLocation = value; - } - } - public string ObjectName { - get { - return objectName; - } - set { - objectName = value; - } - } - public string ProgramDatabaseName { - get { - return programDatabaseName; - } - set { - programDatabaseName = value; - } - } - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - - if (extendSourceWithAttributes) { - result.Append("/Fx\n"); - } - - switch (assemblyOutput) { - case AssemblyOutput.ListAssembly: - result.Append("/FA\n"); - break; - case AssemblyOutput.ListAssemblyWithCode: - result.Append("/FAc\n"); - break; - case AssemblyOutput.ListAssemblyWithCodeAndSource: - result.Append("/FAcs\n"); - break; - case AssemblyOutput.ListAssemblyWithSource: - result.Append("/FAs\n"); - break; - case AssemblyOutput.NoList: - break; - } - - if (IsNotEmpty(assemblerListSaveLocation)) - { - AppendOption(result, "/Fa", assemblerListSaveLocation); - } - - if (IsNotEmpty(objectName)) - { - AppendOption(result, "/Fo", objectName); - } - - if (IsNotEmpty(programDatabaseName)) - { - AppendOption(result, "/Fd", programDatabaseName); - } - return result.ToString(); - } - } - #endregion - - #region Information Search Options - [XmlNodeName("InformationSearchCPPOptions")] - public class InformationSearchCPPOptions - { - [XmlAttribute("activateBrowseInformation")] - public bool activateBrowseInformation = false; - - [XmlAttribute("browseFile")] - public string browseFile = ""; - - public bool ActivateBrowseInformation { - get { - return activateBrowseInformation; - } - set { - activateBrowseInformation = value; - } - } - public string BrowseFile { - get { - return browseFile; - } - set { - browseFile = value; - } - } - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - if (activateBrowseInformation) { - result.Append("/FR"); - if (IsNotEmpty(browseFile)) - { - result.Append(browseFile); - } - result.Append("\n"); - } - return result.ToString(); - } - } - #endregion - - #region Extended Options - [XmlNodeName("ExtendedCPPOptions")] - public class ExtendedCPPOptions - { - [XmlAttribute("callingConvention")] - public CallingConvention callingConvention = CallingConvention.__cdecl; - - [XmlAttribute("compileType")] - public CompileType compileType = CompileType.CPP; - - [XmlAttribute("surpressedWarnings")] - public string surpressedWarnings = ""; - - [XmlAttribute("forcedIncludes")] - public string forcedIncludes = ""; - - [XmlAttribute("forcedUsings")] - public string forcedUsings = ""; - - [XmlAttribute("showIncludes")] - public bool showIncludes = false; - - [XmlAttribute("overridePreProcessorDirectives")] - public string overridePreProcessorDirectives = ""; - - [XmlAttribute("overrideAllPreProcessorDirectives")] - public bool overrideAllPreProcessorDirectives = false; - - public CallingConvention CallingConvention { - get { - return callingConvention; - } - set { - callingConvention = value; - } - } - public CompileType CompileType { - get { - return compileType; - } - set { - compileType = value; - } - } - public string SurpressedWarnings { - get { - return surpressedWarnings; - } - set { - surpressedWarnings = value; - } - } - public string ForcedIncludes { - get { - return forcedIncludes; - } - set { - forcedIncludes = value; - } - } - public string ForcedUsings { - get { - return forcedUsings; - } - set { - forcedUsings = value; - } - } - public bool ShowIncludes { - get { - return showIncludes; - } - set { - showIncludes = value; - } - } - public string OverridePreProcessorDirectives { - get { - return overridePreProcessorDirectives; - } - set { - overridePreProcessorDirectives = value; - } - } - public bool OverrideAllPreProcessorDirectives { - get { - return overrideAllPreProcessorDirectives; - } - set { - overrideAllPreProcessorDirectives = value; - } - } - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - switch (CallingConvention) { - case CallingConvention.__cdecl: - result.Append("/Gd\n"); - break; - case CallingConvention.__fastcall: - result.Append("/Gr\n"); - break; - case CallingConvention.__stdcall: - result.Append("/Gz\n"); - break; - } - - switch (CompileType) { - case CompileType.C: - result.Append("/TC\n"); - break; - case CompileType.CPP: - result.Append("/TP\n"); - break; - case CompileType.Standard: - break; - } - - if (IsNotEmpty(surpressedWarnings)) - { - AppendList(result, "/wd", surpressedWarnings); - } - - if (IsNotEmpty(forcedIncludes)) - { - AppendList(result, "/FI", forcedIncludes, true); - } - - if (IsNotEmpty(forcedUsings)) - { - AppendList(result, "/FU", forcedUsings, true); - } - - if (showIncludes) - { - result.Append("/showIncludes\n"); - } - - if (overrideAllPreProcessorDirectives) - { - result.Append("/u\n"); - } - else - { - if (IsNotEmpty(overridePreProcessorDirectives)) - { - AppendList(result, "/U", overridePreProcessorDirectives); - } - } - - return result.ToString(); - } - } - #endregion - - #region General Linker Options - [XmlNodeName("GeneralLinkerOptions")] - public class GeneralLinkerOptions : LocalizedObject - { - [XmlAttribute("outputFile")] - [ConvertToRelativePath()] - public string outputFile = "a.exe"; - - [XmlAttribute("showLinkerStatus")] - public ShowLinkerStatus showLinkerStatus = ShowLinkerStatus.Unselected; - - [XmlAttribute("version")] - public string version = ""; - - [XmlAttribute("incrementalLinking")] - public IncrementalLinking incrementalLinking = IncrementalLinking.Standard; - - [XmlAttribute("surpressStartLogo")] - public bool surpressStartLogo = false; - - [XmlAttribute("additionalLinkerOptions")] - public string additionalLinkerOptions = ""; - -// [XmlAttribute("ignoreImportLibrary")] -// public bool ignoreImportLibrary = true; - -// [XmlAttribute("registerOutput")] -// public bool registerOutput = false; - - [XmlAttribute("additionalLibraryDirectories")] - public string additionalLibraryDirectories = ""; - - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); -// result.Append("/OUT:");result.Append(outputFile);result.Append("\n"); - switch (ShowLinkerStatus) { - case ShowLinkerStatus.ShowAll: - result.Append("/VERBOSE\n"); - break; - case ShowLinkerStatus.ShowSome: - result.Append("/VERBOSE:LIB\n"); - break; - - } - if (IsNotEmpty(version)) { - result.Append("/VERSION:").Append(version).Append("\n"); - } - - switch (IncrementalLinking) { - case IncrementalLinking.Standard: - break; - case IncrementalLinking.No: - result.Append("/INCREMENTAL:NO\n"); - break; - case IncrementalLinking.Yes: - result.Append("/INCREMENTAL\n"); - break; - } - - if (SurpressStartLogo) { - result.Append("/NOLOGO\n"); - } - - if (IsNotEmpty(AdditionalLibraryDirectories)) { - AppendList(result, "/LIBPATH:", AdditionalLibraryDirectories, true); - } - result.Append(additionalLinkerOptions); - result.Append("\n"); - return result.ToString(); - } - - [LocalizedProperty("Output File", - Description = "Specifies the name of the output file. (/OUT:[file])")] - public string OutputFile { - get { - return outputFile; - } - set { - outputFile = value; - } - } - - [DefaultValue(ShowLinkerStatus.Unselected)] - [LocalizedProperty("Show Status", - Description = "Shows detailed progress status. (/VERBOSE, /VERBOSE:LIB)")] - public ShowLinkerStatus ShowLinkerStatus { - get { - return showLinkerStatus; - } - set { - showLinkerStatus = value; - } - } - - [DefaultValue("")] - [LocalizedProperty("Version", - Description = "Use this value as the version number in created image header. (/VERSION:[version])")] - public string Version { - get { - return version; - } - set { - version = value; - } - } - - [DefaultValue(IncrementalLinking.Standard)] - [LocalizedProperty("Enable Incremental Linking", - Description = "Enables incremental linking. (/INCREMENTAL, /INCREMENTAL:NO)")] - public IncrementalLinking IncrementalLinking { - get { - return incrementalLinking; - } - set { - incrementalLinking = value; - } - } - - [DefaultValue(false)] - [LocalizedProperty("Surpress Startup Logo", - Description = "Surpress the display of the startup logo and information messages. (/NOLOGO)")] - public bool SurpressStartLogo { - get { - return surpressStartLogo; - } - set { - surpressStartLogo = value; - } - } - -// [DefaultValue(true)] -// [LocalizedProperty("Ignore Import Library", -// Description = "Specifies that the import library generated by this configuration should not be imported into dependent projects.")] -// public bool IgnoreImportLibrary { -// get { -// return ignoreImportLibrary; -// } -// set { -// ignoreImportLibrary = value; -// } -// } - -// [LocalizedProperty("Register Output", -// Description = "Specifies whether to register the primary output of this build.")] -// public bool RegisterOutput { -// get { -// return registerOutput; -// } -// set { -// registerOutput = value; -// } -// } - - [DefaultValue("")] - [LocalizedProperty("Additional Library Directories", - Description = "Specifies one or more semi-colon delimited additonal paths to search for libraries. (/LIBPATH:[path])")] - public string AdditionalLibraryDirectories { - get { - return additionalLibraryDirectories; - } - set { - additionalLibraryDirectories = value; - } - } - - [DefaultValue("")] - [LocalizedProperty("Additional Linker Options", - Description = "Specifies additional options given to the linker.")] - public string AdditionalLinkerOptions { - get { - return additionalLinkerOptions; - } - set { - additionalLinkerOptions = value; - } - } - - - } - #endregion - - #region Input Linker Options - [XmlNodeName("InputLinkerOptions")] - public class InputLinkerOptions - { - [XmlAttribute("additionalDependencies")] - public string additionalDependencies = ""; - - [XmlAttribute("ignoreStandardLibrary")] - public bool ignoreStandardLibrary = false; - - [XmlAttribute("ignoreLibrary")] - public string ignoreLibrary = ""; - - [XmlAttribute("moduleDefinition")] - public string moduleDefinition = ""; - - [XmlAttribute("addModuleToAssembly")] - public string addModuleToAssembly = ""; - - [XmlAttribute("embedResourceToAssembly")] - public string embedResourceToAssembly = ""; - - [XmlAttribute("forcedSymbolLinks")] - public string forcedSymbolLinks = ""; - - [XmlAttribute("laterLoadedDLLs")] - public string laterLoadedDLLs = ""; - - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - if (ignoreStandardLibrary) - { - result.Append("/NODEFAULTLIB\n"); - } - else - { - if (IsNotEmpty(ignoreLibrary)) - { - AppendList(result, "/NODEFAULTLIB:", ignoreLibrary); - } - } - if (IsNotEmpty(additionalDependencies)) - { - AppendList(result, "", additionalDependencies); - } - if (IsNotEmpty(moduleDefinition)) - { - result.Append("/DEF:"); - result.Append(moduleDefinition); - result.Append("\n"); - } - if (IsNotEmpty(addModuleToAssembly)) - { - AppendList(result, "/ASSEMBLYMODULE:", addModuleToAssembly); - } - if (IsNotEmpty(embedResourceToAssembly)) - { - AppendList(result, "/ASSEMBLYRESOURCE:", embedResourceToAssembly); - } - if (IsNotEmpty(forcedSymbolLinks)) - { - AppendList(result, "/INCLUDE:", forcedSymbolLinks); - } - if (IsNotEmpty(laterLoadedDLLs)) - { - AppendList(result, "/DELAYLOAD:", laterLoadedDLLs); - } - return result.ToString(); - } - - public string AdditionalDependencies { - get { - return additionalDependencies; - } - set { - additionalDependencies = value; - } - } - - public bool IgnoreStandardLibrary { - get { - return ignoreStandardLibrary; - } - set { - ignoreStandardLibrary = value; - } - } - public string IgnoreLibrary { - get { - return ignoreLibrary; - } - set { - ignoreLibrary = value; - } - } - public string ModuleDefinition { - get { - return moduleDefinition; - } - set { - moduleDefinition = value; - } - } - public string AddModuleToAssembly { - get { - return addModuleToAssembly; - } - set { - addModuleToAssembly = value; - } - } - public string EmbedResourceToAssembly { - get { - return embedResourceToAssembly; - } - set { - embedResourceToAssembly = value; - } - } - public string ForcedSymbolLinks { - get { - return forcedSymbolLinks; - } - set { - forcedSymbolLinks = value; - } - } - public string LaterLoadedDLLs { - get { - return laterLoadedDLLs; - } - set { - laterLoadedDLLs = value; - } - } - - } - #endregion - - #region Debug Linker Options - [XmlNodeName("DebugLinkerOptions")] - public class DebugLinkerOptions - { - [XmlAttribute("generateDebugInfo")] - public bool generateDebugInfo = false; - - [XmlAttribute("generatedProgramDatabase")] - public string generatedProgramDatabase = ""; - - [XmlAttribute("removePrivateSymbols")] - public string removePrivateSymbols = ""; - - [XmlAttribute("generateMapFile")] - public bool generateMapFile = false; - - [XmlAttribute("mapFile")] - public string mapFile = ""; - - [XmlAttribute("mapExport")] - public bool mapExport = false; - - [XmlAttribute("mapLines")] - public bool mapLines = false; - - [XmlAttribute("debuggableAssembly")] - public DebuggableAssembly debuggableAssembly; - - public bool GenerateDebugInfo { - get { - return generateDebugInfo; - } - set { - generateDebugInfo = value; - } - } - public string GeneratedProgramDatabase { - get { - return generatedProgramDatabase; - } - set { - generatedProgramDatabase = value; - } - } - public string RemovePrivateSymbols { - get { - return removePrivateSymbols; - } - set { - removePrivateSymbols = value; - } - } - public bool GenerateMapFile { - get { - return generateMapFile; - } - set { - generateMapFile = value; - } - } - public string MapFile { - get { - return mapFile; - } - set { - mapFile = value; - } - } - public bool MapExport { - get { - return mapExport; - } - set { - mapExport = value; - } - } - public bool MapLines { - get { - return mapLines; - } - set { - mapLines = value; - } - } - public DebuggableAssembly DebuggableAssembly { - get { - return debuggableAssembly; - } - set { - debuggableAssembly = value; - } - } - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - - if (generateDebugInfo) - { - result.Append("/DEBUG\n"); - } - - if (IsNotEmpty(generatedProgramDatabase)) - { - result.Append("/PDB:"); - result.Append(generatedProgramDatabase); - result.Append("\n"); - } - - if (IsNotEmpty(removePrivateSymbols)) - { - result.Append("/PDBSTRIPPED:"); - result.Append(removePrivateSymbols); - result.Append("\n"); - } - - if (generateMapFile) - { - result.Append("/MAP"); - if (IsNotEmpty(mapFile)) - { - result.Append(":"); - result.Append(mapFile); - } - result.Append("\n"); - - } - - if (mapExport) - { - result.Append("/MAPINFO:EXPORTS\n"); - } - - if (mapLines) - { - result.Append("/MAPINFO:LINES\n"); - } - - switch (debuggableAssembly) { - case DebuggableAssembly.DontEmitDebuggable: - break; - case DebuggableAssembly.DisableDebugToRuntimEnableOptimization: - result.Append("/ASSEMBLYDEBUG:DISABLE\n"); - break; - case DebuggableAssembly.EnableDebugToRuntimeDisableOptimization: - result.Append("/ASSEMBLYDEBUG\n"); - break; - } - - return result.ToString(); - } - - } - #endregion - - #region System Linker Options - [XmlNodeName("SystemLinkerOptions")] - public class SystemLinkerOptions - { - [XmlAttribute("linkerSubSystem")] - public LinkerSubSystem linkerSubSystem = LinkerSubSystem.Unselected; - - [XmlAttribute("heapAllocationSize")] - public int heapAllocationSize = 0; - - [XmlAttribute("heapCommitSize")] - public int heapCommitSize = 0; - - [XmlAttribute("stackAllocationSize")] - public int stackAllocationSize = 0; - - [XmlAttribute("stackCommitSize")] - public int stackCommitSize= 0; - - [XmlAttribute("activateBigAddresses")] - public ActivateBigAddresses activateBigAddresses = ActivateBigAddresses.Standard; - - [XmlAttribute("terminalServer")] - public TerminalServer terminalServer = TerminalServer.Standard; - - [XmlAttribute("runFromCDROM")] - public bool runFromCDROM = false; - - [XmlAttribute("runFromNetwork")] - public bool runFromNetwork = false; - - public LinkerSubSystem LinkerSubSystem { - get { - return linkerSubSystem; - } - set { - linkerSubSystem = value; - } - } - public int HeapAllocationSize { - get { - return heapAllocationSize; - } - set { - heapAllocationSize = value; - } - } - public int HeapCommitSize { - get { - return heapCommitSize; - } - set { - heapCommitSize = value; - } - } - public int StackAllocationSize { - get { - return stackAllocationSize; - } - set { - stackAllocationSize = value; - } - } - public int StackCommitSize { - get { - return stackCommitSize; - } - set { - stackCommitSize = value; - } - } - public ActivateBigAddresses ActivateBigAddresses { - get { - return activateBigAddresses; - } - set { - activateBigAddresses = value; - } - } - public TerminalServer TerminalServer { - get { - return terminalServer; - } - set { - terminalServer = value; - } - } - public bool RunFromCDROM { - get { - return runFromCDROM; - } - set { - runFromCDROM = value; - } - } - public bool RunFromNetwork { - get { - return runFromNetwork; - } - set { - runFromNetwork = value; - } - } - public string GetCommandLineParameters() - { - StringBuilder result = new StringBuilder(); - - switch (LinkerSubSystem) { - case LinkerSubSystem.Console: - result.Append("/SUBSYSTEM:CONSOLE\n"); - break; - case LinkerSubSystem.Unselected: - break; - case LinkerSubSystem.Windows: - result.Append("/SUBSYSTEM:WINDOWS\n"); - break; - } - - if (heapAllocationSize > 0) - { - result.Append("/HEAP:"); - result.Append(heapAllocationSize); - if (heapCommitSize > 0) - { - result.Append(","); - result.Append(heapCommitSize); - } - result.Append("\n"); - } - - if (stackAllocationSize > 0) - { - result.Append("/STACK:"); - result.Append(stackAllocationSize); - if (stackCommitSize > 0) - { - result.Append(","); - result.Append(stackCommitSize); - } - result.Append("\n"); - } - - switch (ActivateBigAddresses) { - case ActivateBigAddresses.NoSupport: - result.Append("/LARGEADDRESSAWARE:NO\n"); - break; - case ActivateBigAddresses.Standard: - break; - case ActivateBigAddresses.Supported: - result.Append("/LARGEADDRESSAWARE\n"); - break; - } - - switch (TerminalServer) { - case TerminalServer.Bound: - result.Append("/TSAWARE\n"); - break; - case TerminalServer.NotBound: - result.Append("/TSAWARE:NO\n"); - break; - case TerminalServer.Standard: - break; - } - - if (runFromCDROM) - { - result.Append("/SWAPRUN:CD\n"); - } - - if (runFromNetwork) - { - result.Append("/SWAPRUN:NET\n"); - } - - return result.ToString(); - } - - } - #endregion - - - public bool PreCompileHeader { - get { - return preCompiledHeaderCPPOptions.PreCompileHeader; - } - } - - public string GetPreCompiledHeaderOptions() - { - return generalCPPOptions.GetCommandLineParameters() + - optimizeCPPOptions.GetCommandLineParameters() + - preProcessorCPPOptions.GetCommandLineParameters() + - codeGenerationCPPOptions.GetCommandLineParameters() + - languageCPPOptions.GetCommandLineParameters() + - preCompiledHeaderCPPOptions.GetCreatePreCompiledHeaderParameter() + - outputFileCPPOptions.GetCommandLineParameters() + - informationSearchCPPOptions.GetCommandLineParameters() + - extendedCPPOptions.GetCommandLineParameters(); - } - - public string GetCompilerOptions() - { - return generalCPPOptions.GetCommandLineParameters() + - optimizeCPPOptions.GetCommandLineParameters() + - preProcessorCPPOptions.GetCommandLineParameters() + - codeGenerationCPPOptions.GetCommandLineParameters() + - languageCPPOptions.GetCommandLineParameters() + - preCompiledHeaderCPPOptions.GetCommandLineParameters() + - outputFileCPPOptions.GetCommandLineParameters() + - informationSearchCPPOptions.GetCommandLineParameters() + - extendedCPPOptions.GetCommandLineParameters(); - } - - public string GetLinkerOptions() - { - return generalLinkerOptions.GetCommandLineParameters() + - inputLinkerOptions.GetCommandLineParameters() + - debugLinkerOptions.GetCommandLineParameters() + - systemLinkerOptions.GetCommandLineParameters(); - } - - public string GetLinkerOptionsForCompiler() - { - StringBuilder result = new StringBuilder(); - foreach (string val in GetLinkerOptions().Split('\n')) - { - result.Append(val); - result.Append("\n"); - } - return result.ToString(); - } - - public GeneralCPPOptions generalCPPOptions = new GeneralCPPOptions(); - public OptimizeCPPOptions optimizeCPPOptions = new OptimizeCPPOptions(); - public PreProcessorCPPOptions preProcessorCPPOptions = new PreProcessorCPPOptions(); - public CodeGenerationCPPOptions codeGenerationCPPOptions = new CodeGenerationCPPOptions(); - public LanguageCPPOptions languageCPPOptions = new LanguageCPPOptions(); - public PreCompiledHeaderCPPOptions preCompiledHeaderCPPOptions = new PreCompiledHeaderCPPOptions(); - public OutputFileCPPOptions outputFileCPPOptions = new OutputFileCPPOptions(); - public InformationSearchCPPOptions informationSearchCPPOptions = new InformationSearchCPPOptions(); - public ExtendedCPPOptions extendedCPPOptions = new ExtendedCPPOptions(); - - public GeneralLinkerOptions generalLinkerOptions = new GeneralLinkerOptions(); - public InputLinkerOptions inputLinkerOptions = new InputLinkerOptions(); - public DebugLinkerOptions debugLinkerOptions = new DebugLinkerOptions(); - public SystemLinkerOptions systemLinkerOptions = new SystemLinkerOptions(); - - MiscCPPOptions miscCPPOptions = new MiscCPPOptions(); - - public override string OutputDirectory { - get { - return miscCPPOptions.outputDirectory; - } - set { - miscCPPOptions.outputDirectory = value; - } - } - - public string OutputFile { - get { - return generalLinkerOptions.OutputFile; - } - set { - generalLinkerOptions.OutputFile = value; - } - } - - public string IntermediateDirectory { - get { - return miscCPPOptions.intermediateDirectory; - } - set { - miscCPPOptions.intermediateDirectory = value; - } - } - - public ConfigurationType ConfigurationType { - get { - return miscCPPOptions.configurationType; - } - set { - miscCPPOptions.configurationType = value; - } - } - - public bool UseManagedExtensions { - get { - return miscCPPOptions.useManagedExtensions; - } - set { - miscCPPOptions.useManagedExtensions = value; - } - } - - public string AdditionalCompilerOptions { - get { - return miscCPPOptions.additionalCompilerOptions; - } - set { - miscCPPOptions.additionalCompilerOptions = value; - } - } - -// public CPPCompilerParameters(string[] additionalCompilerOptions) -// { -// this.AdditionalCompilerOptions = additionalCompilerOptions; -// } - - public CPPCompilerParameters() - { - } - - public CPPCompilerParameters(string name) - { - this.name = name; - - } - } -} diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetProject.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetProject.cs deleted file mode 100644 index 57c47f7f88..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetProject.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// -// -// -// -// - -using System; -using System.IO; -using System.Collections; -using System.Diagnostics; -using System.ComponentModel; -using System.Xml; - -using ICSharpCode.SharpDevelop.Internal.Project; -using ICSharpCode.SharpDevelop.Internal.Templates; - -namespace CPPBinding -{ - /// - /// This class describes a C Sharp project and it compilation options. - /// - public class CPPProject : AbstractProject - { - public override string ProjectType { - get { - return CPPLanguageBinding.LanguageName; - } - } - - public CPPProject() - { - } - - public override IConfiguration CreateConfiguration() - { - return new CPPCompilerParameters(); - } - - public CPPProject(ProjectCreateInformation info, XmlElement projectOptions) - { - if (info != null) { - Name = info.ProjectName; - Configurations.Add(CreateConfiguration("Debug")); - Configurations.Add(CreateConfiguration("Release")); - - foreach (CPPCompilerParameters parameter in Configurations) { - parameter.OutputDirectory = info.BinPath + Path.DirectorySeparatorChar + parameter.Name; - parameter.IntermediateDirectory = info.BinPath + Path.DirectorySeparatorChar + parameter.Name; - parameter.OutputAssembly = Name; - if (projectOptions != null) { - if (projectOptions.Attributes["ConfigurationType"] != null) { - parameter.ConfigurationType = (ConfigurationType)Enum.Parse(typeof(ConfigurationType), projectOptions.Attributes["ConfigurationType"].InnerText); - } - } - parameter.OutputFile = parameter.OutputDirectory + Path.DirectorySeparatorChar + Name + (parameter.ConfigurationType == ConfigurationType.Dll ? ".dll" : ".exe"); - } - } - } - } -} diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Empty.xft b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Empty.xft deleted file mode 100644 index 5e5d632d11..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Empty.xft +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Header.xft b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Header.xft deleted file mode 100644 index ec93f55ebc..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Header.xft +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/ConsoleProject.xpt b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/ConsoleProject.xpt deleted file mode 100644 index f5a257de73..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/ConsoleProject.xpt +++ /dev/null @@ -1,84 +0,0 @@ - - diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/EmptyProject.xpt b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/EmptyProject.xpt deleted file mode 100644 index ed7a5f87cb..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/EmptyProject.xpt +++ /dev/null @@ -1,18 +0,0 @@ - - diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/FormsProject.xpt b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/FormsProject.xpt deleted file mode 100644 index 2ee96da968..0000000000 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/FormsProject.xpt +++ /dev/null @@ -1,107 +0,0 @@ - - diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs index 3c65346ca3..0e2fd8ef13 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs @@ -6,7 +6,7 @@ //
using System; -using System.Collections; +using System.Collections.Generic; using System.IO; using ICSharpCode.TextEditor; @@ -130,7 +130,7 @@ namespace CSharpBinding.FormattingStrategy FileStream f; StreamReader r; - ArrayList lines = new ArrayList(); + List lines = new List(); bool dirty = false; string filename; diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs index 384f531a4b..55520748fe 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs @@ -6,7 +6,7 @@ // using System; -using System.Collections; +using System.Collections.Generic; using System.Drawing.Design; using System.IO; using System.Reflection; @@ -23,7 +23,7 @@ namespace ICSharpCode.FormsDesigner public class ToolboxProvider { static ICSharpCode.FormsDesigner.Services.ToolboxService toolboxService = null; - public static ArrayList SideTabs = new ArrayList(); + public static List SideTabs = new List(); static ComponentLibraryLoader componentLibraryLoader = new ComponentLibraryLoader(); diff --git a/src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingPanel.cs b/src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingPanel.cs index 98cc83ff9c..c317736035 100644 --- a/src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingPanel.cs +++ b/src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingPanel.cs @@ -8,7 +8,6 @@ using System; using System.Drawing; using System.Windows.Forms; -using System.Collections; using System.Collections.Generic; using System.IO; using System.Xml; @@ -226,7 +225,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels BuiltinListSelectedIndexChanged(this, EventArgs.Empty); } - ArrayList errors = new ArrayList(); + List errors = new List(); private SchemeNode LoadFile(XmlTextReader reader, bool userList) { diff --git a/src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/EnvironmentNode.cs b/src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/EnvironmentNode.cs index 7bf0623d48..a5edb77e0f 100644 --- a/src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/EnvironmentNode.cs +++ b/src/AddIns/Misc/HighlightingEditor/Project/Src/Nodes/EnvironmentNode.cs @@ -29,9 +29,10 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes public EnvironmentNode(XmlElement el) { - ArrayList envColors = new ArrayList(); - ArrayList envColorNames = new ArrayList(); - ArrayList envColorDescriptions = new ArrayList(); + List envColors = new List(); + List envColorNames = new List(); + List envColorDescriptions = new List(); + if (el != null) { foreach (XmlNode node in el.ChildNodes) { if (node is XmlElement) { @@ -55,9 +56,9 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes } } - EnvironmentNode.ColorNames = (string[])envColorNames.ToArray(typeof(string)); - this.ColorDescs = (string[])envColorDescriptions.ToArray(typeof(string)); - this.Colors = (EditorHighlightColor[])envColors.ToArray(typeof(EditorHighlightColor)); + EnvironmentNode.ColorNames = envColorNames.ToArray(); + this.ColorDescs = envColorDescriptions.ToArray(); + this.Colors = envColors.ToArray(); StringParser.Parse(ColorDescs); Text = ResNodeName("EnvironmentColors"); diff --git a/src/AddIns/Misc/PInvokeAddIn/Project/Src/PInvokeRepository.cs b/src/AddIns/Misc/PInvokeAddIn/Project/Src/PInvokeRepository.cs index 6f1cfcef2a..30545eb9f2 100644 --- a/src/AddIns/Misc/PInvokeAddIn/Project/Src/PInvokeRepository.cs +++ b/src/AddIns/Misc/PInvokeAddIn/Project/Src/PInvokeRepository.cs @@ -6,7 +6,7 @@ // using System; -using System.Collections; +using System.Collections.Generic; using System.IO; using System.Reflection; using System.Xml; @@ -85,27 +85,27 @@ namespace ICSharpCode.PInvokeAddIn XmlDocument doc = new XmlDocument(); doc.Load(configFile); - ArrayList moduleArrayList = new ArrayList(); - ArrayList functionArrayList = new ArrayList(); + List moduleList = new List(); + List functionList = new List(); foreach(XmlElement moduleElement in doc.DocumentElement.SelectNodes("//module")) { XmlAttribute moduleName = (XmlAttribute)moduleElement.SelectSingleNode("@name"); - moduleArrayList.Add(moduleName.Value); + moduleList.Add(moduleName.Value); foreach(XmlAttribute functionName in moduleElement.SelectNodes("function/@name")) { - functionArrayList.Add(functionName.Value); + functionList.Add(functionName.Value); } } - moduleNames = new string[moduleArrayList.Count]; - moduleArrayList.Sort(); - moduleArrayList.CopyTo(moduleNames); + moduleNames = new string[moduleList.Count]; + moduleList.Sort(); + moduleList.CopyTo(moduleNames); - functionNames = new string[functionArrayList.Count]; - functionArrayList.Sort(); - functionArrayList.CopyTo(functionNames); + functionNames = new string[functionList.Count]; + functionList.Sort(); + functionList.CopyTo(functionNames); } } } diff --git a/src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs b/src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs index 5170606eeb..511f051605 100644 --- a/src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs +++ b/src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs @@ -9,7 +9,7 @@ // the compile stuff using System; -using System.Collections; +using System.Collections.Generic; using System.Windows.Forms; using System.Text.RegularExpressions; using System.Drawing; @@ -66,7 +66,7 @@ namespace Plugins.RegExpTk { { SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.RegExpTkMainForm.xfrm")); - ArrayList quickies = new ArrayList(); + List quickies = new List(); quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.UngreedyStar}", "*?")); quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.WordCharacter}", "\\w")); quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.NonWordCharacter}", "\\W")); diff --git a/src/AddIns/Misc/RegExpTk/RegExpTkPad.cs.old b/src/AddIns/Misc/RegExpTk/RegExpTkPad.cs.old deleted file mode 100644 index 2af1ae14f5..0000000000 --- a/src/AddIns/Misc/RegExpTk/RegExpTkPad.cs.old +++ /dev/null @@ -1,37 +0,0 @@ -// -// -// -// -// -// -using System; -using System.Drawing; -using System.Collections; -using System.Diagnostics; -using System.ComponentModel; -using System.Windows.Forms; - -using ICSharpCode.SharpDevelop.Gui.Dialogs; -using ICSharpCode.SharpDevelop.Gui; - -using ICSharpCode.Core.AddIns; -using ICSharpCode.Core.AddIns.Codons; -using ICSharpCode.Core.Properties; - -namespace Plugins.RegExpTk { - - public class RegExpTkCommand : AbstractMenuCommand - { - - public override void Run() - { - RegExpTkDialog dialog = new RegExpTkDialog(); - dialog.ShowDialog(); - } - } - - public class RegExpTkDialog : Form - { - - } -} diff --git a/src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs b/src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs index 96df27c686..303778c3e1 100644 --- a/src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs +++ b/src/AddIns/Misc/StartPage/Project/Src/ICSharpCodePage.cs @@ -7,7 +7,7 @@ using System; using System.IO; -using System.Collections; +using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Xml; @@ -133,13 +133,11 @@ namespace ICSharpCode.StartPage set { m_bShowContentBar = value; } } - private ArrayList TopMenu; - private ArrayList LeftMenu; + private List TopMenu; + private List LeftMenu; public virtual void PopulateTopMenu() { - - TopMenu.Add(new MenuItem(StringParser.Parse("${res:StartPage.StartMenu.Name}"), "startpage://Start")); TopMenu.Add(new MenuItem(StringParser.Parse("${res:StartPage.ChangeLogMenu.Name}"), "startpage://ChangeLog")); TopMenu.Add(new MenuItem(StringParser.Parse("${res:StartPage.AuthorsMenu.Name}"), "startpage://Authors")); @@ -148,11 +146,6 @@ namespace ICSharpCode.StartPage public virtual void PopulateLeftMenu() { -// LeftMenu.Add(new MenuItem("Start", "/OpenSource/SD/AnnouncementList.asp")); -// LeftMenu.Add(new MenuItem("ChangeLog", "/OpenSource/SD/WhatsNew.asp")); -// LeftMenu.Add(new MenuItem("Authors", "/OpenSource/SD/NewsHistory.asp")); -// LeftMenu.Add(new MenuItem("Readme", "/OpenSource/SD/NewsHistory.asp")); -// LeftMenu.Add(new MenuItem("Help Wanted", "/pub/relations/")); } public string TopMenuSelectedItem @@ -194,11 +187,11 @@ namespace ICSharpCode.StartPage { ColorScheme = ICSharpCode.StartPage.ColorScheme.brown; - TopMenu = new ArrayList(); + TopMenu = new List(); PopulateTopMenu(); TopMenuSelectedItem = "Home"; - LeftMenu = new ArrayList(); + LeftMenu = new List(); PopulateLeftMenu(); LeftMenuSelectedItem = ""; diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoQueue.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoQueue.cs index d0be94a18b..767b9f12d0 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoQueue.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoQueue.cs @@ -7,7 +7,7 @@ using System; using System.Diagnostics; -using System.Collections; +using System.Collections.Generic; namespace ICSharpCode.TextEditor.Undo { @@ -17,7 +17,7 @@ namespace ICSharpCode.TextEditor.Undo /// public class UndoQueue : IUndoableOperation { - ArrayList undolist = new ArrayList(); + List undolist = new List(); /// /// @@ -38,14 +38,14 @@ namespace ICSharpCode.TextEditor.Undo public void Undo() { for (int i = 0; i < undolist.Count; ++i) { - ((IUndoableOperation)undolist[i]).Undo(); + undolist[i].Undo(); } } public void Redo() { for (int i = undolist.Count - 1 ; i >= 0 ; --i) { - ((IUndoableOperation)undolist[i]).Redo(); + undolist[i].Redo(); } } } diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoStack.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoStack.cs index c56920d58d..16a8cc91c8 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoStack.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoStack.cs @@ -8,7 +8,7 @@ using System; using System.Drawing; using System.Diagnostics; -using System.Collections; +using System.Collections.Generic; namespace ICSharpCode.TextEditor.Undo { @@ -17,8 +17,8 @@ namespace ICSharpCode.TextEditor.Undo /// public class UndoStack { - Stack undostack = new Stack(); - Stack redostack = new Stack(); + Stack undostack = new Stack(); + Stack redostack = new Stack(); public TextEditorControlBase TextEditorControl = null; @@ -36,7 +36,7 @@ namespace ICSharpCode.TextEditor.Undo /// /// This property is EXCLUSIVELY for the UndoQueue class, don't USE it /// - internal Stack _UndoStack { + internal Stack _UndoStack { get { return undostack; } diff --git a/src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideBar.cs b/src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideBar.cs index ae65e93797..4f70ad957e 100644 --- a/src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideBar.cs +++ b/src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideBar.cs @@ -6,7 +6,7 @@ // using System; -using System.Collections; +using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; @@ -929,15 +929,15 @@ namespace ICSharpCode.SharpDevelop.Gui } } - public class SideTabCollection : ICollection, IEnumerable + public class SideTabCollection : ICollection, IEnumerable { - ArrayList list = new ArrayList(); + List list = new List(); AxSideTab dragOverTab; AxSideBar sideBar; public AxSideTab this[int index] { get { - return (AxSideTab)list[index]; + return list[index]; } set { list[index] = value; @@ -980,15 +980,16 @@ namespace ICSharpCode.SharpDevelop.Gui } } - public virtual AxSideTab Add(AxSideTab item) + public virtual void Add(AxSideTab item) { list.Add(item); - return item; } public virtual AxSideTab Add(string name) { - return Add(sideBar.SideTabFactory.CreateSideTab(sideBar, name)); + AxSideTab tab = sideBar.SideTabFactory.CreateSideTab(sideBar, name); + Add(tab); + return tab; } public virtual void Clear() @@ -1001,7 +1002,12 @@ namespace ICSharpCode.SharpDevelop.Gui return list.Contains(item); } - public IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() + { + return list.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return list.GetEnumerator(); } @@ -1013,7 +1019,7 @@ namespace ICSharpCode.SharpDevelop.Gui public void CopyTo(Array dest, int index) { - list.CopyTo(dest, index); + list.CopyTo((AxSideTab[])dest, index); } public virtual AxSideTab Insert(int index, AxSideTab item) @@ -1027,7 +1033,7 @@ namespace ICSharpCode.SharpDevelop.Gui return Insert(index, sideBar.SideTabFactory.CreateSideTab(sideBar, name)); } - public virtual void Remove(AxSideTab item) + public bool Remove(AxSideTab item) { if (item == sideBar.ActiveTab) { int index = IndexOf(item); @@ -1039,19 +1045,30 @@ namespace ICSharpCode.SharpDevelop.Gui sideBar.ActiveTab = null; } } - list.Remove(item); + return list.Remove(item); } public virtual void RemoveAt(int index) { list.RemoveAt(index); } + + public bool IsReadOnly { + get { + return false; + } + } + + public void CopyTo(AxSideTab[] array, int arrayIndex) + { + list.CopyTo(array, arrayIndex); + } } } public class SpecialDataObject : System.Windows.Forms.IDataObject { - ArrayList dataObjects = new ArrayList(); + List dataObjects = new List(); public object GetData(string format) { return GetData(format, true); diff --git a/src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideTab.cs b/src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideTab.cs index bfd56c632c..d7d7d6323e 100644 --- a/src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideTab.cs +++ b/src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideTab.cs @@ -9,7 +9,7 @@ using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; -using System.Collections; +using System.Collections.Generic; using ICSharpCode.Core; namespace ICSharpCode.SharpDevelop.Gui @@ -400,9 +400,9 @@ namespace ICSharpCode.SharpDevelop.Gui } } - public class SideTabItemCollection : ICollection, IEnumerable + public class SideTabItemCollection : ICollection, IEnumerable { - ArrayList list = new ArrayList(); + List list = new List(); ISideTabItemFactory sideTabItemFactory = new DefaultSideTabItemFactory(); public event SideTabItemEventHandler ItemRemoved; @@ -457,12 +457,11 @@ namespace ICSharpCode.SharpDevelop.Gui } } - public virtual AxSideTabItem Add(AxSideTabItem item) + public virtual void Add(AxSideTabItem item) { list.Add(item); - return item; } - + public virtual AxSideTabItem Add(string name, object content) { return Add(name, content, -1); @@ -472,7 +471,8 @@ namespace ICSharpCode.SharpDevelop.Gui { AxSideTabItem item = sideTabItemFactory.CreateSideTabItem(name, imageIndex); item.Tag = content; - return Add(item); + Add(item); + return item; } public virtual void Clear() @@ -485,7 +485,12 @@ namespace ICSharpCode.SharpDevelop.Gui return list.Contains(item); } - public IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() + { + return list.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return list.GetEnumerator(); } @@ -497,7 +502,7 @@ namespace ICSharpCode.SharpDevelop.Gui public void CopyTo(Array dest, int index) { - list.CopyTo(dest, index); + list.CopyTo((AxSideTabItem[])dest, index); } public virtual AxSideTabItem Insert(int index, AxSideTabItem item) @@ -518,10 +523,11 @@ namespace ICSharpCode.SharpDevelop.Gui return Insert(index, item); } - public virtual void Remove(AxSideTabItem item) + public virtual bool Remove(AxSideTabItem item) { - list.Remove(item); + bool r = list.Remove(item); OnItemRemoved(item); + return r; } public virtual void RemoveAt(int index) @@ -540,6 +546,17 @@ namespace ICSharpCode.SharpDevelop.Gui ItemRemoved(this, new SideTabItemEventArgs(item)); } } + + public bool IsReadOnly { + get { + return false; + } + } + + public void CopyTo(AxSideTabItem[] array, int arrayIndex) + { + throw new NotImplementedException(); + } } } } diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs index f217a8d5d5..a362e8dbcc 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs @@ -7,7 +7,7 @@ using System; using System.IO; -using System.Collections; +using System.Collections.Generic; using System.Windows.Forms; using ICSharpCode.SharpDevelop.Internal.ExternalTool; @@ -146,7 +146,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels public override bool StorePanelContents() { - ArrayList newlist = new ArrayList(); + List newlist = new List(); foreach (ExternalTool tool in ((ListBox)ControlDictionary["toolListBox"]).Items) { if (!FileUtility.IsValidFileName(tool.Command)) { MessageService.ShowError(String.Format("The command of tool \"{0}\" is invalid.", tool.MenuCommand)); diff --git a/src/Main/Base/Project/Src/Internal/ExternalTool/ToolLoader.cs b/src/Main/Base/Project/Src/Internal/ExternalTool/ToolLoader.cs index 0570cfa679..cac8531eae 100644 --- a/src/Main/Base/Project/Src/Internal/ExternalTool/ToolLoader.cs +++ b/src/Main/Base/Project/Src/Internal/ExternalTool/ToolLoader.cs @@ -7,7 +7,7 @@ using System; using System.IO; -using System.Collections; +using System.Collections.Generic; using System.Diagnostics; using System.Xml; @@ -23,15 +23,16 @@ namespace ICSharpCode.SharpDevelop.Internal.ExternalTool static string TOOLFILE = "SharpDevelop-tools.xml"; static string TOOLFILEVERSION = "1"; - static ArrayList tool = new ArrayList(); + static List tool = new List(); - public static ArrayList Tool { + public static List Tool + { get { return tool; } set { tool = value; - System.Diagnostics.Debug.Assert(tool != null, "SharpDevelop.Tool.Data.ToolLoader : set ArrayList Tool (value == null)"); + System.Diagnostics.Debug.Assert(tool != null, "SharpDevelop.Tool.Data.ToolLoader : set List Tool (value == null)"); } } @@ -42,18 +43,23 @@ namespace ICSharpCode.SharpDevelop.Internal.ExternalTool } XmlDocument doc = new XmlDocument(); - try { + try + { doc.Load(filename); if (doc.DocumentElement.Attributes["VERSION"].InnerText != TOOLFILEVERSION) return false; - tool = new ArrayList(); + tool = new List(); XmlNodeList nodes = doc.DocumentElement.ChildNodes; foreach (XmlElement el in nodes) + { tool.Add(new ExternalTool(el)); - } catch (Exception) { + } + } + catch (Exception) + { return false; } return true; diff --git a/src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs b/src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs index 2d7a624433..94c47fee93 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs @@ -136,7 +136,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates /// public class FileTemplate : IComparable { - public static ArrayList FileTemplates = new ArrayList(); + public static List FileTemplates = new List(); string author = null; string name = null; @@ -150,10 +150,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates bool newFileDialogVisible = true; - ArrayList files = new ArrayList(); // contains FileDescriptionTemplate classes - ArrayList properties = new ArrayList(); - ArrayList scripts = new ArrayList(); - ArrayList customTypes = new ArrayList(); + List files = new List(); + List properties = new List(); + List scripts = new List(); + List customTypes = new List(); XmlElement fileoptions = null; @@ -222,19 +222,19 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates } } - public ArrayList FileDescriptionTemplates { + public List FileDescriptionTemplates { get { return files; } } - public ArrayList Properties { + public List Properties { get { return properties; } } - public ArrayList CustomTypes { + public List CustomTypes { get { return customTypes; } @@ -246,7 +246,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates } } - public ArrayList Scripts { + public List Scripts { get { return scripts; } diff --git a/src/Main/Base/Project/Src/Internal/Templates/TextTemplate.cs b/src/Main/Base/Project/Src/Internal/Templates/TextTemplate.cs index 566529035c..10c03644d3 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/TextTemplate.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/TextTemplate.cs @@ -8,7 +8,6 @@ using System; using System.IO; using System.Xml; -using System.Collections; using System.Collections.Generic; using System.Diagnostics; @@ -23,10 +22,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates /// public class TextTemplate { - public static ArrayList TextTemplates = new ArrayList(); + public static List TextTemplates = new List(); - string name = null; - ArrayList entries = new ArrayList(); + string name = null; + List entries = new List(); public string Name { get { @@ -34,7 +33,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates } } - public ArrayList Entries { + public List Entries { get { return entries; } diff --git a/src/Main/Base/Project/Src/Internal/Undo/UndoQueue.cs b/src/Main/Base/Project/Src/Internal/Undo/UndoQueue.cs index cb15d4759a..81cb9b6571 100644 --- a/src/Main/Base/Project/Src/Internal/Undo/UndoQueue.cs +++ b/src/Main/Base/Project/Src/Internal/Undo/UndoQueue.cs @@ -7,7 +7,7 @@ using System; using System.Diagnostics; -using System.Collections; +using System.Collections.Generic; namespace ICSharpCode.SharpDevelop.Internal.Undo { @@ -17,7 +17,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Undo /// public class UndoQueue : IUndoableOperation { - ArrayList undolist = new ArrayList(); + List undolist = new List(); public UndoQueue(UndoStack stack, int numops) { @@ -37,7 +37,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Undo public void Undo() { for (int i = 0; i < undolist.Count; ++i) { - ((IUndoableOperation)undolist[i]).Undo(); + undolist[i].Undo(); } } diff --git a/src/Main/Base/Project/Src/Internal/Undo/UndoStack.cs b/src/Main/Base/Project/Src/Internal/Undo/UndoStack.cs index 1a9571ef88..6ea50fd5a2 100644 --- a/src/Main/Base/Project/Src/Internal/Undo/UndoStack.cs +++ b/src/Main/Base/Project/Src/Internal/Undo/UndoStack.cs @@ -7,7 +7,7 @@ using System; using System.Diagnostics; -using System.Collections; +using System.Collections.Generic; namespace ICSharpCode.SharpDevelop.Internal.Undo { @@ -16,8 +16,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Undo /// public class UndoStack { - Stack undostack = new Stack(); - Stack redostack = new Stack(); + Stack undostack = new Stack(); + Stack redostack = new Stack(); public event EventHandler ActionUndone; public event EventHandler ActionRedone; @@ -27,7 +27,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Undo /// /// This property is EXCLUSIVELY for the UndoQueue class, don't USE it /// - internal Stack _UndoStack { + internal Stack _UndoStack { get { return undostack; } diff --git a/src/Main/Base/Project/Src/Services/AmbienceService/AbstractAmbience.cs b/src/Main/Base/Project/Src/Services/AmbienceService/AbstractAmbience.cs index 8178fa8393..861233ddae 100644 --- a/src/Main/Base/Project/Src/Services/AmbienceService/AbstractAmbience.cs +++ b/src/Main/Base/Project/Src/Services/AmbienceService/AbstractAmbience.cs @@ -66,12 +66,6 @@ namespace ICSharpCode.Core } } - public bool UseLinkArrayList { - get { - return (conversionFlags & ConversionFlags.UseLinkArrayList) == ConversionFlags.UseLinkArrayList; - } - } - public bool UseFullyQualifiedMemberNames { get { return UseFullyQualifiedNames && !((conversionFlags & ConversionFlags.QualifiedNamesOnlyForReturnTypes) == ConversionFlags.QualifiedNamesOnlyForReturnTypes); diff --git a/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceReflectionDecorator.cs b/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceReflectionDecorator.cs index 827e9b6724..a1b518a9b1 100644 --- a/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceReflectionDecorator.cs +++ b/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceReflectionDecorator.cs @@ -88,47 +88,6 @@ namespace ICSharpCode.Core this.conv = conv; } - /* - public string Convert(Type type) - { - return conv.Convert(new ReflectionClass(null, type, type.FullName.Replace('+', '.'), null)); - } - - public string Convert(FieldInfo field) - { - return conv.Convert(new ReflectionField(field, null)); - } - - public string Convert(PropertyInfo property) - { - return conv.Convert(new ReflectionProperty(property, null)); - } - - public string Convert(EventInfo e) - { - return conv.Convert(new ReflectionEvent(e, null)); - } - - public string Convert(MethodBase m) - { - return conv.Convert(new ReflectionMethod(m, null)); - } - - public string Convert(ParameterInfo param) - { - return conv.Convert(new ReflectionParameter(param, null)); - } - */ - - public ArrayList LinkArrayList { - get { - return conv.LinkArrayList; - } - set { - conv.LinkArrayList = value; - } - } - public string WrapAttribute(string attribute) { return conv.WrapAttribute(attribute); diff --git a/src/Main/Base/Project/Src/Services/AmbienceService/IAmbience.cs b/src/Main/Base/Project/Src/Services/AmbienceService/IAmbience.cs index e783d549bf..f3d1c72650 100644 --- a/src/Main/Base/Project/Src/Services/AmbienceService/IAmbience.cs +++ b/src/Main/Base/Project/Src/Services/AmbienceService/IAmbience.cs @@ -21,7 +21,6 @@ namespace ICSharpCode.Core ShowModifiers = 4, ShowInheritanceList = 8, IncludeHTMLMarkup = 32, - UseLinkArrayList = 64, QualifiedNamesOnlyForReturnTypes = 128, IncludeBodies = 256, ShowReturnType = 512, @@ -37,13 +36,6 @@ namespace ICSharpCode.Core ShowModifiers | ShowReturnType | ShowInheritanceList, - - AssemblyScoutDefaults = StandardConversionFlags | - ShowAccessibility | - QualifiedNamesOnlyForReturnTypes | - IncludeHTMLMarkup | - ShowReturnType| - UseLinkArrayList, } public interface IAmbience @@ -72,7 +64,5 @@ namespace ICSharpCode.Core string WrapComment(string comment); string GetIntrinsicTypeName(string dotNetTypeName); - - ArrayList LinkArrayList { get; set; } } } diff --git a/src/Main/Base/Project/Src/Services/AmbienceService/NetAmbience.cs b/src/Main/Base/Project/Src/Services/AmbienceService/NetAmbience.cs index 38be8c393b..ff531269ab 100644 --- a/src/Main/Base/Project/Src/Services/AmbienceService/NetAmbience.cs +++ b/src/Main/Base/Project/Src/Services/AmbienceService/NetAmbience.cs @@ -232,19 +232,6 @@ namespace ICSharpCode.Core } StringBuilder builder = new StringBuilder(); - bool linkSet = false; - - if (UseLinkArrayList) { -// TODO: Find some replacement for OLD SharpAssembly dependency: -// SharpAssemblyReturnType ret = returnType as SharpAssemblyReturnType; -// if (ret != null) { -// if (ret.UnderlyingClass != null) { -// builder.Append(""); -// linkSet = true; -// } -// } - } - string name = returnType.DotNetName; if (UseFullyQualifiedNames) { builder.Append(name); @@ -253,10 +240,6 @@ namespace ICSharpCode.Core builder.Append(name, pos, name.Length - pos); } - if (linkSet) { - builder.Append(""); - } - return builder.ToString(); } diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs index 96223161d5..f6b918f501 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs @@ -241,10 +241,6 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver } foreach (AST.Attribute attribute in section.Attributes) { - //IAttribute a = new DefaultAttribute(attribute.Name, target, new ArrayList(attribute.PositionalArguments), new SortedList()); - //foreach (AST.NamedArgumentExpression n in attribute.NamedArguments) { - // a.NamedArguments[n.Name] = n.Expression; - //} result.Add(new DefaultAttribute(attribute.Name, target)); } } diff --git a/src/SharpDevelop.sln b/src/SharpDevelop.sln index 568a25b586..12fce9ca9d 100644 --- a/src/SharpDevelop.sln +++ b/src/SharpDevelop.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# SharpDevelop 2.1.0.1900 +# SharpDevelop 2.1.0.1913 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}" ProjectSection(SolutionItems) = postProject EndProjectSection @@ -40,8 +40,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Backends", "Backends", "{FE EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WixBinding", "AddIns\BackendBindings\WixBinding\Project\WixBinding.csproj", "{e1b288a2-08ee-4318-8bbb-8ab72c69e33e}" EndProject -Project("{A33008B1-5DAC-44D5-9060-242E3B6E38F2}") = "Boo.InterpreterAddIn", "AddIns\BackendBindings\Boo\Boo.InterpreterAddIn\Project\Boo.InterpreterAddIn.booproj", "{928E34B2-5E46-4A4D-8E4D-2CA2CCDB905A}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactoryToBooConverter", "AddIns\BackendBindings\Boo\NRefactoryToBooConverter\Project\NRefactoryToBooConverter.csproj", "{DBCF20A1-BA13-4582-BFA9-74DE4D987B73}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BooBinding", "AddIns\BackendBindings\Boo\BooBinding\Project\BooBinding.csproj", "{4AC2D5F1-F671-480C-A075-6BF62B3721B2}" @@ -104,8 +102,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debugger", "Debugger", "{66 ProjectSection(SolutionItems) = postProject EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger.BooInterpreter", "AddIns\Misc\Debugger\Debugger.BooInterpreter\Project\Debugger.BooInterpreter.csproj", "{B45B39B9-620C-4F84-A555-1833790517AB}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger.AddIn", "AddIns\Misc\Debugger\Debugger.AddIn\Project\Debugger.AddIn.csproj", "{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger.Core", "AddIns\Misc\Debugger\Debugger.Core\Project\Debugger.Core.csproj", "{1D18D788-F7EE-4585-A23B-34DC8EC63CB8}" @@ -421,7 +417,6 @@ Global {6e59af58-f635-459a-9a35-c9ac41c00339} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} {4AC2D5F1-F671-480C-A075-6BF62B3721B2} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} {DBCF20A1-BA13-4582-BFA9-74DE4D987B73} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} - {928E34B2-5E46-4A4D-8E4D-2CA2CCDB905A} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} {e1b288a2-08ee-4318-8bbb-8ab72c69e33e} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} {4B8F0F98-8BE1-402B-AA8B-C8D548577B38} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} {7D5C266F-D6FF-4D14-B315-0C0FC6C4EF51} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} @@ -452,7 +447,6 @@ Global {B08385CD-F0CC-488C-B4F4-EEB34B6D2688} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D} {1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D} {EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D} - {B45B39B9-620C-4F84-A555-1833790517AB} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D} {3A9AE6AA-BC07-4A2F-972C-581E3AE2F195} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}