--- /dev/null
+\r
+Microsoft Visual Studio Solution File, Format Version 11.00\r
+# Visual Studio 2010\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chapter7", "Chapter7\Chapter7.csproj", "{F9C58D62-5522-4FCB-8F6A-69D808E88785}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|x86 = Debug|x86\r
+ Release|x86 = Release|x86\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {F9C58D62-5522-4FCB-8F6A-69D808E88785}.Debug|x86.ActiveCfg = Debug|x86\r
+ {F9C58D62-5522-4FCB-8F6A-69D808E88785}.Debug|x86.Build.0 = Debug|x86\r
+ {F9C58D62-5522-4FCB-8F6A-69D808E88785}.Release|x86.ActiveCfg = Release|x86\r
+ {F9C58D62-5522-4FCB-8F6A-69D808E88785}.Release|x86.Build.0 = Release|x86\r
+ EndGlobalSection\r
+ GlobalSection(MonoDevelopProperties) = preSolution\r
+ StartupItem = Chapter7\Chapter7.csproj\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+<Properties>
+ <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
+ <MonoDevelop.Ide.Workbench ActiveDocument="Chapter7/Main.cs">
+ <Files>
+ <File FileName="Chapter7/Main.cs" Line="35" Column="38" />
+ <File FileName="Chapter7/Example1.cs" Line="19" Column="4" />
+ <File FileName="Chapter7/Example2.cs" Line="18" Column="34" />
+ </Files>
+ </MonoDevelop.Ide.Workbench>
+ <MonoDevelop.Ide.DebuggingService.Breakpoints>
+ <BreakpointStore />
+ </MonoDevelop.Ide.DebuggingService.Breakpoints>
+ <MonoDevelop.Ide.DebuggingService.PinnedWatches />
+</Properties>
\ No newline at end of file
--- /dev/null
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle("Chapter7")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("gustavo")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{F9C58D62-5522-4FCB-8F6A-69D808E88785}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>Chapter7</RootNamespace>
+ <AssemblyName>Chapter7</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
+ <Externalconsole>true</Externalconsole>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <DebugType>none</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
+ <Externalconsole>true</Externalconsole>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Main.cs" />
+ <Compile Include="AssemblyInfo.cs" />
+ <Compile Include="Example1.cs" />
+ <Compile Include="Example2.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
--- /dev/null
+using System;
+
+namespace Chapter7
+{
+ partial class Example<TFirst, TSecond> : IEquatable<string> where TFirst : class
+ {
+ public bool Equals(string other)
+ {
+ return false;
+ }
+ }
+
+
+ partial class PartialMethodDemo
+ {
+ public PartialMethodDemo ()
+ {
+ OnConstructorStart();
+ Console.WriteLine("Generated constructor");
+ OnConstructorEnd();
+ }
+
+ partial void OnConstructorStart();
+ partial void OnConstructorEnd();
+ }
+}
+
--- /dev/null
+using System;
+
+namespace Chapter7
+{
+ partial class Example<TFirst, TSecond> : EventArgs, IDisposable
+ {
+ public void Dispose()
+ {
+ Console.WriteLine("Running Dispose");
+ }
+ }
+
+
+ partial class PartialMethodDemo
+ {
+ partial void OnConstructorEnd()
+ {
+ Console.WriteLine("Manual code");
+ }
+ }
+}
+
--- /dev/null
+using System;
+
+namespace Chapter7
+{
+ class Chapter7
+ {
+ public static void Main (string[] args)
+ {
+
+ /**
+ *
+ * Listing 7.1 Demonstration of mixing declarations of a partial type.
+ */
+ Console.WriteLine("Listing 7.1: Demonstration of mixing declarations of a partial type.");
+ Example<string, int> example = new Example<string, int>();
+ example.Dispose();
+
+
+ /**
+ *
+ * Listing 7.2 A partial method called from a constructor.
+ */
+ Console.WriteLine("Listing 7.2: A partial method called from a constructor.");
+#pragma warning disable 0219
+ PartialMethodDemo partialMethodDemo = new PartialMethodDemo();
+#pragma warning restore 0219
+
+ /**
+ *
+ * Listing 7.3 A typical C# 1 utility class.
+ */
+ Console.WriteLine("Listing 7.3: A typical C# 1 utility class.");
+ string message = "noimahcrE nereB";
+ string reverseMessage = NonStaticStringHelper.Reverse(message);
+ Console.WriteLine(reverseMessage);
+
+
+ /**
+ *
+ * Listing 7.4 The same utility class as in listing 7.3, but converted a C# 2 static class.
+ */
+ Console.WriteLine("Listing 7.4: The same utility class as in listing 7.3, but converted a C# 2 static class.oimahcrE nereB");
+ message = "leivúniT neihtúL";
+ reverseMessage = NonStaticStringHelper.Reverse(message);
+ Console.WriteLine(reverseMessage);
+
+ }
+ }
+
+ public sealed class NonStaticStringHelper
+ {
+ private NonStaticStringHelper ()
+ {
+ }
+
+ public static string Reverse(string input)
+ {
+ char[] chars = input.ToCharArray();
+ Array.Reverse(chars);
+ return new string(chars);
+ }
+ }
+
+
+ public static class StringHelper
+ {
+ public static string Reverse(string input)
+ {
+ char[] chars = input.ToCharArray();
+ Array.Reverse(chars);
+ return new string(chars);
+ }
+ }
+}