Click here to Skip to main content
15,893,337 members
Articles / Programming Languages / C#

Single Instance String Store for .NET

Rate me:
Please Sign up or sign in to vote.
4.89/5 (48 votes)
16 Jul 2009CPOL8 min read 65.5K   994   114  
By implementing a single instance string store, you can significantly reduce the memory footprint of your application.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{BDB284BF-D0C3-4F82-B08D-C5A752AD8603}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Gibraltar.TraceMonitorSamples</RootNamespace>
    <AssemblyName>StringReferenceSample</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Gibraltar.Agent, Version=2.0.0.0, Culture=neutral, PublicKeyToken=ca42a1ee8d2e42d3, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="MainApp.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="MainApp.Designer.cs">
      <DependentUpon>MainApp.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="MainApp.resx">
      <DependentUpon>MainApp.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="WorkerUI.resx">
      <DependentUpon>WorkerUI.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <None Include="App.config" />
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
    <Compile Include="VerticalProgressBar.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="VerticalProgressBar.Designer.cs">
      <DependentUpon>VerticalProgressBar.cs</DependentUpon>
    </Compile>
    <Compile Include="WorkerUI.cs">
      <SubType>UserControl</SubType>
    </Compile>
    <Compile Include="WorkerUI.Designer.cs">
      <DependentUpon>WorkerUI.cs</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <None Include="Gibraltar.Agent.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <Content Include="Resources\Arrow-Left.png" />
    <Content Include="Resources\Exception.gif" />
    <Content Include="Resources\Start.gif" />
    <Content Include="Resources\Stop.gif" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder Gibraltar Software
United States United States
Kendall Miller has been designing, creating, and deploying information systems (hardware, software, and networks) since 1993.  Currently, Kendall is one of the founders of Gibraltar Software, creating developer tools for .NET developers. 

Prior to working at Gibraltar Software, Kendall helped get two Software as a Service startups off the ground creating complete IT infrastructure from the ground up.  He got his career start at John Deere working on Microsoft software and strategies
for the world wide John Deere dealership network.

You can follow the Gibraltar development team at RockSolid.GibraltarSoftware.com.

Kendall lives near Baltimore, MD. 

Comments and Discussions