From b28abccc2ff36bda7304fb29a516cfa03da7ac51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Mon, 18 May 2020 21:49:51 +0200 Subject: [PATCH] Remove unecessary using declarations. --- src/base_script.cpp | 2 ++ src/base_script.h | 10 ---------- src/csharp_interface.cpp | 12 ++---------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/base_script.cpp b/src/base_script.cpp index 42e46cb..2907935 100644 --- a/src/base_script.cpp +++ b/src/base_script.cpp @@ -101,6 +101,8 @@ namespace CSharp { namespace CSharp { + using namespace System::IO; + bool isFomodEntry(std::shared_ptr entry) { return entry->pathFrom(g.SourceTree).compare("fomod", Qt::CaseInsensitive) == 0; } diff --git a/src/base_script.h b/src/base_script.h index c1d2f29..2f3dc15 100644 --- a/src/base_script.h +++ b/src/base_script.h @@ -20,7 +20,6 @@ along with Mod Organizer. If not, see . #using #using -#using #using /** @@ -30,17 +29,8 @@ along with Mod Organizer. If not, see . namespace CSharp { using namespace System; - using namespace System::CodeDom; - using namespace System::CodeDom::Compiler; - using namespace System::Collections; - using namespace System::ComponentModel; - using namespace System::Diagnostics; using namespace System::Drawing; - using namespace System::IO; using namespace System::Windows::Forms; - using namespace Microsoft::CSharp; - using namespace Microsoft::VisualBasic; - using namespace System::Security::Permissions; /// /// Describes the options to display in a select form. diff --git a/src/csharp_interface.cpp b/src/csharp_interface.cpp index 8465cb1..8d9d82c 100644 --- a/src/csharp_interface.cpp +++ b/src/csharp_interface.cpp @@ -9,8 +9,6 @@ #include "csharp_utils.h" #include "base_script.h" -#using -#using #using using namespace MOBase; @@ -44,12 +42,6 @@ IPluginInstaller::EInstallResult executeScript(System::String^ script) { using namespace System::CodeDom; using namespace System::CodeDom::Compiler; using namespace System::Collections::Generic; - using namespace System::Collections; - using namespace System::Diagnostics; - using namespace System::Drawing; - using namespace System::IO; - using namespace System::Windows::Forms; - using namespace Microsoft::CSharp; AppDomain^ currentDomain = AppDomain::CurrentDomain; currentDomain->AssemblyResolve += gcnew ResolveEventHandler(currentDomain_AssemblyResolve); @@ -79,8 +71,8 @@ IPluginInstaller::EInstallResult executeScript(System::String^ script) { auto result = provider->CompileAssemblyFromSource(cp, script); int errorCount = 0; - for (int i = 0; i < result->Errors->Count; ++i) { - CompilerError^ error = result->Errors[i]; + CompilerErrorCollection^ errors = result->Errors; + for each (CompilerError^ error in result->Errors) { if (error->IsWarning) { log::error("C# [{}]: {}", error->Line, CSharp::to_string(error->ErrorText)); }