diff --git a/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes_MarkupCompile.i.cache b/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes_MarkupCompile.i.cache deleted file mode 100644 index 34f536f..0000000 --- a/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes_MarkupCompile.i.cache +++ /dev/null @@ -1,20 +0,0 @@ -CH02BasicBrushes - - -winexe -C# -.cs -C:\Users\Thons\ProCS\CH02BasicBrushes\obj\x86\Debug\ -CH02BasicBrushes -none -false -DEBUG;TRACE -C:\Users\Thons\ProCS\CH02BasicBrushes\App.xaml -11151548125 - -62000799799 -12-1381780322 -MainWindow.xaml; - -False - diff --git a/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index 3f604b3..0000000 Binary files a/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ diff --git a/CodeMarkup.sln b/CodeMarkup.sln deleted file mode 100644 index e6febdb..0000000 --- a/CodeMarkup.sln +++ /dev/null @@ -1,12 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/CodeMarkup.suo b/CodeMarkup.suo deleted file mode 100644 index 964eafe..0000000 Binary files a/CodeMarkup.suo and /dev/null differ diff --git a/CH01AppWindow/CH01AppWindow.csproj b/CodeMarkup/CH01AppWindow/CH01AppWindow.csproj similarity index 100% rename from CH01AppWindow/CH01AppWindow.csproj rename to CodeMarkup/CH01AppWindow/CH01AppWindow.csproj diff --git a/CH01AppWindow/CH01AppWindow.csproj.user b/CodeMarkup/CH01AppWindow/CH01AppWindow.csproj.user similarity index 100% rename from CH01AppWindow/CH01AppWindow.csproj.user rename to CodeMarkup/CH01AppWindow/CH01AppWindow.csproj.user diff --git a/CH01AppWindow/InheritApp.cs b/CodeMarkup/CH01AppWindow/InheritApp.cs similarity index 100% rename from CH01AppWindow/InheritApp.cs rename to CodeMarkup/CH01AppWindow/InheritApp.cs diff --git a/CH01AppWindow/InheritAppAndWindow.cs b/CodeMarkup/CH01AppWindow/InheritAppAndWindow.cs similarity index 100% rename from CH01AppWindow/InheritAppAndWindow.cs rename to CodeMarkup/CH01AppWindow/InheritAppAndWindow.cs diff --git a/CH01AppWindow/InheritWin.cs b/CodeMarkup/CH01AppWindow/InheritWin.cs similarity index 100% rename from CH01AppWindow/InheritWin.cs rename to CodeMarkup/CH01AppWindow/InheritWin.cs diff --git a/CH01AppWindow/MyApplication.cs b/CodeMarkup/CH01AppWindow/MyApplication.cs similarity index 100% rename from CH01AppWindow/MyApplication.cs rename to CodeMarkup/CH01AppWindow/MyApplication.cs diff --git a/CH01AppWindow/MyWindow.cs b/CodeMarkup/CH01AppWindow/MyWindow.cs similarity index 100% rename from CH01AppWindow/MyWindow.cs rename to CodeMarkup/CH01AppWindow/MyWindow.cs diff --git a/CH01AppWindow/Properties/AssemblyInfo.cs b/CodeMarkup/CH01AppWindow/Properties/AssemblyInfo.cs similarity index 100% rename from CH01AppWindow/Properties/AssemblyInfo.cs rename to CodeMarkup/CH01AppWindow/Properties/AssemblyInfo.cs diff --git a/CH01AppWindow/ThrowWindowParty.cs b/CodeMarkup/CH01AppWindow/ThrowWindowParty.cs similarity index 100% rename from CH01AppWindow/ThrowWindowParty.cs rename to CodeMarkup/CH01AppWindow/ThrowWindowParty.cs diff --git a/CH01AppWindow/TypeYourTitle.cs b/CodeMarkup/CH01AppWindow/TypeYourTitle.cs similarity index 100% rename from CH01AppWindow/TypeYourTitle.cs rename to CodeMarkup/CH01AppWindow/TypeYourTitle.cs diff --git a/CH01AppWindow/WindowInteraction.cs b/CodeMarkup/CH01AppWindow/WindowInteraction.cs similarity index 100% rename from CH01AppWindow/WindowInteraction.cs rename to CodeMarkup/CH01AppWindow/WindowInteraction.cs diff --git a/CH01AppWindow/bin/Debug/CH01AppWindow.exe b/CodeMarkup/CH01AppWindow/bin/Debug/CH01AppWindow.exe similarity index 100% rename from CH01AppWindow/bin/Debug/CH01AppWindow.exe rename to CodeMarkup/CH01AppWindow/bin/Debug/CH01AppWindow.exe diff --git a/CH01AppWindow/bin/Debug/CH01AppWindow.pdb b/CodeMarkup/CH01AppWindow/bin/Debug/CH01AppWindow.pdb similarity index 100% rename from CH01AppWindow/bin/Debug/CH01AppWindow.pdb rename to CodeMarkup/CH01AppWindow/bin/Debug/CH01AppWindow.pdb diff --git a/CH01AppWindow/bin/Debug/CH01AppWindow.vshost.exe b/CodeMarkup/CH01AppWindow/bin/Debug/CH01AppWindow.vshost.exe similarity index 100% rename from CH01AppWindow/bin/Debug/CH01AppWindow.vshost.exe rename to CodeMarkup/CH01AppWindow/bin/Debug/CH01AppWindow.vshost.exe diff --git a/CH01AppWindow/obj/x86/Debug/CH01AppWindow.csproj.FileListAbsolute.txt b/CodeMarkup/CH01AppWindow/obj/x86/Debug/CH01AppWindow.csproj.FileListAbsolute.txt similarity index 100% rename from CH01AppWindow/obj/x86/Debug/CH01AppWindow.csproj.FileListAbsolute.txt rename to CodeMarkup/CH01AppWindow/obj/x86/Debug/CH01AppWindow.csproj.FileListAbsolute.txt diff --git a/CH01AppWindow/obj/x86/Debug/CH01AppWindow.exe b/CodeMarkup/CH01AppWindow/obj/x86/Debug/CH01AppWindow.exe similarity index 100% rename from CH01AppWindow/obj/x86/Debug/CH01AppWindow.exe rename to CodeMarkup/CH01AppWindow/obj/x86/Debug/CH01AppWindow.exe diff --git a/CH01AppWindow/obj/x86/Debug/CH01AppWindow.pdb b/CodeMarkup/CH01AppWindow/obj/x86/Debug/CH01AppWindow.pdb similarity index 100% rename from CH01AppWindow/obj/x86/Debug/CH01AppWindow.pdb rename to CodeMarkup/CH01AppWindow/obj/x86/Debug/CH01AppWindow.pdb diff --git a/CH01AppWindow/obj/x86/Debug/CH1AppWindow.csproj.FileListAbsolute.txt b/CodeMarkup/CH01AppWindow/obj/x86/Debug/CH1AppWindow.csproj.FileListAbsolute.txt similarity index 100% rename from CH01AppWindow/obj/x86/Debug/CH1AppWindow.csproj.FileListAbsolute.txt rename to CodeMarkup/CH01AppWindow/obj/x86/Debug/CH1AppWindow.csproj.FileListAbsolute.txt diff --git a/CH01AppWindow/obj/x86/Debug/CM_CH01AppWindow.csproj.FileListAbsolute.txt b/CodeMarkup/CH01AppWindow/obj/x86/Debug/CM_CH01AppWindow.csproj.FileListAbsolute.txt similarity index 100% rename from CH01AppWindow/obj/x86/Debug/CM_CH01AppWindow.csproj.FileListAbsolute.txt rename to CodeMarkup/CH01AppWindow/obj/x86/Debug/CM_CH01AppWindow.csproj.FileListAbsolute.txt diff --git a/CH01AppWindow/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/CodeMarkup/CH01AppWindow/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache similarity index 83% rename from CH01AppWindow/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache rename to CodeMarkup/CH01AppWindow/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 0510657..9b1ec4f 100644 Binary files a/CH01AppWindow/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/CodeMarkup/CH01AppWindow/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/CodeMarkup/CH02BasicBrushes/App.xaml b/CodeMarkup/CH02BasicBrushes/App.xaml new file mode 100644 index 0000000..962068f --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/CH02BasicBrushes/App.xaml.cs b/CodeMarkup/CH02BasicBrushes/App.xaml.cs similarity index 100% rename from CH02BasicBrushes/App.xaml.cs rename to CodeMarkup/CH02BasicBrushes/App.xaml.cs diff --git a/CH02BasicBrushes/CH02BasicBrushes.csproj b/CodeMarkup/CH02BasicBrushes/CH02BasicBrushes.csproj similarity index 86% rename from CH02BasicBrushes/CH02BasicBrushes.csproj rename to CodeMarkup/CH02BasicBrushes/CH02BasicBrushes.csproj index e1af4ba..62b396f 100644 --- a/CH02BasicBrushes/CH02BasicBrushes.csproj +++ b/CodeMarkup/CH02BasicBrushes/CH02BasicBrushes.csproj @@ -5,7 +5,7 @@ x86 8.0.30703 2.0 - 3c09a5cf-e8de-4a11-8e5f-61bdf8b441ff + {D2ABD80D-2652-4255-A049-50938B4C9815} WinExe Properties CH02BasicBrushes @@ -53,7 +53,18 @@ MSBuild:Compile + Designer + + FlipThroughTheBrushes.xaml + + + VrayTheBackground.xaml + + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -66,6 +77,10 @@ MainWindow.xaml Code + + Designer + MSBuild:Compile + diff --git a/CodeMarkup/CH02BasicBrushes/FlipThroughTheBrushes.xaml b/CodeMarkup/CH02BasicBrushes/FlipThroughTheBrushes.xaml new file mode 100644 index 0000000..095a15a --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/FlipThroughTheBrushes.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/CodeMarkup/CH02BasicBrushes/FlipThroughTheBrushes.xaml.cs b/CodeMarkup/CH02BasicBrushes/FlipThroughTheBrushes.xaml.cs new file mode 100644 index 0000000..d73f14a --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/FlipThroughTheBrushes.xaml.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; +using System.Reflection; + +namespace CH02BasicBrushes +{ + /// + /// FlipThroughTheBrushes.xaml 的交互逻辑 + /// + public partial class FlipThroughTheBrushes : Window + { + int index = 0; + PropertyInfo[ ] props; + + public FlipThroughTheBrushes() + { + InitializeComponent(); + + props = typeof(Brushes).GetProperties(BindingFlags.Public | + BindingFlags.Static); + SetTitleAndBackground(); + } + + protected override void OnKeyDown(KeyEventArgs args) + { + if (args.Key == Key.Down || args.Key == Key.Up) + { + index += args.Key == Key.Up ? 1 : props.Length - 1; + index %= props.Length; + SetTitleAndBackground(); + } + base.OnKeyDown(args); + } + void SetTitleAndBackground() + { + Title = "Flip Through the Brushes - " + props[index].Name; + Background = (Brush)props[index].GetValue(null, null); + } + } +} diff --git a/CH02BasicBrushes/MainWindow.xaml b/CodeMarkup/CH02BasicBrushes/MainWindow.xaml similarity index 100% rename from CH02BasicBrushes/MainWindow.xaml rename to CodeMarkup/CH02BasicBrushes/MainWindow.xaml diff --git a/CodeMarkup/CH02BasicBrushes/MainWindow.xaml.cs b/CodeMarkup/CH02BasicBrushes/MainWindow.xaml.cs new file mode 100644 index 0000000..2d807b0 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/MainWindow.xaml.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace CH02BasicBrushes +{ + /// + /// MainWindow.xaml 的交互逻辑 + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + + Color color = Color.FromRgb(0, 255, 255); + SolidColorBrush brush = new SolidColorBrush(color); + Background = brush; + } + } +} diff --git a/CH02BasicBrushes/Properties/AssemblyInfo.cs b/CodeMarkup/CH02BasicBrushes/Properties/AssemblyInfo.cs similarity index 100% rename from CH02BasicBrushes/Properties/AssemblyInfo.cs rename to CodeMarkup/CH02BasicBrushes/Properties/AssemblyInfo.cs diff --git a/CH02BasicBrushes/Properties/Resources.Designer.cs b/CodeMarkup/CH02BasicBrushes/Properties/Resources.Designer.cs similarity index 100% rename from CH02BasicBrushes/Properties/Resources.Designer.cs rename to CodeMarkup/CH02BasicBrushes/Properties/Resources.Designer.cs diff --git a/CH02BasicBrushes/Properties/Resources.resx b/CodeMarkup/CH02BasicBrushes/Properties/Resources.resx similarity index 100% rename from CH02BasicBrushes/Properties/Resources.resx rename to CodeMarkup/CH02BasicBrushes/Properties/Resources.resx diff --git a/CH02BasicBrushes/Properties/Settings.Designer.cs b/CodeMarkup/CH02BasicBrushes/Properties/Settings.Designer.cs similarity index 100% rename from CH02BasicBrushes/Properties/Settings.Designer.cs rename to CodeMarkup/CH02BasicBrushes/Properties/Settings.Designer.cs diff --git a/CH02BasicBrushes/Properties/Settings.settings b/CodeMarkup/CH02BasicBrushes/Properties/Settings.settings similarity index 100% rename from CH02BasicBrushes/Properties/Settings.settings rename to CodeMarkup/CH02BasicBrushes/Properties/Settings.settings diff --git a/CodeMarkup/CH02BasicBrushes/VrayTheBackground.xaml b/CodeMarkup/CH02BasicBrushes/VrayTheBackground.xaml new file mode 100644 index 0000000..fcd9ad0 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/VrayTheBackground.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/CodeMarkup/CH02BasicBrushes/VrayTheBackground.xaml.cs b/CodeMarkup/CH02BasicBrushes/VrayTheBackground.xaml.cs new file mode 100644 index 0000000..a9d0e71 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/VrayTheBackground.xaml.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace CH02BasicBrushes +{ + /// + /// VrayTheBackground.xaml 的交互逻辑 + /// + public partial class VrayTheBackground : Window + { + SolidColorBrush brush = Brushes.Black.Clone(); + + public VrayTheBackground() + { + InitializeComponent(); + + Title = "Vray the Background..."; + Width = 384; + Height = 384; + Background = brush; + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + double width = ActualWidth + - 2 * SystemParameters.ResizeFrameVerticalBorderWidth; + double height = ActualHeight + - 2 * SystemParameters.ResizeFrameHorizontalBorderHeight + - SystemParameters.CaptionHeight; + + Point ptMouse = e.GetPosition(this); + Point ptCenter = new Point(width / 2, height / 2); + Vector vectMouse = ptMouse - ptCenter; + double angle = Math.Atan2(vectMouse.Y, vectMouse.X); + Vector vectEllipse = new Vector(width / 2 * Math.Cos(angle), + height / 2 * Math.Sin(angle)); + Byte byLevel = (byte)(255 * (1 - Math.Min(1, vectMouse.Length / + vectEllipse.Length))); + Color clr = brush.Color; + clr.R = clr.G = clr.B = byLevel; + brush.Color = clr; + } + } +} diff --git a/CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.exe b/CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.exe new file mode 100644 index 0000000..69432de Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.exe differ diff --git a/CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.pdb b/CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.pdb new file mode 100644 index 0000000..007e5f0 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.pdb differ diff --git a/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.vshost.exe b/CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.vshost.exe similarity index 100% rename from CH02BasicBrushes/bin/Debug/CH02BasicBrushes.vshost.exe rename to CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.vshost.exe diff --git a/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.vshost.exe.manifest b/CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.vshost.exe.manifest similarity index 100% rename from CH02BasicBrushes/bin/Debug/CH02BasicBrushes.vshost.exe.manifest rename to CodeMarkup/CH02BasicBrushes/bin/Debug/CH02BasicBrushes.vshost.exe.manifest diff --git a/CH02BasicBrushes/obj/x86/Debug/App.g.i.cs b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/App.g.cs similarity index 92% rename from CH02BasicBrushes/obj/x86/Debug/App.g.i.cs rename to CodeMarkup/CH02BasicBrushes/obj/x86/Debug/App.g.cs index 5684645..f7c1006 100644 --- a/CH02BasicBrushes/obj/x86/Debug/App.g.i.cs +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/App.g.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "9FEF6F8A1A8818E1DDF28D6D3ADEA789" +#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "23F6A0AC324929472295BA75FA8D409D" //------------------------------------------------------------------------------ // // 此代码由工具生成。 @@ -47,7 +47,7 @@ public partial class App : System.Windows.Application { public void InitializeComponent() { #line 4 "..\..\..\App.xaml" - this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); + this.StartupUri = new System.Uri("FlipThroughTheBrushes.xaml", System.UriKind.Relative); #line default #line hidden diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/App.g.i.cs b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/App.g.i.cs new file mode 100644 index 0000000..447c146 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/App.g.i.cs @@ -0,0 +1,68 @@ +#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "23F6A0AC324929472295BA75FA8D409D" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.208 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace CH02BasicBrushes { + + + /// + /// App + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public partial class App : System.Windows.Application { + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + + #line 4 "..\..\..\App.xaml" + this.StartupUri = new System.Uri("FlipThroughTheBrushes.xaml", System.UriKind.Relative); + + #line default + #line hidden + } + + /// + /// Application Entry Point. + /// + [System.STAThreadAttribute()] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static void Main() { + CH02BasicBrushes.App app = new CH02BasicBrushes.App(); + app.InitializeComponent(); + app.Run(); + } + } +} + diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.Properties.Resources.resources b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.Properties.Resources.resources differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.csproj.FileListAbsolute.txt b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..066001a --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.csproj.FileListAbsolute.txt @@ -0,0 +1,17 @@ +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\bin\Debug\CH02BasicBrushes.exe +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\bin\Debug\CH02BasicBrushes.pdb +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\MainWindow.baml +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\MainWindow.g.cs +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\App.g.cs +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\CH02BasicBrushes_MarkupCompile.cache +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\CH02BasicBrushes.g.resources +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\CH02BasicBrushes.Properties.Resources.resources +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\GenerateResource.read.1.tlog +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\GenerateResource.write.1.tlog +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\CH02BasicBrushes.exe +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\CH02BasicBrushes.pdb +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\VrayTheBackground.baml +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\VrayTheBackground.g.cs +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\FlipThroughTheBrushes.baml +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\FlipThroughTheBrushes.g.cs diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.exe b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.exe new file mode 100644 index 0000000..69432de Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.exe differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.g.resources b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.g.resources new file mode 100644 index 0000000..17048fd Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.g.resources differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.pdb b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.pdb new file mode 100644 index 0000000..007e5f0 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes.pdb differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes_MarkupCompile.cache b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes_MarkupCompile.cache new file mode 100644 index 0000000..bc579d8 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes_MarkupCompile.cache @@ -0,0 +1,20 @@ +CH02BasicBrushes + + +winexe +C# +.cs +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\ +CH02BasicBrushes +none +false +DEBUG;TRACE +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\App.xaml +31848677873 + +7-1640469369 +12-1381780322 +FlipThroughTheBrushes.xaml;MainWindow.xaml;VrayTheBackground.xaml; + +False + diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes_MarkupCompile.i.cache b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes_MarkupCompile.i.cache new file mode 100644 index 0000000..d391940 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/CH02BasicBrushes_MarkupCompile.i.cache @@ -0,0 +1,20 @@ +CH02BasicBrushes + + +winexe +C# +.cs +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\obj\x86\Debug\ +CH02BasicBrushes +none +false +DEBUG;TRACE +C:\Users\Thons\ProCS\CodeMarkup\CH02BasicBrushes\App.xaml +31848677873 + +8-1916890364 +12-1381780322 +FlipThroughTheBrushes.xaml;MainWindow.xaml;VrayTheBackground.xaml; + +False + diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..23f3181 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..9ce5ee8 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/FlipThroughTheBrushes.baml b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/FlipThroughTheBrushes.baml new file mode 100644 index 0000000..0a33c20 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/FlipThroughTheBrushes.baml differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/FlipThroughTheBrushes.g.cs b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/FlipThroughTheBrushes.g.cs new file mode 100644 index 0000000..5198fc5 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/FlipThroughTheBrushes.g.cs @@ -0,0 +1,73 @@ +#pragma checksum "..\..\..\FlipThroughTheBrushes.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "BFE1BB066C7D241855C4E2BFBBB97FAB" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.1 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace CH02BasicBrushes { + + + /// + /// FlipThroughTheBrushes + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public partial class FlipThroughTheBrushes : System.Windows.Window, System.Windows.Markup.IComponentConnector { + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/CH02BasicBrushes;component/flipthroughthebrushes.xaml", System.UriKind.Relative); + + #line 1 "..\..\..\FlipThroughTheBrushes.xaml" + System.Windows.Application.LoadComponent(this, resourceLocater); + + #line default + #line hidden + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + this._contentLoaded = true; + } + } +} + diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/FlipThroughTheBrushes.g.i.cs b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/FlipThroughTheBrushes.g.i.cs new file mode 100644 index 0000000..a828d32 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/FlipThroughTheBrushes.g.i.cs @@ -0,0 +1,73 @@ +#pragma checksum "..\..\..\FlipThroughTheBrushes.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "BFE1BB066C7D241855C4E2BFBBB97FAB" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.208 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace CH02BasicBrushes { + + + /// + /// FlipThroughTheBrushes + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public partial class FlipThroughTheBrushes : System.Windows.Window, System.Windows.Markup.IComponentConnector { + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/CH02BasicBrushes;component/flipthroughthebrushes.xaml", System.UriKind.Relative); + + #line 1 "..\..\..\FlipThroughTheBrushes.xaml" + System.Windows.Application.LoadComponent(this, resourceLocater); + + #line default + #line hidden + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + this._contentLoaded = true; + } + } +} + diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/GenerateResource.read.1.tlog b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/GenerateResource.read.1.tlog new file mode 100644 index 0000000..1bacfe5 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/GenerateResource.read.1.tlog differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/GenerateResource.write.1.tlog b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/GenerateResource.write.1.tlog new file mode 100644 index 0000000..bcddc13 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/GenerateResource.write.1.tlog differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/MainWindow.baml b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/MainWindow.baml new file mode 100644 index 0000000..917ae26 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/MainWindow.baml differ diff --git a/CH02BasicBrushes/obj/x86/Debug/MainWindow.g.i.cs b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/MainWindow.g.cs similarity index 100% rename from CH02BasicBrushes/obj/x86/Debug/MainWindow.g.i.cs rename to CodeMarkup/CH02BasicBrushes/obj/x86/Debug/MainWindow.g.cs diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/MainWindow.g.i.cs b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/MainWindow.g.i.cs new file mode 100644 index 0000000..bd30eaa --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/MainWindow.g.i.cs @@ -0,0 +1,73 @@ +#pragma checksum "..\..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "C9FD77205B7EF0E9B4336AA572185488" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.208 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace CH02BasicBrushes { + + + /// + /// MainWindow + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/CH02BasicBrushes;component/mainwindow.xaml", System.UriKind.Relative); + + #line 1 "..\..\..\MainWindow.xaml" + System.Windows.Application.LoadComponent(this, resourceLocater); + + #line default + #line hidden + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + this._contentLoaded = true; + } + } +} + diff --git a/CH02BasicBrushes/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll similarity index 100% rename from CH02BasicBrushes/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll rename to CodeMarkup/CH02BasicBrushes/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/VrayTheBackground.baml b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/VrayTheBackground.baml new file mode 100644 index 0000000..f41fd12 Binary files /dev/null and b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/VrayTheBackground.baml differ diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/VrayTheBackground.g.cs b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/VrayTheBackground.g.cs new file mode 100644 index 0000000..6458436 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/VrayTheBackground.g.cs @@ -0,0 +1,73 @@ +#pragma checksum "..\..\..\VrayTheBackground.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "731A7D32ECEF91C8C79B631BEC41A5AA" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.1 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace CH02BasicBrushes { + + + /// + /// VrayTheBackground + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public partial class VrayTheBackground : System.Windows.Window, System.Windows.Markup.IComponentConnector { + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/CH02BasicBrushes;component/vraythebackground.xaml", System.UriKind.Relative); + + #line 1 "..\..\..\VrayTheBackground.xaml" + System.Windows.Application.LoadComponent(this, resourceLocater); + + #line default + #line hidden + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + this._contentLoaded = true; + } + } +} + diff --git a/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/VrayTheBackground.g.i.cs b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/VrayTheBackground.g.i.cs new file mode 100644 index 0000000..b466990 --- /dev/null +++ b/CodeMarkup/CH02BasicBrushes/obj/x86/Debug/VrayTheBackground.g.i.cs @@ -0,0 +1,73 @@ +#pragma checksum "..\..\..\VrayTheBackground.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "731A7D32ECEF91C8C79B631BEC41A5AA" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.208 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace CH02BasicBrushes { + + + /// + /// VrayTheBackground + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public partial class VrayTheBackground : System.Windows.Window, System.Windows.Markup.IComponentConnector { + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/CH02BasicBrushes;component/vraythebackground.xaml", System.UriKind.Relative); + + #line 1 "..\..\..\VrayTheBackground.xaml" + System.Windows.Application.LoadComponent(this, resourceLocater); + + #line default + #line hidden + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + this._contentLoaded = true; + } + } +} + diff --git a/CH02BasicBrushes/App.xaml b/CodeMarkup/CH03Content/App.xaml similarity index 85% rename from CH02BasicBrushes/App.xaml rename to CodeMarkup/CH03Content/App.xaml index 3c2e8fe..4db545d 100644 --- a/CH02BasicBrushes/App.xaml +++ b/CodeMarkup/CH03Content/App.xaml @@ -1,4 +1,4 @@ - diff --git a/CodeMarkup/CH03Content/App.xaml.cs b/CodeMarkup/CH03Content/App.xaml.cs new file mode 100644 index 0000000..b7adc21 --- /dev/null +++ b/CodeMarkup/CH03Content/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace CH03Content +{ + /// + /// App.xaml 的交互逻辑 + /// + public partial class App : Application + { + } +} diff --git a/CodeMarkup/CH03Content/CH03Content.csproj b/CodeMarkup/CH03Content/CH03Content.csproj new file mode 100644 index 0000000..7c03cfe --- /dev/null +++ b/CodeMarkup/CH03Content/CH03Content.csproj @@ -0,0 +1,103 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {ECECAC30-70C2-468E-B21D-C1430D098458} + WinExe + Properties + CH03Content + CH03Content + v4.0 + Client + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + \ No newline at end of file diff --git a/CodeMarkup/CH03Content/MainWindow.xaml b/CodeMarkup/CH03Content/MainWindow.xaml new file mode 100644 index 0000000..a8159ee --- /dev/null +++ b/CodeMarkup/CH03Content/MainWindow.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/CH02BasicBrushes/MainWindow.xaml.cs b/CodeMarkup/CH03Content/MainWindow.xaml.cs similarity index 95% rename from CH02BasicBrushes/MainWindow.xaml.cs rename to CodeMarkup/CH03Content/MainWindow.xaml.cs index 67d87bf..9565bb6 100644 --- a/CH02BasicBrushes/MainWindow.xaml.cs +++ b/CodeMarkup/CH03Content/MainWindow.xaml.cs @@ -12,7 +12,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; -namespace CH02BasicBrushes +namespace CH03Content { /// /// MainWindow.xaml 的交互逻辑 diff --git a/CodeMarkup/CH03Content/Properties/AssemblyInfo.cs b/CodeMarkup/CH03Content/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c3826fb --- /dev/null +++ b/CodeMarkup/CH03Content/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("CH03Content")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("CH03Content")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +//若要开始生成可本地化的应用程序,请在 +// 中的 .csproj 文件中 +//设置 CultureYouAreCodingWith。例如,如果您在源文件中 +//使用的是美国英语,请将 设置为 en-US。然后取消 +//对以下 NeutralResourceLanguage 特性的注释。更新 +//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //主题特定资源词典所处位置 + //(在页面或应用程序资源词典中 + // 未找到某个资源的情况下使用) + ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 + //(在页面、应用程序或任何主题特定资源词典中 + // 未找到某个资源的情况下使用) +)] + + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 内部版本号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CodeMarkup/CH03Content/Properties/Resources.Designer.cs b/CodeMarkup/CH03Content/Properties/Resources.Designer.cs new file mode 100644 index 0000000..a91d471 --- /dev/null +++ b/CodeMarkup/CH03Content/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.208 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace CH03Content.Properties +{ + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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() + { + } + + /// + /// 返回此类使用的、缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CH03Content.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, + /// 方法是使用此强类型资源类。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/CodeMarkup/CH03Content/Properties/Resources.resx b/CodeMarkup/CH03Content/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/CodeMarkup/CH03Content/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/CodeMarkup/CH03Content/Properties/Settings.Designer.cs b/CodeMarkup/CH03Content/Properties/Settings.Designer.cs new file mode 100644 index 0000000..2dfb24b --- /dev/null +++ b/CodeMarkup/CH03Content/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.208 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CH03Content.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/CodeMarkup/CH03Content/Properties/Settings.settings b/CodeMarkup/CH03Content/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/CodeMarkup/CH03Content/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/CodeMarkup/CH03Content/bin/Debug/CH03Content.vshost.exe b/CodeMarkup/CH03Content/bin/Debug/CH03Content.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/CodeMarkup/CH03Content/bin/Debug/CH03Content.vshost.exe differ diff --git a/CodeMarkup/CH03Content/bin/Debug/CH03Content.vshost.exe.manifest b/CodeMarkup/CH03Content/bin/Debug/CH03Content.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/CodeMarkup/CH03Content/bin/Debug/CH03Content.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/CodeMarkup/CH03Content/obj/x86/Debug/App.g.i.cs b/CodeMarkup/CH03Content/obj/x86/Debug/App.g.i.cs new file mode 100644 index 0000000..b62e904 --- /dev/null +++ b/CodeMarkup/CH03Content/obj/x86/Debug/App.g.i.cs @@ -0,0 +1,68 @@ +#pragma checksum "..\..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "E95F61F18FFA1959CACD7C16AB2D1C79" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.208 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace CH03Content { + + + /// + /// App + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public partial class App : System.Windows.Application { + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + + #line 4 "..\..\..\App.xaml" + this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); + + #line default + #line hidden + } + + /// + /// Application Entry Point. + /// + [System.STAThreadAttribute()] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static void Main() { + CH03Content.App app = new CH03Content.App(); + app.InitializeComponent(); + app.Run(); + } + } +} + diff --git a/CodeMarkup/CH03Content/obj/x86/Debug/CH03Content_MarkupCompile.i.cache b/CodeMarkup/CH03Content/obj/x86/Debug/CH03Content_MarkupCompile.i.cache new file mode 100644 index 0000000..cb4f134 --- /dev/null +++ b/CodeMarkup/CH03Content/obj/x86/Debug/CH03Content_MarkupCompile.i.cache @@ -0,0 +1,20 @@ +CH03Content + + +winexe +C# +.cs +C:\Users\Thons\ProCS\CodeMarkup\CH03Content\obj\x86\Debug\ +CH03Content +none +false +DEBUG;TRACE +C:\Users\Thons\ProCS\CodeMarkup\CH03Content\App.xaml +11151548125 + +62000799799 +12-1381780322 +MainWindow.xaml; + +False + diff --git a/CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache b/CodeMarkup/CH03Content/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache similarity index 100% rename from CH02BasicBrushes/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache rename to CodeMarkup/CH03Content/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache diff --git a/CodeMarkup/CH03Content/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/CodeMarkup/CH03Content/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..5797bdd Binary files /dev/null and b/CodeMarkup/CH03Content/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/CodeMarkup/CH03Content/obj/x86/Debug/MainWindow.g.i.cs b/CodeMarkup/CH03Content/obj/x86/Debug/MainWindow.g.i.cs new file mode 100644 index 0000000..133d9f2 --- /dev/null +++ b/CodeMarkup/CH03Content/obj/x86/Debug/MainWindow.g.i.cs @@ -0,0 +1,73 @@ +#pragma checksum "..\..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "7D3C8CB1A6060AB065DB849B073EBAAE" +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.208 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace CH03Content { + + + /// + /// MainWindow + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/CH03Content;component/mainwindow.xaml", System.UriKind.Relative); + + #line 1 "..\..\..\MainWindow.xaml" + System.Windows.Application.LoadComponent(this, resourceLocater); + + #line default + #line hidden + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + this._contentLoaded = true; + } + } +} + diff --git a/CodeMarkup/CH03Content/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll b/CodeMarkup/CH03Content/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll new file mode 100644 index 0000000..06e319c Binary files /dev/null and b/CodeMarkup/CH03Content/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/CodeMarkup/CodeMarkup.sln b/CodeMarkup/CodeMarkup.sln new file mode 100644 index 0000000..a5be91a --- /dev/null +++ b/CodeMarkup/CodeMarkup.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH02BasicBrushes", "CH02BasicBrushes\CH02BasicBrushes.csproj", "{D2ABD80D-2652-4255-A049-50938B4C9815}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH01AppWindow", "CH01AppWindow\CH01AppWindow.csproj", "{475FED65-0CED-40A2-B714-0061E0A89049}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH03Content", "CH03Content\CH03Content.csproj", "{ECECAC30-70C2-468E-B21D-C1430D098458}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D2ABD80D-2652-4255-A049-50938B4C9815}.Debug|x86.ActiveCfg = Debug|x86 + {D2ABD80D-2652-4255-A049-50938B4C9815}.Debug|x86.Build.0 = Debug|x86 + {D2ABD80D-2652-4255-A049-50938B4C9815}.Release|x86.ActiveCfg = Release|x86 + {D2ABD80D-2652-4255-A049-50938B4C9815}.Release|x86.Build.0 = Release|x86 + {475FED65-0CED-40A2-B714-0061E0A89049}.Debug|x86.ActiveCfg = Debug|x86 + {475FED65-0CED-40A2-B714-0061E0A89049}.Debug|x86.Build.0 = Debug|x86 + {475FED65-0CED-40A2-B714-0061E0A89049}.Release|x86.ActiveCfg = Release|x86 + {475FED65-0CED-40A2-B714-0061E0A89049}.Release|x86.Build.0 = Release|x86 + {ECECAC30-70C2-468E-B21D-C1430D098458}.Debug|x86.ActiveCfg = Debug|x86 + {ECECAC30-70C2-468E-B21D-C1430D098458}.Debug|x86.Build.0 = Debug|x86 + {ECECAC30-70C2-468E-B21D-C1430D098458}.Release|x86.ActiveCfg = Release|x86 + {ECECAC30-70C2-468E-B21D-C1430D098458}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/CodeMarkup/CodeMarkup.suo b/CodeMarkup/CodeMarkup.suo new file mode 100644 index 0000000..1f17e6b Binary files /dev/null and b/CodeMarkup/CodeMarkup.suo differ diff --git a/ProCS4Net4/CH01NetArchitecture/CH01NetArchitecture.csproj b/ProCS4Net4/CH01NetArchitecture/CH01NetArchitecture.csproj new file mode 100644 index 0000000..69c541b --- /dev/null +++ b/ProCS4Net4/CH01NetArchitecture/CH01NetArchitecture.csproj @@ -0,0 +1,57 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {4A7C290F-8788-40F7-9749-5D719EE22C99} + Exe + Properties + CH01NetArchitecture + CH01NetArchitecture + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProCS4Net4/CH01NetArchitecture/Program.cs b/ProCS4Net4/CH01NetArchitecture/Program.cs new file mode 100644 index 0000000..6e6aa7b --- /dev/null +++ b/ProCS4Net4/CH01NetArchitecture/Program.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH01NetArchitecture +{ + class Program + { + static void Main(string[ ] args) + { + //本章无代码 + } + } +} diff --git a/ProCS4Net4/CH01NetArchitecture/Properties/AssemblyInfo.cs b/ProCS4Net4/CH01NetArchitecture/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..21c557d --- /dev/null +++ b/ProCS4Net4/CH01NetArchitecture/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("CH01NetArchitecture")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("CH01NetArchitecture")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("f2bc1a94-7a09-492d-9317-c8668e0cb137")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 内部版本号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.exe b/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.exe new file mode 100644 index 0000000..934c1fa Binary files /dev/null and b/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.exe differ diff --git a/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.pdb b/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.pdb new file mode 100644 index 0000000..2db1cf2 Binary files /dev/null and b/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.pdb differ diff --git a/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.vshost.exe b/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.vshost.exe differ diff --git a/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.vshost.exe.manifest b/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/ProCS4Net4/CH01NetArchitecture/bin/Debug/CH01NetArchitecture.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/CH01NetArchitecture.csproj.FileListAbsolute.txt b/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/CH01NetArchitecture.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..3342ed3 --- /dev/null +++ b/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/CH01NetArchitecture.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH01NetArchitecture\bin\Debug\CH01NetArchitecture.exe +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH01NetArchitecture\bin\Debug\CH01NetArchitecture.pdb +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH01NetArchitecture\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH01NetArchitecture\obj\x86\Debug\CH01NetArchitecture.exe +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH01NetArchitecture\obj\x86\Debug\CH01NetArchitecture.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH01NetArchitecture\bin\Debug\CH01NetArchitecture.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH01NetArchitecture\bin\Debug\CH01NetArchitecture.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH01NetArchitecture\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\CH01NetArchitecture\obj\x86\Debug\CH01NetArchitecture.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH01NetArchitecture\obj\x86\Debug\CH01NetArchitecture.pdb diff --git a/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/CH01NetArchitecture.exe b/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/CH01NetArchitecture.exe new file mode 100644 index 0000000..934c1fa Binary files /dev/null and b/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/CH01NetArchitecture.exe differ diff --git a/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/CH01NetArchitecture.pdb b/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/CH01NetArchitecture.pdb new file mode 100644 index 0000000..2db1cf2 Binary files /dev/null and b/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/CH01NetArchitecture.pdb differ diff --git a/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..e6605d7 Binary files /dev/null and b/ProCS4Net4/CH01NetArchitecture/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ProCS4Net4/CH02CoreCSharp/CH02CoreCSharp.csproj b/ProCS4Net4/CH02CoreCSharp/CH02CoreCSharp.csproj new file mode 100644 index 0000000..767d23c --- /dev/null +++ b/ProCS4Net4/CH02CoreCSharp/CH02CoreCSharp.csproj @@ -0,0 +1,62 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {E5B0DDD9-1C14-42FA-961D-7FF560A0434D} + Exe + Properties + CH02CoreCSharp + CH02CoreCSharp + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + bin\Debug\CH02CoreCSharp.XML + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + CH02CoreCSharp.UseComment + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProCS4Net4/CH02CoreCSharp/ConsoleIO.cs b/ProCS4Net4/CH02CoreCSharp/ConsoleIO.cs new file mode 100644 index 0000000..c81a84a --- /dev/null +++ b/ProCS4Net4/CH02CoreCSharp/ConsoleIO.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH02CoreCSharp +{ + class ConsoleIO + { + static void Main(string[ ] args) + { + int i = 940; + int j = 73; + Console.WriteLine(" {0,4}\n+{1,4}\n ----\n {2,4}", i, j, i + j); + + Console.WriteLine(); + + decimal m = 940.23M; + decimal n = 73.7M; + Console.WriteLine(" {0,9:C2}\n+{1,9:C2}\n ------------ \n {2,9:C2}", m, n, m + n); + + Console.ReadLine(); + } + } +} diff --git a/ProCS4Net4/CH02CoreCSharp/Properties/AssemblyInfo.cs b/ProCS4Net4/CH02CoreCSharp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..74992d4 --- /dev/null +++ b/ProCS4Net4/CH02CoreCSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("CH02CoreCSharp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("CH02CoreCSharp")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("15df85ff-dedf-4d65-9726-ba02468c58db")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 内部版本号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ProCS4Net4/CH02CoreCSharp/UseComment.cs b/ProCS4Net4/CH02CoreCSharp/UseComment.cs new file mode 100644 index 0000000..66543fa --- /dev/null +++ b/ProCS4Net4/CH02CoreCSharp/UseComment.cs @@ -0,0 +1,48 @@ +#define PRO + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH02CoreCSharp +{ + /* + * 这是多行注释 + * */ + //这是单行注释 + + /// + /// + /// + class UseComment + { + /// + /// Mains the specified args. + /// + /// The args. + /// + static void Main(string[ ] args) + { + Console.WriteLine(/*这还是一个注释*/"这才是真正的字符串"); + string s = "/*这不是注释*/"; + +#if PRO + Console.WriteLine("这是专业版"); +#elif ENT + Console.WriteLine("这是企业版"); +#else + Console.WriteLine("这是普遍版"); +#endif + + #region 错误条件编译块 +#if PRO&&ENT +#error "不能同时编译两个版本!" +#endif + #endregion + +#warning "不要忘了移除下面的这行代码" + Console.ReadLine(); + } + } +} \ No newline at end of file diff --git a/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.XML b/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.XML new file mode 100644 index 0000000..9f06437 --- /dev/null +++ b/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.XML @@ -0,0 +1,20 @@ + + + + CH02CoreCSharp + + + + + + + + + + Mains the specified args. + + The args. + + + + diff --git a/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.exe b/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.exe new file mode 100644 index 0000000..c38332a Binary files /dev/null and b/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.exe differ diff --git a/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.pdb b/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.pdb new file mode 100644 index 0000000..329ca1b Binary files /dev/null and b/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.pdb differ diff --git a/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.vshost.exe b/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/ProCS4Net4/CH02CoreCSharp/bin/Debug/CH02CoreCSharp.vshost.exe differ diff --git a/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/CH02CoreCSharp.csproj.FileListAbsolute.txt b/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/CH02CoreCSharp.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..c32f16f --- /dev/null +++ b/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/CH02CoreCSharp.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH02CoreCSharp\bin\Debug\CH02CoreCSharp.exe +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH02CoreCSharp\bin\Debug\CH02CoreCSharp.pdb +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH02CoreCSharp\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH02CoreCSharp\obj\x86\Debug\CH02CoreCSharp.exe +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH02CoreCSharp\obj\x86\Debug\CH02CoreCSharp.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH02CoreCSharp\bin\Debug\CH02CoreCSharp.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH02CoreCSharp\bin\Debug\CH02CoreCSharp.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH02CoreCSharp\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\CH02CoreCSharp\obj\x86\Debug\CH02CoreCSharp.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH02CoreCSharp\obj\x86\Debug\CH02CoreCSharp.pdb diff --git a/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/CH02CoreCSharp.exe b/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/CH02CoreCSharp.exe new file mode 100644 index 0000000..c38332a Binary files /dev/null and b/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/CH02CoreCSharp.exe differ diff --git a/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/CH02CoreCSharp.pdb b/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/CH02CoreCSharp.pdb new file mode 100644 index 0000000..329ca1b Binary files /dev/null and b/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/CH02CoreCSharp.pdb differ diff --git a/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..6cb295d Binary files /dev/null and b/ProCS4Net4/CH02CoreCSharp/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ProCS4Net4/CH03ObjectType/BigClassPart1.cs b/ProCS4Net4/CH03ObjectType/BigClassPart1.cs new file mode 100644 index 0000000..1cc241a --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/BigClassPart1.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + partial class BigClass + { + + } +} diff --git a/ProCS4Net4/CH03ObjectType/BigClassPart2.cs b/ProCS4Net4/CH03ObjectType/BigClassPart2.cs new file mode 100644 index 0000000..f56c8b2 --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/BigClassPart2.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + partial class BigClass + { + } +} diff --git a/ProCS4Net4/CH03ObjectType/CH03ObjectType.csproj b/ProCS4Net4/CH03ObjectType/CH03ObjectType.csproj new file mode 100644 index 0000000..8e00def --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/CH03ObjectType.csproj @@ -0,0 +1,71 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {EB01C997-F653-4946-87FB-B7B8454186CD} + Exe + Properties + CH03ObjectType + CH03ObjectType + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + CH03ObjectType.MainEntry + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProCS4Net4/CH03ObjectType/CH03ObjectType.csproj.user b/ProCS4Net4/CH03ObjectType/CH03ObjectType.csproj.user new file mode 100644 index 0000000..07dbd5b --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/CH03ObjectType.csproj.user @@ -0,0 +1,6 @@ + + + + ProjectFiles + + \ No newline at end of file diff --git a/ProCS4Net4/CH03ObjectType/Car.cs b/ProCS4Net4/CH03ObjectType/Car.cs new file mode 100644 index 0000000..08cbbe3 --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/Car.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + class Car + { + private string description; + private uint nWheels; + + public Car(string description, uint nWheels, string brand) + { + + } + + public Car(string description, uint nWheels) + : this(description, nWheels, brand: "Audi") + { + this.description = description; + this.nWheels = nWheels; + } + + public Car(string description) + : this(description, nWheels: 4) + { + + } + } +} diff --git a/ProCS4Net4/CH03ObjectType/MainEntry.cs b/ProCS4Net4/CH03ObjectType/MainEntry.cs new file mode 100644 index 0000000..2f941a3 --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/MainEntry.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + class MainEntry + { + public static readonly DateTime staticReadOnly; + public readonly DateTime readOnly; + + static MainEntry() + { + staticReadOnly = DateTime.Now; + } + + public MainEntry() + { + readOnly = DateTime.Now; + } + + static void Main(string[ ] args) + { + Console.WriteLine("User Preferences: BackColor: " + UserPreference.BackColor.ToString()); + + Money cash = new Money(); + cash.Amount = 100M; + Console.WriteLine("cash.ToString() returns: " + cash.ToString()); + cash.AddToAmount(20M); + Console.WriteLine("cash.ToString() returns: " + cash.ToString()); + } + } +} diff --git a/ProCS4Net4/CH03ObjectType/MathEntry.cs b/ProCS4Net4/CH03ObjectType/MathEntry.cs new file mode 100644 index 0000000..9b6664b --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/MathEntry.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + class MathEntry + { + static void Main(string[ ] args) + { + Console.WriteLine("圆周率是 " + MathLib.GetPi()); + int x = MathLib.GetSquareOf(5); + Console.WriteLine("5的平方是 " + x); + + MathLib math = new MathLib(); + math.value = 30; + Console.WriteLine("30的平方是 " + math.GetSquare()); + } + } +} diff --git a/ProCS4Net4/CH03ObjectType/MathLib.cs b/ProCS4Net4/CH03ObjectType/MathLib.cs new file mode 100644 index 0000000..e34057e --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/MathLib.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + class MathLib + { + public int value; + + public int GetSquare() + { + return value * value; + } + + public static int GetSquareOf(int x) + { + return x * x; + } + + public static double GetPi() + { + return 3.14159265; + } + } +} diff --git a/ProCS4Net4/CH03ObjectType/Money.cs b/ProCS4Net4/CH03ObjectType/Money.cs new file mode 100644 index 0000000..ecd1bb4 --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/Money.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + class Money + { + private decimal amount; + public decimal Amount + { + get { return amount; } + set { amount = value; } + } + + public override string ToString() + { + return "$" + Amount.ToString(); + } + } +} diff --git a/ProCS4Net4/CH03ObjectType/MoneyExtension.cs b/ProCS4Net4/CH03ObjectType/MoneyExtension.cs new file mode 100644 index 0000000..9cf84fe --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/MoneyExtension.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + static class MoneyExtension + { + public static void AddToAmount(this Money money, decimal amountToAdd) + { + money.Amount += amountToAdd; + } + } +} diff --git a/ProCS4Net4/CH03ObjectType/ParameterTest.cs b/ProCS4Net4/CH03ObjectType/ParameterTest.cs new file mode 100644 index 0000000..54d8365 --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/ParameterTest.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + class ParameterTest + { + static void Main(string[ ] args) + { + //int i = 0; + int[ ] ints = { 0, 1, 2, 3, 4, 5 }; + int i = 1; + double x = 1.0; + //int[ ] ints; + + //Console.WriteLine("i = " + i); + Console.WriteLine("int[0] = " + ints[0]); + Console.WriteLine("Calling SomeFunc"); + + SomeFunc(ints, i); + Console.WriteLine("i = " + i); + Console.WriteLine("int[0] = " + ints[0]); + + Console.WriteLine(FullName(lastName: "Chang", firstName: "Thons")); + + Display(ref x); + Console.WriteLine(x); + } + + static void SomeFunc(int[ ] ints, int i) + { + ints[0] = 100; + i = 100; + } + + static string FullName(string firstName, string lastName, string country = "China") + { + return firstName + " " + lastName + " " + country; + } + + static void Display(double x) + { + x = 50.0; + } + + static void Display(ref double x) + { + x = 50.0; + } + } +} diff --git a/ProCS4Net4/CH03ObjectType/Properties/AssemblyInfo.cs b/ProCS4Net4/CH03ObjectType/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e62a180 --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("CH03ObjectType")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("CH03ObjectType")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("22748109-f866-4902-9c09-cc3bf1b98df6")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 内部版本号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ProCS4Net4/CH03ObjectType/StructSample.cs b/ProCS4Net4/CH03ObjectType/StructSample.cs new file mode 100644 index 0000000..5633e14 --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/StructSample.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH03ObjectType +{ + struct StructSample + { + public double Length; + public double Width; + + public StructSample(double length, double width) + { + this.Length = length; + this.Width = width; + } + } +} diff --git a/ProCS4Net4/CH03ObjectType/UserPreference.cs b/ProCS4Net4/CH03ObjectType/UserPreference.cs new file mode 100644 index 0000000..0e38591 --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/UserPreference.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Drawing; + +namespace CH03ObjectType +{ + class UserPreference + { + public static readonly Color BackColor; + + static UserPreference() + { + DateTime now = DateTime.Now; + if (now.DayOfWeek == DayOfWeek.Saturday || now.DayOfWeek == DayOfWeek.Sunday) + BackColor = Color.Red; + else + BackColor = Color.Green; + } + } +} diff --git a/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.exe b/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.exe new file mode 100644 index 0000000..56d15b7 Binary files /dev/null and b/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.exe differ diff --git a/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.pdb b/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.pdb new file mode 100644 index 0000000..6164dde Binary files /dev/null and b/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.pdb differ diff --git a/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.vshost.exe b/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.vshost.exe differ diff --git a/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.vshost.exe.manifest b/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/bin/Debug/CH03ObjectType.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ProCS4Net4/CH03ObjectType/obj/x86/Debug/CH03ObjectType.csproj.FileListAbsolute.txt b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/CH03ObjectType.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..ddf8e14 --- /dev/null +++ b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/CH03ObjectType.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH03ObjectType\bin\Debug\CH03ObjectType.exe +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH03ObjectType\bin\Debug\CH03ObjectType.pdb +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH03ObjectType\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH03ObjectType\obj\x86\Debug\CH03ObjectType.exe +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\CH03ObjectType\obj\x86\Debug\CH03ObjectType.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH03ObjectType\obj\x86\Debug\CH03ObjectType.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH03ObjectType\obj\x86\Debug\CH03ObjectType.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH03ObjectType\bin\Debug\CH03ObjectType.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH03ObjectType\bin\Debug\CH03ObjectType.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH03ObjectType\obj\x86\Debug\ResolveAssemblyReference.cache diff --git a/ProCS4Net4/CH03ObjectType/obj/x86/Debug/CH03ObjectType.exe b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/CH03ObjectType.exe new file mode 100644 index 0000000..56d15b7 Binary files /dev/null and b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/CH03ObjectType.exe differ diff --git a/ProCS4Net4/CH03ObjectType/obj/x86/Debug/CH03ObjectType.pdb b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/CH03ObjectType.pdb new file mode 100644 index 0000000..6164dde Binary files /dev/null and b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/CH03ObjectType.pdb differ diff --git a/ProCS4Net4/CH03ObjectType/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..71d8e8a Binary files /dev/null and b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ProCS4Net4/CH03ObjectType/obj/x86/Debug/ResolveAssemblyReference.cache b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/ResolveAssemblyReference.cache new file mode 100644 index 0000000..68c3795 Binary files /dev/null and b/ProCS4Net4/CH03ObjectType/obj/x86/Debug/ResolveAssemblyReference.cache differ diff --git a/ProCS4Net4/CH04Inherit/CH04Inherit.csproj b/ProCS4Net4/CH04Inherit/CH04Inherit.csproj new file mode 100644 index 0000000..fd77162 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/CH04Inherit.csproj @@ -0,0 +1,71 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {CA9B9123-FAD6-4C2B-92E0-AFBE82ACE433} + Exe + Properties + CH04Inherit + CH04Inherit + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + CH04Inherit.MainEntry + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProCS4Net4/CH04Inherit/CurrentAccount.cs b/ProCS4Net4/CH04Inherit/CurrentAccount.cs new file mode 100644 index 0000000..fcc606c --- /dev/null +++ b/ProCS4Net4/CH04Inherit/CurrentAccount.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + class CurrentAccount : ITransferBankAccount + { + public bool TransferTo(IBankAccount destination, decimal amount) + { + bool result; + result = Withdraw(amount); + if (result) + destination.PayIn(amount); + return result; + } + + private decimal balance; + public void PayIn(decimal amount) + { + balance += amount; + } + + public bool Withdraw(decimal amount) + { + if (balance >= amount) + { + balance -= amount; + return true; + } + Console.WriteLine("余额不足!"); + return false; + } + + public decimal Balance + { + get { return balance; } + } + + public override string ToString() + { + return string.Format("Jupter Bank Account :{0,6:C}", balance); + } + } +} diff --git a/ProCS4Net4/CH04Inherit/GoldAccount.cs b/ProCS4Net4/CH04Inherit/GoldAccount.cs new file mode 100644 index 0000000..05ec5b8 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/GoldAccount.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + public class GoldAccount : IBankAccount + { + private decimal balance; + public void PayIn(decimal amount) + { + balance += amount; + } + + public bool Withdraw(decimal amount) + { + if (balance >= amount) + { + balance -= amount; + return true; + } + Console.WriteLine("余额不足!"); + return false; + } + + public decimal Balance + { + get { return balance; } + } + + public override string ToString() + { + return String.Format("Jupter Bank Saver: 余额为:{0,6:C}", balance); + } + } +} diff --git a/ProCS4Net4/CH04Inherit/IBankAccount.cs b/ProCS4Net4/CH04Inherit/IBankAccount.cs new file mode 100644 index 0000000..ca57004 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/IBankAccount.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + interface IBankAccount + { + void PayIn(decimal amount); + bool Withdraw(decimal amount); + decimal Balance + { + get; + } + } +} diff --git a/ProCS4Net4/CH04Inherit/ITransferBankAccount.cs b/ProCS4Net4/CH04Inherit/ITransferBankAccount.cs new file mode 100644 index 0000000..95b1772 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/ITransferBankAccount.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + interface ITransferBankAccount:IBankAccount + { + bool TransferTo(IBankAccount destination, decimal amount); + } +} diff --git a/ProCS4Net4/CH04Inherit/MainEntry.cs b/ProCS4Net4/CH04Inherit/MainEntry.cs new file mode 100644 index 0000000..c91a3fc --- /dev/null +++ b/ProCS4Net4/CH04Inherit/MainEntry.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + class MainEntry + { + static void Main(string[ ] args) + { + IBankAccount venusAccount = new SaverAccount(); + ITransferBankAccount jupterAccount = new CurrentAccount(); + venusAccount.PayIn(200); + Console.WriteLine(venusAccount.ToString()); + venusAccount.Withdraw(300); + Console.WriteLine(venusAccount.ToString()); + jupterAccount.PayIn(500); + jupterAccount.TransferTo(venusAccount, 100); + Console.WriteLine(venusAccount.ToString()); + Console.WriteLine(jupterAccount.ToString()); + } + } +} diff --git a/ProCS4Net4/CH04Inherit/MyAbsDerivedClass.cs b/ProCS4Net4/CH04Inherit/MyAbsDerivedClass.cs new file mode 100644 index 0000000..51d3c56 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/MyAbsDerivedClass.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + class MyAbsDerivedClass:MyAbstructClass + { + static void Main(string[ ] args) + { + MyAbsDerivedClass ad = new MyAbsDerivedClass(); + Console.WriteLine(ad.AbstructMethod()); + } + + public override string AbstructMethod() + { + return "This is MyAbstructMethod class derived..."; + } + } +} diff --git a/ProCS4Net4/CH04Inherit/MyAbstructClass.cs b/ProCS4Net4/CH04Inherit/MyAbstructClass.cs new file mode 100644 index 0000000..6e51cc6 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/MyAbstructClass.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + abstract class MyAbstructClass + { + public abstract string AbstructMethod(); + } +} diff --git a/ProCS4Net4/CH04Inherit/MyBaseClass.cs b/ProCS4Net4/CH04Inherit/MyBaseClass.cs new file mode 100644 index 0000000..abcd1c7 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/MyBaseClass.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + class MyBaseClass + { + public virtual string VirtualMethod() + { + return "This is a virtual method..."; + } + + public string NonVirtualMethod() + { + return "This is not a virtual method..."; + } + + public virtual decimal CalculatePrice() + { + return 10.0M; + } + } +} diff --git a/ProCS4Net4/CH04Inherit/MyDerivedClass.cs b/ProCS4Net4/CH04Inherit/MyDerivedClass.cs new file mode 100644 index 0000000..c659d53 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/MyDerivedClass.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + class MyDerivedClass:MyBaseClass + { + static void Main(string[ ] args) + { + MyBaseClass b = new MyBaseClass(); + MyDerivedClass d = new MyDerivedClass(); + Console.WriteLine(b.VirtualMethod()); + Console.WriteLine(b.NonVirtualMethod()); + Console.WriteLine(d.VirtualMethod()); + Console.WriteLine(d.NonVirtualMethod()); + Console.WriteLine(d.CalculatePrice()); + } + + public override string VirtualMethod() + { + return base.VirtualMethod(); + } + + public new string NonVirtualMethod() + { + return "This is a derived method..."; + } + + public override decimal CalculatePrice() + { + return base.CalculatePrice() * 0.9M; + } + } +} diff --git a/ProCS4Net4/CH04Inherit/MySealedClass.cs b/ProCS4Net4/CH04Inherit/MySealedClass.cs new file mode 100644 index 0000000..5d356c2 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/MySealedClass.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + sealed class MySealedClass + { + } +} diff --git a/ProCS4Net4/CH04Inherit/MySealedDerivedClass.cs b/ProCS4Net4/CH04Inherit/MySealedDerivedClass.cs new file mode 100644 index 0000000..2644370 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/MySealedDerivedClass.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + class MySealedDerivedClass //:MySealedClass Will give a compilation error... + { + + } +} diff --git a/ProCS4Net4/CH04Inherit/Properties/AssemblyInfo.cs b/ProCS4Net4/CH04Inherit/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1786f4f --- /dev/null +++ b/ProCS4Net4/CH04Inherit/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Inherit")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Inherit")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("d65f6025-f378-4f46-9e49-8d7c8088c801")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 内部版本号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ProCS4Net4/CH04Inherit/SaverAccount.cs b/ProCS4Net4/CH04Inherit/SaverAccount.cs new file mode 100644 index 0000000..53f537d --- /dev/null +++ b/ProCS4Net4/CH04Inherit/SaverAccount.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH04Inherit +{ + public class SaverAccount : IBankAccount + { + private decimal balance; + public void PayIn(decimal amount) + { + balance += amount; + } + + public bool Withdraw(decimal amount) + { + if (balance >= amount) + { + balance -= amount; + return true; + } + Console.WriteLine("余额不足!"); + return false; + } + + public decimal Balance + { + get { return balance; } + } + + public override string ToString() + { + return String.Format("Venus Bank Saver: 余额为:{0,6:C}", balance); + } + } +} diff --git a/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.exe b/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.exe new file mode 100644 index 0000000..1e4722d Binary files /dev/null and b/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.exe differ diff --git a/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.pdb b/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.pdb new file mode 100644 index 0000000..0437eb9 Binary files /dev/null and b/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.pdb differ diff --git a/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.vshost.exe b/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.vshost.exe differ diff --git a/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.vshost.exe.manifest b/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/ProCS4Net4/CH04Inherit/bin/Debug/CH04Inherit.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ProCS4Net4/CH04Inherit/obj/x86/Debug/CH04Inherit.csproj.FileListAbsolute.txt b/ProCS4Net4/CH04Inherit/obj/x86/Debug/CH04Inherit.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..6405214 --- /dev/null +++ b/ProCS4Net4/CH04Inherit/obj/x86/Debug/CH04Inherit.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\Inherit\bin\Debug\CH04Inherit.exe +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\Inherit\bin\Debug\CH04Inherit.pdb +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\Inherit\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\Inherit\obj\x86\Debug\CH04Inherit.exe +C:\Users\Thons\ProCS\ProCS4Net4\ProCS4Net4\Inherit\obj\x86\Debug\CH04Inherit.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH04Inherit\obj\x86\Debug\CH04Inherit.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH04Inherit\obj\x86\Debug\CH04Inherit.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH04Inherit\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\CH04Inherit\bin\Debug\CH04Inherit.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH04Inherit\bin\Debug\CH04Inherit.pdb diff --git a/ProCS4Net4/CH04Inherit/obj/x86/Debug/CH04Inherit.exe b/ProCS4Net4/CH04Inherit/obj/x86/Debug/CH04Inherit.exe new file mode 100644 index 0000000..1e4722d Binary files /dev/null and b/ProCS4Net4/CH04Inherit/obj/x86/Debug/CH04Inherit.exe differ diff --git a/ProCS4Net4/CH04Inherit/obj/x86/Debug/CH04Inherit.pdb b/ProCS4Net4/CH04Inherit/obj/x86/Debug/CH04Inherit.pdb new file mode 100644 index 0000000..0437eb9 Binary files /dev/null and b/ProCS4Net4/CH04Inherit/obj/x86/Debug/CH04Inherit.pdb differ diff --git a/ProCS4Net4/CH04Inherit/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache b/ProCS4Net4/CH04Inherit/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..c6c8d79 Binary files /dev/null and b/ProCS4Net4/CH04Inherit/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/ProCS4Net4/CH04Inherit/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/ProCS4Net4/CH04Inherit/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..acb485d Binary files /dev/null and b/ProCS4Net4/CH04Inherit/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ProCS4Net4/CH04Inherit/obj/x86/Debug/ResolveAssemblyReference.cache b/ProCS4Net4/CH04Inherit/obj/x86/Debug/ResolveAssemblyReference.cache new file mode 100644 index 0000000..dc2b16b Binary files /dev/null and b/ProCS4Net4/CH04Inherit/obj/x86/Debug/ResolveAssemblyReference.cache differ diff --git a/ProCS4Net4/CH05Generics/Account.cs b/ProCS4Net4/CH05Generics/Account.cs new file mode 100644 index 0000000..9d328eb --- /dev/null +++ b/ProCS4Net4/CH05Generics/Account.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class Account : IAccount + { + public string Name { get; set; } + public decimal Balance { get; set; } + + public Account(string name, decimal balance) + { + this.Name = name; + this.Balance = balance; + } + } +} diff --git a/ProCS4Net4/CH05Generics/CH05Generics.csproj b/ProCS4Net4/CH05Generics/CH05Generics.csproj new file mode 100644 index 0000000..516cab4 --- /dev/null +++ b/ProCS4Net4/CH05Generics/CH05Generics.csproj @@ -0,0 +1,79 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {DC5A287C-09E0-45BB-A241-67562C1EE7C9} + Exe + Properties + CH05Generics + CH05Generics + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + CH05Generics.Program + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProCS4Net4/CH05Generics/Calc.cs b/ProCS4Net4/CH05Generics/Calc.cs new file mode 100644 index 0000000..fb272b9 --- /dev/null +++ b/ProCS4Net4/CH05Generics/Calc.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public abstract class Calc + { + public abstract T Add(T x, T y); + public abstract T Sub(T x, T y); + } +} diff --git a/ProCS4Net4/CH05Generics/Document.cs b/ProCS4Net4/CH05Generics/Document.cs new file mode 100644 index 0000000..b88e01a --- /dev/null +++ b/ProCS4Net4/CH05Generics/Document.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class Document : IDocument + { + public string Title { get; set; } + public string Content { get; set; } + + public Document() { } + + public Document(string title, string content) + { + this.Title = title; + this.Content = content; + } + } +} diff --git a/ProCS4Net4/CH05Generics/DocumentManager.cs b/ProCS4Net4/CH05Generics/DocumentManager.cs new file mode 100644 index 0000000..efacb14 --- /dev/null +++ b/ProCS4Net4/CH05Generics/DocumentManager.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class DocumentManager + where TDocument : IDocument + { + private readonly Queue documentQuene = new Queue(); + + public void AddDocument(TDocument doc) + { + lock (this) + { + documentQuene.Enqueue(doc); + } + } + + public bool IsDocumentAvailable + { + get { return documentQuene.Count > 0; } + } + + public TDocument GetDocument() + { + TDocument doc = default(TDocument); + lock (this) + { + doc = documentQuene.Dequeue(); + } + return doc; + } + + public void DisplayAllDocuments() + { + foreach (TDocument doc in documentQuene) + { + Console.WriteLine(doc.Title); + } + } + } +} diff --git a/ProCS4Net4/CH05Generics/DocumentSample.cs b/ProCS4Net4/CH05Generics/DocumentSample.cs new file mode 100644 index 0000000..9dbdb4a --- /dev/null +++ b/ProCS4Net4/CH05Generics/DocumentSample.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + class DocumentSample + { + static void Main(string[ ] args) + { + var dm = new DocumentManager(); + dm.AddDocument(new Document("Title A", "Content A")); + dm.AddDocument(new Document("Title B", "Content B")); + + dm.DisplayAllDocuments(); + + if (dm.IsDocumentAvailable) + { + Document d = dm.GetDocument(); + Console.WriteLine(d.Content); + } + } + } +} diff --git a/ProCS4Net4/CH05Generics/IAccount.cs b/ProCS4Net4/CH05Generics/IAccount.cs new file mode 100644 index 0000000..db2005a --- /dev/null +++ b/ProCS4Net4/CH05Generics/IAccount.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public interface IAccount + { + decimal Balance { get; } + string Name { get; } + } +} diff --git a/ProCS4Net4/CH05Generics/IDisplay.cs b/ProCS4Net4/CH05Generics/IDisplay.cs new file mode 100644 index 0000000..5d42494 --- /dev/null +++ b/ProCS4Net4/CH05Generics/IDisplay.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public interface IDisplay + { + void Show(T item); + } +} diff --git a/ProCS4Net4/CH05Generics/IDocument.cs b/ProCS4Net4/CH05Generics/IDocument.cs new file mode 100644 index 0000000..0faa0a5 --- /dev/null +++ b/ProCS4Net4/CH05Generics/IDocument.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public interface IDocument + { + string Title { get; set; } + string Content { get; set; } + } +} diff --git a/ProCS4Net4/CH05Generics/IIndex.cs b/ProCS4Net4/CH05Generics/IIndex.cs new file mode 100644 index 0000000..6e641a6 --- /dev/null +++ b/ProCS4Net4/CH05Generics/IIndex.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public interface IIndex + { + T this[int index] { get; } + int Count { get; } + } +} diff --git a/ProCS4Net4/CH05Generics/IntCalc.cs b/ProCS4Net4/CH05Generics/IntCalc.cs new file mode 100644 index 0000000..7f6f436 --- /dev/null +++ b/ProCS4Net4/CH05Generics/IntCalc.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class IntCalc:Calc + { + public override int Add(int x, int y) + { + return x + y; + } + + public override int Sub(int x, int y) + { + return x - y; + } + } +} diff --git a/ProCS4Net4/CH05Generics/LinkedList.cs b/ProCS4Net4/CH05Generics/LinkedList.cs new file mode 100644 index 0000000..5d20a0d --- /dev/null +++ b/ProCS4Net4/CH05Generics/LinkedList.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; + +namespace CH05Generics +{ + public class LinkedList : IEnumerable + { + public LinkedListNode First { get; private set; } + public LinkedListNode Last { get; private set; } + + public LinkedListNode AddLast(object node) + { + var newNode = new LinkedListNode(node); + if (First == null) + { + First = newNode; + newNode.Prev = Last; + Last = First; + } + else + { + LinkedListNode prev = Last; + Last.Next = newNode; + Last = newNode; + Last.Prev = prev; + } + return newNode; + } + + public IEnumerator GetEnumerator() + { + LinkedListNode current = First; + while (current != null) + { + yield return current.Value; + current = current.Next; + } + } + } +} diff --git a/ProCS4Net4/CH05Generics/LinkedListNode.cs b/ProCS4Net4/CH05Generics/LinkedListNode.cs new file mode 100644 index 0000000..4a70599 --- /dev/null +++ b/ProCS4Net4/CH05Generics/LinkedListNode.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class LinkedListNode + { + public object Value { get; private set; } + + public LinkedListNode(object value) + { + this.Value = value; + } + + public LinkedListNode Next { get; internal set; } + public LinkedListNode Prev { get; internal set; } + } +} diff --git a/ProCS4Net4/CH05Generics/MethodOverloads.cs b/ProCS4Net4/CH05Generics/MethodOverloads.cs new file mode 100644 index 0000000..67ff3ed --- /dev/null +++ b/ProCS4Net4/CH05Generics/MethodOverloads.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class MethodOverloads + { + public void Foo(T obj) + { + Console.WriteLine(""); + } + } +} diff --git a/ProCS4Net4/CH05Generics/Nullable.cs b/ProCS4Net4/CH05Generics/Nullable.cs new file mode 100644 index 0000000..193d47f --- /dev/null +++ b/ProCS4Net4/CH05Generics/Nullable.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public struct Nullable + where T : struct + { + private bool hasValue; + public bool HasValue + { + get { return hasValue; } + } + + private T value; + public T Value + { + get + { + if (!hasValue) + throw new InvalidOperationException("no value"); + return value; + } + } + + public Nullable(T value) + { + this.value = value; + this.hasValue = true; + } + + public static explicit operator T(Nullable value) + { + return value.Value; + } + + public static implicit operator Nullable(T value) + { + return new Nullable(value); + } + + public override string ToString() + { + if (!HasValue) + return String.Empty; + return this.value.ToString(); + } + } +} diff --git a/ProCS4Net4/CH05Generics/Program.cs b/ProCS4Net4/CH05Generics/Program.cs new file mode 100644 index 0000000..c6d4126 --- /dev/null +++ b/ProCS4Net4/CH05Generics/Program.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + class Program + { + static void Main(string[ ] args) + { + StaticDemo.x = 4; + StaticDemo.x = 5; + Console.WriteLine(StaticDemo.x); + + Console.WriteLine(); + + IIndex rectangles = RectangleCollection.GetCollections(); + IIndex shapes = rectangles; + + for (int i = 0; i < shapes.Count; i++) + { + Console.WriteLine(shapes[i]); + } + + Console.WriteLine(); + + IDisplay shapeDisplay = new ShapeDisplay(); + IDisplay rectangleDisplay = shapeDisplay; + rectangleDisplay.Show(rectangles[0]); + + List accounts = new List() + { + new Account("Thons",100), + new Account("Thons1",1100), + new Account("Thons11",11100) + }; + + decimal amount = Accumulate(accounts); + Console.WriteLine(amount); + } + + static decimal Accumulate(IEnumerable source) + where TAccount : IAccount + { + decimal sum = 0; + foreach (TAccount a in source) + { + sum += a.Balance; + } + return sum; + } + } +} diff --git a/ProCS4Net4/CH05Generics/Properties/AssemblyInfo.cs b/ProCS4Net4/CH05Generics/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2d24400 --- /dev/null +++ b/ProCS4Net4/CH05Generics/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("CH05Generics")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("CH05Generics")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("5bdeaac6-d53a-4d72-b5b0-79278c002096")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 内部版本号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ProCS4Net4/CH05Generics/Rectangle.cs b/ProCS4Net4/CH05Generics/Rectangle.cs new file mode 100644 index 0000000..36701a2 --- /dev/null +++ b/ProCS4Net4/CH05Generics/Rectangle.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class Rectangle : Shape + { + } +} diff --git a/ProCS4Net4/CH05Generics/RectangleCollection.cs b/ProCS4Net4/CH05Generics/RectangleCollection.cs new file mode 100644 index 0000000..e1755ac --- /dev/null +++ b/ProCS4Net4/CH05Generics/RectangleCollection.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class RectangleCollection : IIndex + { + private Rectangle[ ] data = new Rectangle[3] + { + new Rectangle {Height=2,Width=5}, + new Rectangle {Height=3,Width=7}, + new Rectangle {Height=4,Width=8} + }; + + public static RectangleCollection GetCollections() + { + return new RectangleCollection(); + } + + public Rectangle this[int index] + { + get + { + if (index < 0 || index > data.Length) + throw new ArgumentOutOfRangeException("index"); + return data[index]; + } + } + + public int Count + { + get { return data.Length; } + } + } +} diff --git a/ProCS4Net4/CH05Generics/Shape.cs b/ProCS4Net4/CH05Generics/Shape.cs new file mode 100644 index 0000000..f3d87d7 --- /dev/null +++ b/ProCS4Net4/CH05Generics/Shape.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class Shape + { + public double Width { get; set; } + public double Height { get; set; } + + public override string ToString() + { + return String.Format("Width: {0}, Height: {1}", Width, Height); + } + } +} diff --git a/ProCS4Net4/CH05Generics/ShapeDisplay.cs b/ProCS4Net4/CH05Generics/ShapeDisplay.cs new file mode 100644 index 0000000..8f45ce7 --- /dev/null +++ b/ProCS4Net4/CH05Generics/ShapeDisplay.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class ShapeDisplay : IDisplay + { + public void Show(Shape item) + { + Console.WriteLine("{0} Width: {1}, Height: {2}", item.GetType().Name, item.Width, item.Height); + } + } +} diff --git a/ProCS4Net4/CH05Generics/StaticDemo.cs b/ProCS4Net4/CH05Generics/StaticDemo.cs new file mode 100644 index 0000000..f4ace5c --- /dev/null +++ b/ProCS4Net4/CH05Generics/StaticDemo.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH05Generics +{ + public class StaticDemo + { + public static int x; + } +} diff --git a/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.exe b/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.exe new file mode 100644 index 0000000..b3d852e Binary files /dev/null and b/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.exe differ diff --git a/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.pdb b/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.pdb new file mode 100644 index 0000000..f591e64 Binary files /dev/null and b/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.pdb differ diff --git a/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.vshost.exe b/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.vshost.exe differ diff --git a/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.vshost.exe.manifest b/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/ProCS4Net4/CH05Generics/bin/Debug/CH05Generics.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ProCS4Net4/CH05Generics/obj/x86/Debug/CH05Generics.csproj.FileListAbsolute.txt b/ProCS4Net4/CH05Generics/obj/x86/Debug/CH05Generics.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..20e3f0b --- /dev/null +++ b/ProCS4Net4/CH05Generics/obj/x86/Debug/CH05Generics.csproj.FileListAbsolute.txt @@ -0,0 +1,5 @@ +C:\Users\Thons\ProCS\ProCS4Net4\CH05Generics\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\CH05Generics\bin\Debug\CH05Generics.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH05Generics\bin\Debug\CH05Generics.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH05Generics\obj\x86\Debug\CH05Generics.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH05Generics\obj\x86\Debug\CH05Generics.pdb diff --git a/ProCS4Net4/CH05Generics/obj/x86/Debug/CH05Generics.exe b/ProCS4Net4/CH05Generics/obj/x86/Debug/CH05Generics.exe new file mode 100644 index 0000000..b3d852e Binary files /dev/null and b/ProCS4Net4/CH05Generics/obj/x86/Debug/CH05Generics.exe differ diff --git a/ProCS4Net4/CH05Generics/obj/x86/Debug/CH05Generics.pdb b/ProCS4Net4/CH05Generics/obj/x86/Debug/CH05Generics.pdb new file mode 100644 index 0000000..f591e64 Binary files /dev/null and b/ProCS4Net4/CH05Generics/obj/x86/Debug/CH05Generics.pdb differ diff --git a/ProCS4Net4/CH05Generics/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache b/ProCS4Net4/CH05Generics/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..c6c8d79 Binary files /dev/null and b/ProCS4Net4/CH05Generics/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/ProCS4Net4/CH05Generics/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/ProCS4Net4/CH05Generics/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..07df813 Binary files /dev/null and b/ProCS4Net4/CH05Generics/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ProCS4Net4/CH06Array/CH06Array.csproj b/ProCS4Net4/CH06Array/CH06Array.csproj new file mode 100644 index 0000000..9a60856 --- /dev/null +++ b/ProCS4Net4/CH06Array/CH06Array.csproj @@ -0,0 +1,63 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {A82FB957-92D5-4796-B261-4A7846FC7BBD} + Exe + Properties + CH06Array + CH06Array + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProCS4Net4/CH06Array/GameMoves.cs b/ProCS4Net4/CH06Array/GameMoves.cs new file mode 100644 index 0000000..6c34c57 --- /dev/null +++ b/ProCS4Net4/CH06Array/GameMoves.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; + +namespace CH06Array +{ + class GameMoves + { + private IEnumerator cross; + private IEnumerator circle; + + public GameMoves() + { + cross = Cross(); + circle = Circle(); + } + + private int move = 0; + const int MaxMoves = 9; + + public IEnumerator Cross() + { + while (true) + { + Console.WriteLine("Cross, move {0}", move); + if (++move >= MaxMoves) yield break; + yield return circle; + } + } + + public IEnumerator Circle() + { + while (true) + { + Console.WriteLine("Circle, move {0}", move); + if (++move >= MaxMoves) yield break; + yield return cross; + } + } + } +} diff --git a/ProCS4Net4/CH06Array/HelloCollection.cs b/ProCS4Net4/CH06Array/HelloCollection.cs new file mode 100644 index 0000000..e72b4a2 --- /dev/null +++ b/ProCS4Net4/CH06Array/HelloCollection.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; + +namespace CH06Array +{ + class HelloCollection + { + public IEnumerator GetEnumerator() + { + yield return "Hello"; + yield return "World"; + } + + public class Enumerator : IEnumerator, IEnumerator, IDisposable + { + private int state; + private string current; + + public Enumerator(int state) + { + this.state = state; + } + + public void Dispose() { } + + public object Current + { + get { throw new NotImplementedException(); } + } + + bool IEnumerator.MoveNext() + { + throw new NotImplementedException(); + } + + public void Reset() + { + throw new NotSupportedException(); + } + + object IEnumerator.Current + { + get { return current; } + } + + string IEnumerator.Current + { + get { return current; } + } + } + + } +} diff --git a/ProCS4Net4/CH06Array/MusicTitles.cs b/ProCS4Net4/CH06Array/MusicTitles.cs new file mode 100644 index 0000000..333e490 --- /dev/null +++ b/ProCS4Net4/CH06Array/MusicTitles.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH06Array +{ + class MusicTitles + { + string[ ] names = { "Tubular Bells", "Hergest Ridge", "Ommadawn" }; + + public IEnumerator GetEnumerator() + { + for (int i = 0; i < 3; i++) + { + yield return names[i]; + } + } + + public IEnumerable Reverse() + { + for (int i = 2; i >= 0; i--) + { + yield return names[i]; + } + } + + public IEnumerable Subset(int index, int length) + { + for (int i = index; i < index + length; i++) + { + yield return names[i]; + } + } + } +} diff --git a/ProCS4Net4/CH06Array/Person.cs b/ProCS4Net4/CH06Array/Person.cs new file mode 100644 index 0000000..5a3dc1d --- /dev/null +++ b/ProCS4Net4/CH06Array/Person.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH06Array +{ + class Person : IEquatable + { + public string ID { get; private set; } + public string FirstName { get; set; } + public string LastName { get; set; } + + public override string ToString() + { + return String.Format("{2}, {0} {1}", FirstName, LastName, ID); + } + + public bool Equals(Person other) + { + if (other == null) throw new ArgumentNullException("other"); + return this.ID == other.ID && this.FirstName == other.FirstName && this.LastName == other.LastName; + } + + public override bool Equals(object obj) + { + if (obj == null) throw new ArgumentNullException("obj"); + return Equals(obj as Person); + } + + public override int GetHashCode() + { + return ID.GetHashCode(); + } + } +} diff --git a/ProCS4Net4/CH06Array/PersonComparer.cs b/ProCS4Net4/CH06Array/PersonComparer.cs new file mode 100644 index 0000000..5b74294 --- /dev/null +++ b/ProCS4Net4/CH06Array/PersonComparer.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH06Array +{ + public enum PersonCompareType + { + FirstName, + LastName + } + + class PersonComparer:IComparer + { + private PersonCompareType comparerType; + + public PersonComparer(PersonCompareType compareType) + { + this.comparerType = compareType; + } + + public int Compare(Person x, Person y) + { + if (x == null) throw new ArgumentNullException("x"); + if (y == null) throw new ArgumentNullException("y"); + + switch (comparerType) + { + case PersonCompareType.FirstName: + return x.FirstName.CompareTo(y.FirstName); + case PersonCompareType.LastName: + return x.LastName.CompareTo(y.LastName); + default: + throw new ArgumentException("unexcepted compare type..."); + } + } + } +} diff --git a/ProCS4Net4/CH06Array/Program.cs b/ProCS4Net4/CH06Array/Program.cs new file mode 100644 index 0000000..7f4c537 --- /dev/null +++ b/ProCS4Net4/CH06Array/Program.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; + +namespace CH06Array +{ + class Program + { + static void Main(string[ ] args) + { + int[ ] onedim = { 1, 2, 3 }; + int[,] twodim = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }; + int[, ,] threedim = { { { 1, 2 }, { 3, 4 } }, { { 5, 6 }, { 7, 8 } }, { { 9, 10 }, { 11, 12 } } }; + + int[ ][ ] jagged = new int[3][ ]; + jagged[0] = new int[2] { 1, 2 }; + jagged[1] = new int[6] { 3, 4, 5, 6, 7, 8 }; + jagged[2] = new int[3] { 9, 10, 11 }; + + Array intArr1 = Array.CreateInstance(typeof(int), 5); + for (int i = 0; i < 5; i++) + { + intArr1.SetValue(12, i); + } + + Console.WriteLine("这是一个{0}维数组。", threedim.Rank); + for (int row = 0; row < jagged.Length; row++) + { + for (int element = 0; element < jagged[row].Length; element++) + { + Console.WriteLine("锯齿数组:第{0}行,第{1}个元素,值为{2}", row + 1, element + 1, jagged[row][element]); + } + } + + Console.WriteLine(); + + for (int i = 0; i < 5; i++) + { + Console.WriteLine(intArr1.GetValue(i)); + } + + Console.WriteLine(); + + int[ ] intArr2 = (int[ ])intArr1; + //int[ ] lengths = { 2, 3 }; + //int[ ] lowerBounds = { 1, 10 }; + Array racers = Array.CreateInstance(typeof(Person), 4); + racers.SetValue(new Person { FirstName = "Thons", LastName = "Chang" }, 0); + racers.SetValue(new Person { FirstName = "Leo", LastName = "Sans" }, 1); + racers.SetValue(new Person { FirstName = "Thons2", LastName = "Chang" }, 2); + racers.SetValue(new Person { FirstName = "Leo2", LastName = "Sans" }, 3); + + int[ ] intArr3 = { 1, 2 }; + int[ ] intArr4 = (int[ ])intArr3.Clone(); + + Console.WriteLine(onedim[1]); + Console.WriteLine(twodim[1, 1]); + Console.WriteLine(threedim[1, 1, 1]); + + Console.WriteLine(); + + //Array.Sort((Person[ ])(racers)); + Array.Sort((Person[ ])(racers), new PersonComparer(PersonCompareType.FirstName)); + //foreach (var item in racers) + //{ + // Console.WriteLine(item); + //} + + int[ ] arr1 = { 1, 4, 5, 11, 13, 18 }; + int[ ] arr2 = { 3, 4, 5, 18, 21, 27, 33 }; + + var segement = new ArraySegment[2] { new ArraySegment(arr1, 0, 3), new ArraySegment(arr2, 3, 3) }; + var sum = SumOfSegments(segement); + Console.WriteLine(sum); + Console.WriteLine(); + var result = TupleSample.Divide(5, 2); + Console.WriteLine("Result of division: {0}, reminder: {1}", result.Item1, result.Item2); + + var janet = new Person { FirstName = "Janet", LastName = "Jackson" }; + Person[ ] person1 = { new Person { FirstName = "Michael", LastName = "Jackson" }, janet }; + Person[ ] person2 = { new Person { FirstName = "Michael", LastName = "Jackson" }, janet }; + if (person1 != person2) Console.WriteLine("Not the same reference"); + if (!(person1 == person2)) Console.WriteLine("Not the same reference"); + + var titles = new MusicTitles(); + foreach (var item in titles) + { + Console.WriteLine(item); + } + foreach (var item in titles.Reverse()) + { + Console.WriteLine(item); + } + foreach (var item in titles.Subset(1, 2)) + { + Console.WriteLine(item); + } + + Console.WriteLine(); + + var game = new GameMoves(); + IEnumerator enumerator = game.Cross(); + while (enumerator.MoveNext()) + { + enumerator = enumerator.Current as IEnumerator; + } + } + + static int SumOfSegments(ArraySegment[ ] segements) + { + int sum = 0; + foreach (var segment in segements) + { + for (int i = segment.Offset; i < segment.Offset + segment.Count; i++) + { + sum += segment.Array[i]; + } + } + return sum; + } + } +} diff --git a/ProCS4Net4/CH06Array/Properties/AssemblyInfo.cs b/ProCS4Net4/CH06Array/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b8446cf --- /dev/null +++ b/ProCS4Net4/CH06Array/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("CH06Array")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("CH06Array")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("9945c8d9-91ad-4e1d-b92e-c680304600f7")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 内部版本号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ProCS4Net4/CH06Array/TupleSample.cs b/ProCS4Net4/CH06Array/TupleSample.cs new file mode 100644 index 0000000..05f8e79 --- /dev/null +++ b/ProCS4Net4/CH06Array/TupleSample.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH06Array +{ + public static class TupleSample + { + public static Tuple Divide(int dividend, int divisor) + { + int result = dividend / divisor; + int reminder = dividend / divisor; + + return Tuple.Create(result, reminder); + } + } +} diff --git a/ProCS4Net4/CH06Array/bin/Debug/CH06Array.exe b/ProCS4Net4/CH06Array/bin/Debug/CH06Array.exe new file mode 100644 index 0000000..f600686 Binary files /dev/null and b/ProCS4Net4/CH06Array/bin/Debug/CH06Array.exe differ diff --git a/ProCS4Net4/CH06Array/bin/Debug/CH06Array.pdb b/ProCS4Net4/CH06Array/bin/Debug/CH06Array.pdb new file mode 100644 index 0000000..14a0dbb Binary files /dev/null and b/ProCS4Net4/CH06Array/bin/Debug/CH06Array.pdb differ diff --git a/ProCS4Net4/CH06Array/bin/Debug/CH06Array.vshost.exe b/ProCS4Net4/CH06Array/bin/Debug/CH06Array.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/ProCS4Net4/CH06Array/bin/Debug/CH06Array.vshost.exe differ diff --git a/ProCS4Net4/CH06Array/bin/Debug/CH06Array.vshost.exe.manifest b/ProCS4Net4/CH06Array/bin/Debug/CH06Array.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/ProCS4Net4/CH06Array/bin/Debug/CH06Array.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ProCS4Net4/CH06Array/obj/x86/Debug/CH06Array.csproj.FileListAbsolute.txt b/ProCS4Net4/CH06Array/obj/x86/Debug/CH06Array.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..c718053 --- /dev/null +++ b/ProCS4Net4/CH06Array/obj/x86/Debug/CH06Array.csproj.FileListAbsolute.txt @@ -0,0 +1,5 @@ +C:\Users\Thons\ProCS\ProCS4Net4\CH06Array\bin\Debug\CH06Array.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH06Array\bin\Debug\CH06Array.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH06Array\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\CH06Array\obj\x86\Debug\CH06Array.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH06Array\obj\x86\Debug\CH06Array.pdb diff --git a/ProCS4Net4/CH06Array/obj/x86/Debug/CH06Array.exe b/ProCS4Net4/CH06Array/obj/x86/Debug/CH06Array.exe new file mode 100644 index 0000000..f600686 Binary files /dev/null and b/ProCS4Net4/CH06Array/obj/x86/Debug/CH06Array.exe differ diff --git a/ProCS4Net4/CH06Array/obj/x86/Debug/CH06Array.pdb b/ProCS4Net4/CH06Array/obj/x86/Debug/CH06Array.pdb new file mode 100644 index 0000000..14a0dbb Binary files /dev/null and b/ProCS4Net4/CH06Array/obj/x86/Debug/CH06Array.pdb differ diff --git a/ProCS4Net4/CH06Array/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/ProCS4Net4/CH06Array/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..4820592 Binary files /dev/null and b/ProCS4Net4/CH06Array/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ProCS4Net4/CH06Array/obj/x86/Debug/ResolveAssemblyReference.cache b/ProCS4Net4/CH06Array/obj/x86/Debug/ResolveAssemblyReference.cache new file mode 100644 index 0000000..dc2b16b Binary files /dev/null and b/ProCS4Net4/CH06Array/obj/x86/Debug/ResolveAssemblyReference.cache differ diff --git a/ProCS4Net4/CH07OperatorsTypeCast/CH07OperatorsTypeCast.csproj b/ProCS4Net4/CH07OperatorsTypeCast/CH07OperatorsTypeCast.csproj new file mode 100644 index 0000000..352c778 --- /dev/null +++ b/ProCS4Net4/CH07OperatorsTypeCast/CH07OperatorsTypeCast.csproj @@ -0,0 +1,60 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {2459F2A7-D8A5-4A1E-9A61-5F37CDBC9767} + Exe + Properties + CH07OperatorsTypeCast + CH07OperatorsTypeCast + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProCS4Net4/CH07OperatorsTypeCast/Currency.cs b/ProCS4Net4/CH07OperatorsTypeCast/Currency.cs new file mode 100644 index 0000000..61e5526 --- /dev/null +++ b/ProCS4Net4/CH07OperatorsTypeCast/Currency.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH07OperatorsTypeCast +{ + class Currency + { + public uint Dollars; + public ushort Cents; + + public Currency(uint dollars, ushort cents) + { + this.Dollars = dollars; + this.Cents = cents; + } + + public override string ToString() + { + return String.Format(" ${0}.{1, -2:00}", Dollars, Cents); + } + + public static implicit operator float(Currency value) + { + return value.Dollars + (value.Cents / 100f); + } + + public static explicit operator Currency(float value) + { + checked + { + uint dollars = (uint)value; + ushort cents = System.Convert.ToUInt16((value - dollars) * 100); + return new Currency(dollars, cents); + } + } + + public static implicit operator Currency(uint value) + { + return new Currency(value, 0); + } + + public static implicit operator uint(Currency value) + { + return value.Dollars; + } + } +} diff --git a/ProCS4Net4/CH07OperatorsTypeCast/Program.cs b/ProCS4Net4/CH07OperatorsTypeCast/Program.cs new file mode 100644 index 0000000..d601afd --- /dev/null +++ b/ProCS4Net4/CH07OperatorsTypeCast/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH07OperatorsTypeCast +{ + class Program + { + static void Main(string[ ] args) + { + int? int1 = null; + int int2 = int1 ?? 20; + Console.WriteLine(int2); + Vector vect1 = new Vector(1, 2, 3); + Vector vect2 = new Vector(4, 5, 6); + Console.WriteLine(vect1 + vect2); + Console.ReadLine(); + } + } +} diff --git a/ProCS4Net4/CH07OperatorsTypeCast/Properties/AssemblyInfo.cs b/ProCS4Net4/CH07OperatorsTypeCast/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c7f51d4 --- /dev/null +++ b/ProCS4Net4/CH07OperatorsTypeCast/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("CH07OperatorsTypeCast")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("CH07OperatorsTypeCast")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("13ad6b69-1c0d-4488-9d2c-e795fddb4531")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 内部版本号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ProCS4Net4/CH07OperatorsTypeCast/Vector.cs b/ProCS4Net4/CH07OperatorsTypeCast/Vector.cs new file mode 100644 index 0000000..55e1c4d --- /dev/null +++ b/ProCS4Net4/CH07OperatorsTypeCast/Vector.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CH07OperatorsTypeCast +{ + struct Vector + { + public double x, y, z; + + public Vector(double x, double y, double z) + { + this.x = x; + this.y = y; + this.z = z; + } + + public Vector(Vector rhs) + { + x = rhs.x; + y = rhs.y; + z = rhs.z; + } + + public override string ToString() + { + return "(" + x + ", " + y + ", " + z + ")"; + } + + public static Vector operator +(Vector lhs, Vector rhs) + { + Vector result = new Vector(lhs); + result.x += rhs.x; + result.y += rhs.y; + result.z += rhs.z; + + return result; + } + + public static Vector operator -(Vector lhs, Vector rhs) + { + Vector result = new Vector(lhs); + result.x -= rhs.x; + result.y -= rhs.y; + result.z -= rhs.z; + + return result; + } + + public static Vector operator *(double lhs, Vector rhs) + { + return new Vector(lhs * rhs.x, lhs * rhs.y, lhs * rhs.z); + } + + public static Vector operator *(Vector lhs, double rhs) + { + return rhs * lhs; + } + + public static double operator *(Vector lhs, Vector rhs) + { + return lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z; + } + + public static bool operator ==(Vector lhs, Vector rhs) + { + if (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z) + return true; + else + return false; + } + + public static bool operator !=(Vector lhs, Vector rhs) + { + return !(lhs == rhs); + } + } +} diff --git a/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.exe b/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.exe new file mode 100644 index 0000000..4b2d93b Binary files /dev/null and b/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.exe differ diff --git a/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.pdb b/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.pdb new file mode 100644 index 0000000..0aac90d Binary files /dev/null and b/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.pdb differ diff --git a/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.vshost.exe b/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.vshost.exe new file mode 100644 index 0000000..bb84a51 Binary files /dev/null and b/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.vshost.exe differ diff --git a/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.vshost.exe.manifest b/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.vshost.exe.manifest new file mode 100644 index 0000000..061c9ca --- /dev/null +++ b/ProCS4Net4/CH07OperatorsTypeCast/bin/Debug/CH07OperatorsTypeCast.vshost.exe.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/CH07OperatorsTypeCast.csproj.FileListAbsolute.txt b/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/CH07OperatorsTypeCast.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..279857d --- /dev/null +++ b/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/CH07OperatorsTypeCast.csproj.FileListAbsolute.txt @@ -0,0 +1,5 @@ +C:\Users\Thons\ProCS\ProCS4Net4\CH07OperatorsTypeCast\bin\Debug\CH07OperatorsTypeCast.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH07OperatorsTypeCast\bin\Debug\CH07OperatorsTypeCast.pdb +C:\Users\Thons\ProCS\ProCS4Net4\CH07OperatorsTypeCast\obj\x86\Debug\ResolveAssemblyReference.cache +C:\Users\Thons\ProCS\ProCS4Net4\CH07OperatorsTypeCast\obj\x86\Debug\CH07OperatorsTypeCast.exe +C:\Users\Thons\ProCS\ProCS4Net4\CH07OperatorsTypeCast\obj\x86\Debug\CH07OperatorsTypeCast.pdb diff --git a/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/CH07OperatorsTypeCast.exe b/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/CH07OperatorsTypeCast.exe new file mode 100644 index 0000000..4b2d93b Binary files /dev/null and b/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/CH07OperatorsTypeCast.exe differ diff --git a/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/CH07OperatorsTypeCast.pdb b/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/CH07OperatorsTypeCast.pdb new file mode 100644 index 0000000..0aac90d Binary files /dev/null and b/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/CH07OperatorsTypeCast.pdb differ diff --git a/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..8488ab9 Binary files /dev/null and b/ProCS4Net4/CH07OperatorsTypeCast/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ProCS4Net4/ProCS4Net4.sln b/ProCS4Net4/ProCS4Net4.sln new file mode 100644 index 0000000..8d1ef87 --- /dev/null +++ b/ProCS4Net4/ProCS4Net4.sln @@ -0,0 +1,56 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH01NetArchitecture", "CH01NetArchitecture\CH01NetArchitecture.csproj", "{4A7C290F-8788-40F7-9749-5D719EE22C99}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH02CoreCSharp", "CH02CoreCSharp\CH02CoreCSharp.csproj", "{E5B0DDD9-1C14-42FA-961D-7FF560A0434D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH03ObjectType", "CH03ObjectType\CH03ObjectType.csproj", "{EB01C997-F653-4946-87FB-B7B8454186CD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH04Inherit", "CH04Inherit\CH04Inherit.csproj", "{CA9B9123-FAD6-4C2B-92E0-AFBE82ACE433}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH05Generics", "CH05Generics\CH05Generics.csproj", "{DC5A287C-09E0-45BB-A241-67562C1EE7C9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH06Array", "CH06Array\CH06Array.csproj", "{A82FB957-92D5-4796-B261-4A7846FC7BBD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CH07OperatorsTypeCast", "CH07OperatorsTypeCast\CH07OperatorsTypeCast.csproj", "{2459F2A7-D8A5-4A1E-9A61-5F37CDBC9767}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4A7C290F-8788-40F7-9749-5D719EE22C99}.Debug|x86.ActiveCfg = Debug|x86 + {4A7C290F-8788-40F7-9749-5D719EE22C99}.Debug|x86.Build.0 = Debug|x86 + {4A7C290F-8788-40F7-9749-5D719EE22C99}.Release|x86.ActiveCfg = Release|x86 + {4A7C290F-8788-40F7-9749-5D719EE22C99}.Release|x86.Build.0 = Release|x86 + {E5B0DDD9-1C14-42FA-961D-7FF560A0434D}.Debug|x86.ActiveCfg = Debug|x86 + {E5B0DDD9-1C14-42FA-961D-7FF560A0434D}.Debug|x86.Build.0 = Debug|x86 + {E5B0DDD9-1C14-42FA-961D-7FF560A0434D}.Release|x86.ActiveCfg = Release|x86 + {E5B0DDD9-1C14-42FA-961D-7FF560A0434D}.Release|x86.Build.0 = Release|x86 + {EB01C997-F653-4946-87FB-B7B8454186CD}.Debug|x86.ActiveCfg = Debug|x86 + {EB01C997-F653-4946-87FB-B7B8454186CD}.Debug|x86.Build.0 = Debug|x86 + {EB01C997-F653-4946-87FB-B7B8454186CD}.Release|x86.ActiveCfg = Release|x86 + {EB01C997-F653-4946-87FB-B7B8454186CD}.Release|x86.Build.0 = Release|x86 + {CA9B9123-FAD6-4C2B-92E0-AFBE82ACE433}.Debug|x86.ActiveCfg = Debug|x86 + {CA9B9123-FAD6-4C2B-92E0-AFBE82ACE433}.Debug|x86.Build.0 = Debug|x86 + {CA9B9123-FAD6-4C2B-92E0-AFBE82ACE433}.Release|x86.ActiveCfg = Release|x86 + {CA9B9123-FAD6-4C2B-92E0-AFBE82ACE433}.Release|x86.Build.0 = Release|x86 + {DC5A287C-09E0-45BB-A241-67562C1EE7C9}.Debug|x86.ActiveCfg = Debug|x86 + {DC5A287C-09E0-45BB-A241-67562C1EE7C9}.Debug|x86.Build.0 = Debug|x86 + {DC5A287C-09E0-45BB-A241-67562C1EE7C9}.Release|x86.ActiveCfg = Release|x86 + {DC5A287C-09E0-45BB-A241-67562C1EE7C9}.Release|x86.Build.0 = Release|x86 + {A82FB957-92D5-4796-B261-4A7846FC7BBD}.Debug|x86.ActiveCfg = Debug|x86 + {A82FB957-92D5-4796-B261-4A7846FC7BBD}.Debug|x86.Build.0 = Debug|x86 + {A82FB957-92D5-4796-B261-4A7846FC7BBD}.Release|x86.ActiveCfg = Release|x86 + {A82FB957-92D5-4796-B261-4A7846FC7BBD}.Release|x86.Build.0 = Release|x86 + {2459F2A7-D8A5-4A1E-9A61-5F37CDBC9767}.Debug|x86.ActiveCfg = Debug|x86 + {2459F2A7-D8A5-4A1E-9A61-5F37CDBC9767}.Debug|x86.Build.0 = Debug|x86 + {2459F2A7-D8A5-4A1E-9A61-5F37CDBC9767}.Release|x86.ActiveCfg = Release|x86 + {2459F2A7-D8A5-4A1E-9A61-5F37CDBC9767}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ProCS4Net4/ProCS4Net4.suo b/ProCS4Net4/ProCS4Net4.suo new file mode 100644 index 0000000..b4afd8d Binary files /dev/null and b/ProCS4Net4/ProCS4Net4.suo differ diff --git a/README b/README index d68809e..898918d 100644 --- a/README +++ b/README @@ -1 +1,15 @@ -这是用来学习《WPF程序设计指南 Applications = Code + Markup》等书籍而开设的github页面。 +这是用来学习《C#高级编程(第七版)》、《CLR via C#》、《WPF程序设计指南》等书籍而开设的github页面。 + +目前所涉及书籍有: + + 1.《C#高级编程(第七版)》 + + 2.《CLR via C#》 + + 3.《WPF程序设计指南》 + + 4.《.NET 4.0面向对象编程漫谈》 + + 5.《Windows 3D图形编程》 + + 6. …… \ No newline at end of file diff --git a/hotfix.txt b/hotfix.txt deleted file mode 100644 index b93c58b..0000000 --- a/hotfix.txt +++ /dev/null @@ -1 +0,0 @@ -This is a hotfix!!! \ No newline at end of file