mrrage / StripRegions

Removes all #region/#endregion from C# code.

Clone this repository (size: 16.7 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/mrrage/stripregions/
commit 0: 4034661dbda5
branch: default
tags: tip
Added code files.
Christopher Cowan / mrrage
13 months ago

Changed (Δ41.6 KB):

raw changeset »

StripRegions.sln (20 lines added, 0 lines removed)

StripRegions/Program.cs (46 lines added, 0 lines removed)

StripRegions/Properties/AssemblyInfo.cs (36 lines added, 0 lines removed)

StripRegions/StripRegions.csproj (85 lines added, 0 lines removed)

StripRegions/license.txt (674 lines added, 0 lines removed)

Up to file-list StripRegions.sln:

1

2
Microsoft Visual Studio Solution File, Format Version 10.00
3
# Visual Studio 2008
4
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StripRegions", "StripRegions\StripRegions.csproj", "{1537645E-7519-4F2E-960C-61F239786A02}"
5
EndProject
6
Global
7
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
8
		Debug|Any CPU = Debug|Any CPU
9
		Release|Any CPU = Release|Any CPU
10
	EndGlobalSection
11
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
12
		{1537645E-7519-4F2E-960C-61F239786A02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13
		{1537645E-7519-4F2E-960C-61F239786A02}.Debug|Any CPU.Build.0 = Debug|Any CPU
14
		{1537645E-7519-4F2E-960C-61F239786A02}.Release|Any CPU.ActiveCfg = Release|Any CPU
15
		{1537645E-7519-4F2E-960C-61F239786A02}.Release|Any CPU.Build.0 = Release|Any CPU
16
	EndGlobalSection
17
	GlobalSection(SolutionProperties) = preSolution
18
		HideSolutionNode = FALSE
19
	EndGlobalSection
20
EndGlobal

Up to file-list StripRegions/Program.cs:

1
//
2
// StripRegions - Removes all #regions from C# code.
3
//
4
// Copyright (C) 2009  Christopher Cowan
5
//
6
// This program is free software: you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation, either version 3 of the License, or
9
// (at your option) any later version.
10
//
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
// GNU General Public License for more details.
15
//
16
// You should have received a copy of the GNU General Public License
17
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
//
19
using System;
20
using System.IO;
21
using System.Text.RegularExpressions;
22
23
namespace StripRegions
24
{
25
  class Program
26
  {
27
    static void Main(string[] args)
28
    {
29
      var regex = new Regex(@"[ ]*(#region.*|#endregion.*)\r\n");
30
31
      foreach (string path in args)
32
      {
33
        if (!File.Exists(path))
34
        {
35
          Console.WriteLine("'{0}' does not exits. Skipping.", path);
36
          continue;
37
        }
38
39
        Console.WriteLine("Processing " + path);
40
        string contents = File.ReadAllText(path);
41
        contents = regex.Replace(contents, "");
42
        File.WriteAllText(path, contents);
43
      }
44
    }
45
  }
46
}

Up to file-list StripRegions/Properties/AssemblyInfo.cs:

1
using System.Reflection;
2
using System.Runtime.CompilerServices;
3
using System.Runtime.InteropServices;
4
5
// General Information about an assembly is controlled through the following 
6
// set of attributes. Change these attribute values to modify the information
7
// associated with an assembly.
8
[assembly: AssemblyTitle("StripRegions")]
9
[assembly: AssemblyDescription("")]
10
[assembly: AssemblyConfiguration("")]
11
[assembly: AssemblyCompany("")]
12
[assembly: AssemblyProduct("StripRegions")]
13
[assembly: AssemblyCopyright("Copyright © 2009 Christopher Cowan")]
14
[assembly: AssemblyTrademark("")]
15
[assembly: AssemblyCulture("")]
16
17
// Setting ComVisible to false makes the types in this assembly not visible 
18
// to COM components.  If you need to access a type in this assembly from 
19
// COM, set the ComVisible attribute to true on that type.
20
[assembly: ComVisible(false)]
21
22
// The following GUID is for the ID of the typelib if this project is exposed to COM
23
[assembly: Guid("9026974e-4373-4e04-a939-e1cdd0a5ec8d")]
24
25
// Version information for an assembly consists of the following four values:
26
//
27
//      Major Version
28
//      Minor Version 
29
//      Build Number
30
//      Revision
31
//
32
// You can specify all the values or you can default the Build and Revision Numbers 
33
// by using the '*' as shown below:
34
// [assembly: AssemblyVersion("1.0.*")]
35
[assembly: AssemblyVersion("1.0.0.0")]
36
[assembly: AssemblyFileVersion("1.0.0.0")]

Up to file-list StripRegions/StripRegions.csproj:

1
<?xml version="1.0" encoding="utf-8"?>
2
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
  <PropertyGroup>
4
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6
    <ProductVersion>9.0.21022</ProductVersion>
7
    <SchemaVersion>2.0</SchemaVersion>
8
    <ProjectGuid>{1537645E-7519-4F2E-960C-61F239786A02}</ProjectGuid>
9
    <OutputType>Exe</OutputType>
10
    <AppDesignerFolder>Properties</AppDesignerFolder>
11
    <RootNamespace>StripRegions</RootNamespace>
12
    <AssemblyName>StripRegions</AssemblyName>
13
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14
    <FileAlignment>512</FileAlignment>
15
    <PublishUrl>publish\</PublishUrl>
16
    <Install>true</Install>
17
    <InstallFrom>Disk</InstallFrom>
18
    <UpdateEnabled>false</UpdateEnabled>
19
    <UpdateMode>Foreground</UpdateMode>
20
    <UpdateInterval>7</UpdateInterval>
21
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
22
    <UpdatePeriodically>false</UpdatePeriodically>
23
    <UpdateRequired>false</UpdateRequired>
24
    <MapFileExtensions>true</MapFileExtensions>
25
    <ApplicationRevision>0</ApplicationRevision>
26
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
27
    <IsWebBootstrapper>false</IsWebBootstrapper>
28
    <UseApplicationTrust>false</UseApplicationTrust>
29
    <BootstrapperEnabled>true</BootstrapperEnabled>
30
  </PropertyGroup>
31
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
32
    <DebugSymbols>true</DebugSymbols>
33
    <DebugType>full</DebugType>
34
    <Optimize>false</Optimize>
35
    <OutputPath>bin\Debug\</OutputPath>
36
    <DefineConstants>DEBUG;TRACE</DefineConstants>
37
    <ErrorReport>prompt</ErrorReport>
38
    <WarningLevel>4</WarningLevel>
39
  </PropertyGroup>
40
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
41
    <DebugType>pdbonly</DebugType>
42
    <Optimize>true</Optimize>
43
    <OutputPath>bin\Release\</OutputPath>
44
    <DefineConstants>TRACE</DefineConstants>
45
    <ErrorReport>prompt</ErrorReport>
46
    <WarningLevel>4</WarningLevel>
47
  </PropertyGroup>
48
  <ItemGroup>
49
    <Reference Include="System" />
50
  </ItemGroup>
51
  <ItemGroup>
52
    <Compile Include="Program.cs" />
53
    <Compile Include="Properties\AssemblyInfo.cs" />
54
  </ItemGroup>
55
  <ItemGroup>
56
    <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
57
      <Visible>False</Visible>
58
      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
59
      <Install>false</Install>
60
    </BootstrapperPackage>
61
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
62
      <Visible>False</Visible>
63
      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
64
      <Install>false</Install>
65
    </BootstrapperPackage>
66
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
67
      <Visible>False</Visible>
68
      <ProductName>.NET Framework 3.5</ProductName>
69
      <Install>true</Install>
70
    </BootstrapperPackage>
71
    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
72
      <Visible>False</Visible>
73
      <ProductName>Windows Installer 3.1</ProductName>
74
      <Install>true</Install>
75
    </BootstrapperPackage>
76
  </ItemGroup>
77
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
78
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
79
       Other similar extension points exist, see Microsoft.Common.targets.
80
  <Target Name="BeforeBuild">
81
  </Target>
82
  <Target Name="AfterBuild">
83
  </Target>
84
  -->
85
</Project>

Up to file-list StripRegions/license.txt:

-
Diff size exceeds threshold (34.3 KB)view raw?