From a52a71d4080a905b5c4c303642c26dc6f3b89add Mon Sep 17 00:00:00 2001 From: Serhii Yolkin Date: Sun, 15 Jul 2018 23:16:02 +0200 Subject: [PATCH] Initial commit --- .gitignore | 252 ++++++++++++++++++ AssemblyNamespaceChanger.sln | 31 +++ AssemblyNamespaceChanger/App.config | 6 + .../AssemblyNamespaceChanger.cs | 112 ++++++++ .../AssemblyNamespaceChanger.csproj | 104 ++++++++ .../CommandLineOptions.cs | 32 +++ AssemblyNamespaceChanger/Program.cs | 43 +++ .../Properties/AssemblyInfo.cs | 36 +++ .../Resources/Resources.Designer.cs | 89 +++++++ .../Resources/Resources.resx | 124 +++++++++ .../Resources/log4netConfiguration.xml | 33 +++ AssemblyNamespaceChanger/packages.config | 7 + TestAssembly/Classes.cs | 17 ++ TestAssembly/Properties/AssemblyInfo.cs | 36 +++ TestAssembly/TestAssembly.csproj | 47 ++++ 15 files changed, 969 insertions(+) create mode 100644 .gitignore create mode 100644 AssemblyNamespaceChanger.sln create mode 100644 AssemblyNamespaceChanger/App.config create mode 100644 AssemblyNamespaceChanger/AssemblyNamespaceChanger.cs create mode 100644 AssemblyNamespaceChanger/AssemblyNamespaceChanger.csproj create mode 100644 AssemblyNamespaceChanger/CommandLineOptions.cs create mode 100644 AssemblyNamespaceChanger/Program.cs create mode 100644 AssemblyNamespaceChanger/Properties/AssemblyInfo.cs create mode 100644 AssemblyNamespaceChanger/Resources/Resources.Designer.cs create mode 100644 AssemblyNamespaceChanger/Resources/Resources.resx create mode 100644 AssemblyNamespaceChanger/Resources/log4netConfiguration.xml create mode 100644 AssemblyNamespaceChanger/packages.config create mode 100644 TestAssembly/Classes.cs create mode 100644 TestAssembly/Properties/AssemblyInfo.cs create mode 100644 TestAssembly/TestAssembly.csproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f1e3d20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,252 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml diff --git a/AssemblyNamespaceChanger.sln b/AssemblyNamespaceChanger.sln new file mode 100644 index 0000000..fe3930d --- /dev/null +++ b/AssemblyNamespaceChanger.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2042 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyNamespaceChanger", "AssemblyNamespaceChanger\AssemblyNamespaceChanger.csproj", "{650510B7-E7BB-4C9B-B3FE-A3C29B274985}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestAssembly", "TestAssembly\TestAssembly.csproj", "{AB3BD777-9EBA-4D24-AF45-C6865D3459D0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {650510B7-E7BB-4C9B-B3FE-A3C29B274985}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {650510B7-E7BB-4C9B-B3FE-A3C29B274985}.Debug|Any CPU.Build.0 = Debug|Any CPU + {650510B7-E7BB-4C9B-B3FE-A3C29B274985}.Release|Any CPU.ActiveCfg = Release|Any CPU + {650510B7-E7BB-4C9B-B3FE-A3C29B274985}.Release|Any CPU.Build.0 = Release|Any CPU + {AB3BD777-9EBA-4D24-AF45-C6865D3459D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AB3BD777-9EBA-4D24-AF45-C6865D3459D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AB3BD777-9EBA-4D24-AF45-C6865D3459D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AB3BD777-9EBA-4D24-AF45-C6865D3459D0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FF7B0BDC-7911-426C-B3CC-4AF72FDEA6CB} + EndGlobalSection +EndGlobal diff --git a/AssemblyNamespaceChanger/App.config b/AssemblyNamespaceChanger/App.config new file mode 100644 index 0000000..8fc0551 --- /dev/null +++ b/AssemblyNamespaceChanger/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/AssemblyNamespaceChanger/AssemblyNamespaceChanger.cs b/AssemblyNamespaceChanger/AssemblyNamespaceChanger.cs new file mode 100644 index 0000000..fd416f8 --- /dev/null +++ b/AssemblyNamespaceChanger/AssemblyNamespaceChanger.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text.RegularExpressions; +using CommandLine; +using CommandLine.Text; +using log4net; +using Mono.Cecil; + +namespace LostPolygon.AssemblyNamespaceChanger { + class AssemblyNamespaceChanger { + private static readonly ILog Log = LogManager.GetLogger("AssemblyNamespaceChanger"); + + private readonly string[] _args; + private CommandLineOptions _commandLineOptions; + private ParserResult _commandLineParserResult; + + public static void Run(string[] args) { + AssemblyNamespaceChanger instance = new AssemblyNamespaceChanger(args); + instance.Run(); + } + + public AssemblyNamespaceChanger(string[] args) { + _args = args; + } + + private void Run() { + Parser commandLineParser = + new Parser(settings => { + settings.IgnoreUnknownArguments = false; + settings.CaseSensitive = false; + settings.HelpWriter = null; + }); + + _commandLineParserResult = commandLineParser.ParseArguments(_args); + _commandLineParserResult + .WithParsed(options => { + _commandLineOptions = options; + ExecuteOperation(); + }) + .WithNotParsed(errors => { + Console.WriteLine(GetHelpText()); + Environment.ExitCode = 1; + }); + } + + private void ExecuteOperation() { + List<(Regex pattern, string replacement)> replacementPatterns = new List<(Regex pattern, string replacement)>(); + + string[] regexpOptions = _commandLineOptions.Regexps.ToArray(); + for (int i = 0; i < regexpOptions.Length; i += 2) { + string regexpOption = regexpOptions[i]; + string regexpReplacementOption = regexpOptions[i + 1]; + + Regex regex = new Regex(regexpOption, RegexOptions.Singleline); + replacementPatterns.Add((regex, regexpReplacementOption)); + } + + Log.Info($"Reading assembly from {_commandLineOptions.InputAssemblyPath}"); + AssemblyDefinition assembly = Mono.Cecil.AssemblyDefinition.ReadAssembly(_commandLineOptions.InputAssemblyPath); + TypeDefinition[] types = assembly.MainModule.GetTypes().ToArray(); + int modifiedTypes = 0; + foreach (TypeDefinition type in types) { + string originalNamespace = type.Namespace; + foreach ((Regex pattern, string replacement) replacementPattern in replacementPatterns) { + type.Namespace = + replacementPattern.pattern.Replace(type.Namespace, replacementPattern.replacement); + } + + if (originalNamespace != type.Namespace) { + modifiedTypes++; + } + } + + Log.Info($"Modified {modifiedTypes} type(s)"); + + string outputPath; + if (!String.IsNullOrWhiteSpace(_commandLineOptions.OutputAssemblyPath)) { + outputPath = _commandLineOptions.OutputAssemblyPath; + } else { + outputPath = + Path.Combine( + Path.GetDirectoryName(_commandLineOptions.InputAssemblyPath) ?? "", + Path.GetFileNameWithoutExtension(_commandLineOptions.InputAssemblyPath) + + ".Modified" + + Path.GetExtension(_commandLineOptions.InputAssemblyPath) + ); + } + + Log.Info($"Writing assembly to {outputPath}"); + assembly.Write(outputPath); + } + + private HelpText GetHelpText() { + Assembly assembly = Assembly.GetExecutingAssembly(); + + string assemblyConfiguration = assembly.GetCustomAttribute()?.Configuration; + string assemblyVersion = assembly.GetCustomAttribute()?.InformationalVersion; + + HelpText helpText = + _commandLineParserResult.Tag == ParserResultType.NotParsed ? HelpText.AutoBuild(_commandLineParserResult) : HelpText.AutoBuild(_commandLineParserResult, text => text, example => example); + helpText.AddEnumValuesToHelpText = true; + helpText.AddDashesToOption = true; + helpText.Heading = + $"{assembly.GetName().Name} v{assemblyVersion} ({assemblyConfiguration}"; + helpText.Copyright = "© Lost Polygon"; + return helpText; + } + } +} diff --git a/AssemblyNamespaceChanger/AssemblyNamespaceChanger.csproj b/AssemblyNamespaceChanger/AssemblyNamespaceChanger.csproj new file mode 100644 index 0000000..03bd8df --- /dev/null +++ b/AssemblyNamespaceChanger/AssemblyNamespaceChanger.csproj @@ -0,0 +1,104 @@ + + + + + + Debug + AnyCPU + {650510B7-E7BB-4C9B-B3FE-A3C29B274985} + Exe + LostPolygon.AssemblyNamespaceChanger + LostPolygon.AssemblyNamespaceChanger + v4.7.1 + 512 + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\CommandLineParser.2.2.1\lib\net45\CommandLine.dll + + + ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll + + + ..\packages\Mono.Cecil.0.10.0\lib\net40\Mono.Cecil.dll + + + ..\packages\Mono.Cecil.0.10.0\lib\net40\Mono.Cecil.Mdb.dll + + + ..\packages\Mono.Cecil.0.10.0\lib\net40\Mono.Cecil.Pdb.dll + + + ..\packages\Mono.Cecil.0.10.0\lib\net40\Mono.Cecil.Rocks.dll + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + "%UserProfile%\.nuget\packages\ILRepack\2.0.15\tools\ilrepack" /out:LostPolygon.AssemblyNamespaceChanger.Packed.exe LostPolygon.AssemblyNamespaceChanger.exe CommandLine.dll log4net.dll Mono.Cecil.dll Mono.Cecil.Mdb.dll Mono.Cecil.Pdb.dll Mono.Cecil.Rocks.dll /internalize + + + mono "~/.nuget/packages/ILRepack/2.0.15/tools/ILRepack.exe" /out:LostPolygon.AssemblyNamespaceChanger.Packed.exe LostPolygon.AssemblyNamespaceChanger.exe CommandLine.dll log4net.dll Mono.Cecil.dll Mono.Cecil.Mdb.dll Mono.Cecil.Pdb.dll Mono.Cecil.Rocks.dll /internalize + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/AssemblyNamespaceChanger/CommandLineOptions.cs b/AssemblyNamespaceChanger/CommandLineOptions.cs new file mode 100644 index 0000000..c20b512 --- /dev/null +++ b/AssemblyNamespaceChanger/CommandLineOptions.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using CommandLine; +using CommandLine.Text; + +namespace LostPolygon.AssemblyNamespaceChanger +{ + class CommandLineOptions + { + [Option('i', "input", Required = true, HelpText = "Input assembly path.")] + public string InputAssemblyPath { get; set; } + + [Option('o', "output", HelpText = "Output assembly path. If not specified, '.Modified' will be added to the input assembly name.")] + public string OutputAssemblyPath { get; set; } + + [Option('r', "regexps", Separator=':', Required = true, + HelpText = "Array of regexp search and replace patterns. " + + "First consequential one is the search pattern, " + + "second is the replacement pattern. Separated by semicolon (:)")] + public IEnumerable Regexps { get; set; } + + [Usage(ApplicationAlias = "LostPolygon.AssemblyNamespaceChanger")] + public static IEnumerable Examples { + get { + yield return new Example("Normal scenario", new CommandLineOptions { + InputAssemblyPath = "InputAssembly.dll", + OutputAssemblyPath = "Output/OutputAssembly.dll", + Regexps = new []{ "^Foo:Bar.Foo:^Namespace1.Test:Namespace2:Whatever" } + }); + } + } + } +} diff --git a/AssemblyNamespaceChanger/Program.cs b/AssemblyNamespaceChanger/Program.cs new file mode 100644 index 0000000..d57e9c5 --- /dev/null +++ b/AssemblyNamespaceChanger/Program.cs @@ -0,0 +1,43 @@ +using System; +using System.Diagnostics; +using System.Globalization; +using System.Text; +using System.Threading; +using System.Xml; +using log4net; +using log4net.Config; + +namespace LostPolygon.AssemblyNamespaceChanger +{ + internal class Program { + private static readonly ILog Log = LogManager.GetLogger("AssemblyNamespaceChanger"); + + public static void Main(params string[] args) { + Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; + Console.OutputEncoding = Encoding.Unicode; + if (!Debugger.IsAttached) { + AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper; + } + + SetupLog4Net(); + AssemblyNamespaceChanger.Run(args); + } + + private static void UnhandledExceptionTrapper(object sender, UnhandledExceptionEventArgs e) { + Log.Fatal( + "Fatal error:" + Environment.NewLine + + ((Exception) e.ExceptionObject) + Environment.NewLine + + ((Exception) e.ExceptionObject).InnerException + ); + Environment.Exit(1); + } + + private static void SetupLog4Net() { + XmlDocument objDocument = new XmlDocument(); + objDocument.LoadXml(Resources.Resources.log4netConfiguration); + XmlElement objElement = objDocument.DocumentElement; + + XmlConfigurator.Configure(objElement); + } + } +} diff --git a/AssemblyNamespaceChanger/Properties/AssemblyInfo.cs b/AssemblyNamespaceChanger/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d5fe964 --- /dev/null +++ b/AssemblyNamespaceChanger/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AssemblyNamespaceChanger")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AssemblyNamespaceChanger")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("650510b7-e7bb-4c9b-b3fe-a3c29b274985")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AssemblyNamespaceChanger/Resources/Resources.Designer.cs b/AssemblyNamespaceChanger/Resources/Resources.Designer.cs new file mode 100644 index 0000000..15932ad --- /dev/null +++ b/AssemblyNamespaceChanger/Resources/Resources.Designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace LostPolygon.AssemblyNamespaceChanger.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LostPolygon.AssemblyNamespaceChanger.Resources.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> + ///<log4net> + /// <appender name="ColoredConsoleAppender" type="log4net.Appender.ManagedColoredConsoleAppender"> + /// <mapping> + /// <level value="DEBUG" /> + /// <forecolor value="Magenta" /> + /// </mapping> + /// <mapping> + /// <level value="INFO" /> + /// <forecolor value="Cyan" /> + /// </mapping> + /// <mapping> + /// <level value="WARN" /> + /// <forecolor value="Yellow" /> + /// </mapping> + /// <mapping> + /// <level value="ERROR" /> + /// <forecolor value="D [rest of string was truncated]";. + /// + internal static string log4netConfiguration { + get { + return ResourceManager.GetString("log4netConfiguration", resourceCulture); + } + } + } +} diff --git a/AssemblyNamespaceChanger/Resources/Resources.resx b/AssemblyNamespaceChanger/Resources/Resources.resx new file mode 100644 index 0000000..cd1765e --- /dev/null +++ b/AssemblyNamespaceChanger/Resources/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + log4netConfiguration.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + \ No newline at end of file diff --git a/AssemblyNamespaceChanger/Resources/log4netConfiguration.xml b/AssemblyNamespaceChanger/Resources/log4netConfiguration.xml new file mode 100644 index 0000000..24d1fdc --- /dev/null +++ b/AssemblyNamespaceChanger/Resources/log4netConfiguration.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AssemblyNamespaceChanger/packages.config b/AssemblyNamespaceChanger/packages.config new file mode 100644 index 0000000..8fafa88 --- /dev/null +++ b/AssemblyNamespaceChanger/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TestAssembly/Classes.cs b/TestAssembly/Classes.cs new file mode 100644 index 0000000..b74610c --- /dev/null +++ b/TestAssembly/Classes.cs @@ -0,0 +1,17 @@ +namespace Nice +{ + public class Foo + { + public class NestedBar { + + } + } +} + +namespace Neat { + namespace Cool { + public struct Awesome { + + } + } +} \ No newline at end of file diff --git a/TestAssembly/Properties/AssemblyInfo.cs b/TestAssembly/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..24aedbf --- /dev/null +++ b/TestAssembly/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TestAssembly")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TestAssembly")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ab3bd777-9eba-4d24-af45-c6865d3459d0")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/TestAssembly/TestAssembly.csproj b/TestAssembly/TestAssembly.csproj new file mode 100644 index 0000000..ad380c6 --- /dev/null +++ b/TestAssembly/TestAssembly.csproj @@ -0,0 +1,47 @@ + + + + + Debug + AnyCPU + {AB3BD777-9EBA-4D24-AF45-C6865D3459D0} + Library + Properties + TestAssembly + TestAssembly + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + \ No newline at end of file