diff --git a/03 - Classes 101/A Simple Class/Build1.bat b/03 - Classes 101/A Simple Class/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/03 - Classes 101/A Simple Class/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/03 - Classes 101/A Simple Class/Build2.bat b/03 - Classes 101/A Simple Class/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/03 - Classes 101/A Simple Class/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/03 - Classes 101/A Simple Class/File_1.cs b/03 - Classes 101/A Simple Class/File_1.cs
new file mode 100644
index 0000000..e292f94
--- /dev/null
+++ b/03 - Classes 101/A Simple Class/File_1.cs
@@ -0,0 +1,13 @@
+// 05 - Classes 101\A Simple Class
+// copyright 2000 Eric Gunnerson
+class VerySimple
+{
+ int simpleValue = 0;
+}
+class Test
+{
+ public static void Main()
+ {
+ VerySimple vs = new VerySimple();
+ }
+}
\ No newline at end of file
diff --git a/03 - Classes 101/A Simple Class/File_2.cs b/03 - Classes 101/A Simple Class/File_2.cs
new file mode 100644
index 0000000..ed4ba6f
--- /dev/null
+++ b/03 - Classes 101/A Simple Class/File_2.cs
@@ -0,0 +1,26 @@
+// 05 - Classes 101\A Simple Class
+// copyright 2000 Eric Gunnerson
+using System;
+class Point
+{
+ // constructor
+ public Point(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+
+ // member fields
+ public int x;
+ public int y;
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Point myPoint = new Point(10, 15);
+ Console.WriteLine("myPoint.x {0}", myPoint.x);
+ Console.WriteLine("myPoint.y {0}", myPoint.y);
+ }
+}
\ No newline at end of file
diff --git a/03 - Classes 101/Member Functions/Build1.bat b/03 - Classes 101/Member Functions/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/03 - Classes 101/Member Functions/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/03 - Classes 101/Member Functions/File_1.cs b/03 - Classes 101/Member Functions/File_1.cs
new file mode 100644
index 0000000..d28141b
--- /dev/null
+++ b/03 - Classes 101/Member Functions/File_1.cs
@@ -0,0 +1,29 @@
+// 05 - Classes 101\Member Functions
+// copyright 2000 Eric Gunnerson
+using System;
+class Point
+{
+ public Point(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+
+ // accessor functions
+public int GetX() {return(x);}
+public int GetY() {return(y);}
+
+ // variables now private
+ int x;
+ int y;
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Point myPoint = new Point(10, 15);
+ Console.WriteLine("myPoint.X {0}", myPoint.GetX());
+ Console.WriteLine("myPoint.Y {0}", myPoint.GetY());
+ }
+}
\ No newline at end of file
diff --git a/03 - Classes 101/Overloading/Build1.bat b/03 - Classes 101/Overloading/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/03 - Classes 101/Overloading/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/03 - Classes 101/Overloading/File_1.cs b/03 - Classes 101/Overloading/File_1.cs
new file mode 100644
index 0000000..f13159d
--- /dev/null
+++ b/03 - Classes 101/Overloading/File_1.cs
@@ -0,0 +1,29 @@
+// 05 - Classes 101\Overloading
+// copyright 2000 Eric Gunnerson
+class Point
+{
+ // create a new point from x and y values
+ public Point(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+ // create a point from an existing point
+ public Point(Point p)
+ {
+ this.x = p.x;
+ this.y = p.y;
+ }
+
+ int x;
+ int y;
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Point myPoint = new Point(10, 15);
+ Point mySecondPoint = new Point(myPoint);
+ }
+}
\ No newline at end of file
diff --git a/03 - Classes 101/Ref and Out Parameters/Build1.bat b/03 - Classes 101/Ref and Out Parameters/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/03 - Classes 101/Ref and Out Parameters/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/03 - Classes 101/Ref and Out Parameters/Build2.bat b/03 - Classes 101/Ref and Out Parameters/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/03 - Classes 101/Ref and Out Parameters/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/03 - Classes 101/Ref and Out Parameters/Build3.bat b/03 - Classes 101/Ref and Out Parameters/Build3.bat
new file mode 100644
index 0000000..b764232
--- /dev/null
+++ b/03 - Classes 101/Ref and Out Parameters/Build3.bat
@@ -0,0 +1 @@
+csc File_3.cs
diff --git a/03 - Classes 101/Ref and Out Parameters/File_1.cs b/03 - Classes 101/Ref and Out Parameters/File_1.cs
new file mode 100644
index 0000000..d36b7ec
--- /dev/null
+++ b/03 - Classes 101/Ref and Out Parameters/File_1.cs
@@ -0,0 +1,35 @@
+// 05 - Classes 101\Ref and Out Parameters
+// copyright 2000 Eric Gunnerson
+// error
+using System;
+class Point
+{
+ public Point(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+ // get both values in one function call
+ public void GetPoint(ref int x, ref int y)
+ {
+ x = this.x;
+ y = this.y;
+ }
+
+ int x;
+ int y;
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Point myPoint = new Point(10, 15);
+ int x;
+ int y;
+
+ // illegal
+ myPoint.GetPoint(ref x, ref y);
+ Console.WriteLine("myPoint({0}, {1})", x, y);
+ }
+}
\ No newline at end of file
diff --git a/03 - Classes 101/Ref and Out Parameters/File_2.cs b/03 - Classes 101/Ref and Out Parameters/File_2.cs
new file mode 100644
index 0000000..0629326
--- /dev/null
+++ b/03 - Classes 101/Ref and Out Parameters/File_2.cs
@@ -0,0 +1,33 @@
+// 05 - Classes 101\Ref and Out Parameters
+// copyright 2000 Eric Gunnerson
+using System;
+class Point
+{
+ public Point(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+
+ public void GetPoint(ref int x, ref int y)
+ {
+ x = this.x;
+ y = this.y;
+ }
+
+ int x;
+ int y;
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Point myPoint = new Point(10, 15);
+ int x = 0;
+ int y = 0;
+
+ myPoint.GetPoint(ref x, ref y);
+ Console.WriteLine("myPoint({0}, {1})", x, y);
+ }
+}
\ No newline at end of file
diff --git a/03 - Classes 101/Ref and Out Parameters/File_3.cs b/03 - Classes 101/Ref and Out Parameters/File_3.cs
new file mode 100644
index 0000000..7e8a57f
--- /dev/null
+++ b/03 - Classes 101/Ref and Out Parameters/File_3.cs
@@ -0,0 +1,33 @@
+// 05 - Classes 101\Ref and Out Parameters
+// copyright 2000 Eric Gunnerson
+using System;
+class Point
+{
+ public Point(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+
+ public void GetPoint(out int x, out int y)
+ {
+ x = this.x;
+ y = this.y;
+ }
+
+ int x;
+ int y;
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Point myPoint = new Point(10, 15);
+ int x;
+ int y;
+
+ myPoint.GetPoint(out x, out y);
+ Console.WriteLine("myPoint({0}, {1})", x, y);
+ }
+}
\ No newline at end of file
diff --git a/04 - Base Classes and Inheritance/Abstract Classes/Build1.bat b/04 - Base Classes and Inheritance/Abstract Classes/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Abstract Classes/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/04 - Base Classes and Inheritance/Abstract Classes/Build2.bat b/04 - Base Classes and Inheritance/Abstract Classes/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Abstract Classes/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/04 - Base Classes and Inheritance/Abstract Classes/File_1.cs b/04 - Base Classes and Inheritance/Abstract Classes/File_1.cs
new file mode 100644
index 0000000..c2ce0fc
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Abstract Classes/File_1.cs
@@ -0,0 +1,49 @@
+// 06 - Base Classes and Inheritance\Abstract Classes
+// copyright 2000 Eric Gunnerson
+using System;
+class Engineer
+{
+ public Engineer(string name, float billingRate)
+ {
+ this.name = name;
+ this.billingRate = billingRate;
+ }
+
+ virtual public float CalculateCharge(float hours)
+ {
+ return(hours * billingRate);
+ }
+
+ virtual public string TypeName()
+ {
+ return("Engineer");
+ }
+
+ private string name;
+ protected float billingRate;
+}
+class ChemicalEngineer: Engineer
+{
+ public ChemicalEngineer(string name, float billingRate) :
+ base(name, billingRate)
+ {
+ }
+
+ // overrides mistakenly omitted
+}
+class Test
+{
+ public static void Main()
+ {
+ Engineer[] earray = new Engineer[2];
+ earray[0] = new Engineer("George", 15.50F);
+ earray[1] = new ChemicalEngineer("Dr. Curie", 45.50F);
+
+ Console.WriteLine("{0} charge = {1}",
+ earray[0].TypeName(),
+ earray[0].CalculateCharge(2F));
+ Console.WriteLine("{0} charge = {1}",
+ earray[1].TypeName(),
+ earray[1].CalculateCharge(0.75F));
+ }
+}
\ No newline at end of file
diff --git a/04 - Base Classes and Inheritance/Abstract Classes/File_2.cs b/04 - Base Classes and Inheritance/Abstract Classes/File_2.cs
new file mode 100644
index 0000000..382ffa6
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Abstract Classes/File_2.cs
@@ -0,0 +1,71 @@
+// 06 - Base Classes and Inheritance\Abstract Classes
+// copyright 2000 Eric Gunnerson
+using System;
+abstract class Engineer
+{
+ public Engineer(string name, float billingRate)
+ {
+ this.name = name;
+ this.billingRate = billingRate;
+ }
+
+ virtual public float CalculateCharge(float hours)
+ {
+ return(hours * billingRate);
+ }
+
+ abstract public string TypeName();
+
+ private string name;
+ protected float billingRate;
+}
+
+class CivilEngineer: Engineer
+{
+ public CivilEngineer(string name, float billingRate) :
+ base(name, billingRate)
+ {
+ }
+
+ override public float CalculateCharge(float hours)
+ {
+ if (hours < 1.0F)
+ hours = 1.0F; // minimum charge.
+ return(hours * billingRate);
+ }
+
+ // This override is required, or an error is generated.
+ override public string TypeName()
+ {
+ return("Civil Engineer");
+ }
+}
+
+class ChemicalEngineer: Engineer
+{
+ public ChemicalEngineer(string name, float billingRate) :
+ base(name, billingRate)
+ {
+ }
+
+ override public string TypeName()
+ {
+ return("Chemical Engineer");
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Engineer[] earray = new Engineer[2];
+ earray[0] = new CivilEngineer("Sir John", 40.0F);
+ earray[1] = new ChemicalEngineer("Dr. Curie", 45.0F);
+
+ Console.WriteLine("{0} charge = {1}",
+ earray[0].TypeName(),
+ earray[0].CalculateCharge(2F));
+ Console.WriteLine("{0} charge = {1}",
+ earray[1].TypeName(),
+ earray[1].CalculateCharge(0.75F));
+ }
+}
\ No newline at end of file
diff --git a/04 - Base Classes and Inheritance/Arrays of Engineers/Build1.bat b/04 - Base Classes and Inheritance/Arrays of Engineers/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Arrays of Engineers/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/04 - Base Classes and Inheritance/Arrays of Engineers/Build3.bat b/04 - Base Classes and Inheritance/Arrays of Engineers/Build3.bat
new file mode 100644
index 0000000..b764232
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Arrays of Engineers/Build3.bat
@@ -0,0 +1 @@
+csc File_3.cs
diff --git a/04 - Base Classes and Inheritance/Arrays of Engineers/File_1.cs b/04 - Base Classes and Inheritance/Arrays of Engineers/File_1.cs
new file mode 100644
index 0000000..6ea83e7
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Arrays of Engineers/File_1.cs
@@ -0,0 +1,60 @@
+// 06 - Base Classes and Inheritance\Arrays of Engineers
+// copyright 2000 Eric Gunnerson
+using System;
+class Engineer
+{
+ public Engineer(string name, float billingRate)
+ {
+ this.name = name;
+ this.billingRate = billingRate;
+ }
+
+ public float CalculateCharge(float hours)
+ {
+ return(hours * billingRate);
+ }
+
+ public string TypeName()
+ {
+ return("Engineer");
+ }
+
+ private string name;
+ protected float billingRate;
+}
+class CivilEngineer: Engineer
+{
+ public CivilEngineer(string name, float billingRate) :
+ base(name, billingRate)
+ {
+ }
+
+ public new float CalculateCharge(float hours)
+ {
+ if (hours < 1.0F)
+ hours = 1.0F; // minimum charge.
+ return(hours * billingRate);
+ }
+
+ public new string TypeName()
+ {
+ return("Civil Engineer");
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ // create an array of engineers
+ Engineer[] earray = new Engineer[2];
+ earray[0] = new Engineer("George", 15.50F);
+ earray[1] = new CivilEngineer("Sir John", 40F);
+
+ Console.WriteLine("{0} charge = {1}",
+ earray[0].TypeName(),
+ earray[0].CalculateCharge(2F));
+ Console.WriteLine("{0} charge = {1}",
+ earray[1].TypeName(),
+ earray[1].CalculateCharge(0.75F));
+ }
+}
\ No newline at end of file
diff --git a/04 - Base Classes and Inheritance/Arrays of Engineers/File_3.cs b/04 - Base Classes and Inheritance/Arrays of Engineers/File_3.cs
new file mode 100644
index 0000000..afacd83
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Arrays of Engineers/File_3.cs
@@ -0,0 +1,82 @@
+// 06 - Base Classes and Inheritance\Arrays of Engineers
+// copyright 2000 Eric Gunnerson
+using System;
+enum EngineerTypeEnum
+{
+ Engineer,
+ CivilEngineer
+}
+class Engineer
+{
+ public Engineer(string name, float billingRate)
+ {
+ this.name = name;
+ this.billingRate = billingRate;
+ type = EngineerTypeEnum.Engineer;
+ }
+
+ public float CalculateCharge(float hours)
+ {
+ if (type == EngineerTypeEnum.CivilEngineer)
+ {
+ CivilEngineer c = (CivilEngineer) this;
+ return(c.CalculateCharge(hours));
+ }
+ else if (type == EngineerTypeEnum.Engineer)
+ return(hours * billingRate);
+ return(0F);
+ }
+
+ public string TypeName()
+ {
+ if (type == EngineerTypeEnum.CivilEngineer)
+ {
+ CivilEngineer c = (CivilEngineer) this;
+ return(c.TypeName());
+ }
+ else if (type == EngineerTypeEnum.Engineer)
+ return("Engineer");
+ return("No Type Matched");
+ }
+
+ private string name;
+ protected float billingRate;
+ protected EngineerTypeEnum type;
+}
+
+class CivilEngineer: Engineer
+{
+ public CivilEngineer(string name, float billingRate) :
+ base(name, billingRate)
+ {
+ type = EngineerTypeEnum.CivilEngineer;
+ }
+
+ public new float CalculateCharge(float hours)
+ {
+ if (hours < 1.0F)
+ hours = 1.0F; // minimum charge.
+ return(hours * billingRate);
+ }
+
+ public new string TypeName()
+ {
+ return("Civil Engineer");
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Engineer[] earray = new Engineer[2];
+ earray[0] = new Engineer("George", 15.50F);
+ earray[1] = new CivilEngineer("Sir John", 40F);
+
+ Console.WriteLine("{0} charge = {1}",
+ earray[0].TypeName(),
+ earray[0].CalculateCharge(2F));
+ Console.WriteLine("{0} charge = {1}",
+ earray[1].TypeName(),
+ earray[1].CalculateCharge(0.75F));
+ }
+}
\ No newline at end of file
diff --git a/04 - Base Classes and Inheritance/Sealed Classes and Methods/Build1.bat b/04 - Base Classes and Inheritance/Sealed Classes and Methods/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Sealed Classes and Methods/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/04 - Base Classes and Inheritance/Sealed Classes and Methods/File_1.cs b/04 - Base Classes and Inheritance/Sealed Classes and Methods/File_1.cs
new file mode 100644
index 0000000..a75f4ef
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Sealed Classes and Methods/File_1.cs
@@ -0,0 +1,10 @@
+// 06 - Base Classes and Inheritance\Sealed Classes and Methods
+// copyright 2000 Eric Gunnerson
+// error
+sealed class MyClass
+{
+ MyClass() {}
+}
+class MyNewClass : MyClass
+{
+}
\ No newline at end of file
diff --git a/04 - Base Classes and Inheritance/Simple Inheritance/Build1.bat b/04 - Base Classes and Inheritance/Simple Inheritance/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Simple Inheritance/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/04 - Base Classes and Inheritance/Simple Inheritance/File_1.cs b/04 - Base Classes and Inheritance/Simple Inheritance/File_1.cs
new file mode 100644
index 0000000..f897b1f
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Simple Inheritance/File_1.cs
@@ -0,0 +1,60 @@
+// 06 - Base Classes and Inheritance\Simple Inheritance
+// copyright 2000 Eric Gunnerson
+using System;
+class Engineer
+{
+ public Engineer(string name, float billingRate)
+ {
+ this.name = name;
+ this.billingRate = billingRate;
+ }
+
+ public float CalculateCharge(float hours)
+ {
+ return(hours * billingRate);
+ }
+
+ public string TypeName()
+ {
+ return("Engineer");
+ }
+
+ private string name;
+ protected float billingRate;
+}
+class CivilEngineer: Engineer
+{
+ public CivilEngineer(string name, float billingRate) :
+ base(name, billingRate)
+ {
+ }
+ // new function, because it's different than the
+ // base version
+ public new float CalculateCharge(float hours)
+ {
+ if (hours < 1.0F)
+ hours = 1.0F; // minimum charge.
+ return(hours * billingRate);
+ }
+ // new function, because it's different than the
+ // base version
+ public new string TypeName()
+ {
+ return("Civil Engineer");
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Engineer e = new Engineer("George", 15.50F);
+ CivilEngineer c = new CivilEngineer("Sir John", 40F);
+
+ Console.WriteLine("{0} charge = {1}",
+ e.TypeName(),
+ e.CalculateCharge(2F));
+ Console.WriteLine("{0} charge = {1}",
+ c.TypeName(),
+ c.CalculateCharge(0.75F));
+ }
+}
\ No newline at end of file
diff --git a/04 - Base Classes and Inheritance/The Engineer Class/Build1.bat b/04 - Base Classes and Inheritance/The Engineer Class/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/04 - Base Classes and Inheritance/The Engineer Class/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/04 - Base Classes and Inheritance/The Engineer Class/File_1.cs b/04 - Base Classes and Inheritance/The Engineer Class/File_1.cs
new file mode 100644
index 0000000..d8fe167
--- /dev/null
+++ b/04 - Base Classes and Inheritance/The Engineer Class/File_1.cs
@@ -0,0 +1,33 @@
+// 06 - Base Classes and Inheritance\The Engineer Class
+// copyright 2000 Eric Gunnerson
+using System;
+class Engineer
+{
+ // constructor
+ public Engineer(string name, float billingRate)
+ {
+ this.name = name;
+ this.billingRate = billingRate;
+ }
+ // figure out the charge based on engineer's rate
+ public float CalculateCharge(float hours)
+ {
+ return(hours * billingRate);
+ }
+ // return the name of this type
+ public string TypeName()
+ {
+ return("Engineer");
+ }
+
+ private string name;
+ protected float billingRate;
+}
+class Test
+{
+ public static void Main()
+ {
+ Engineer engineer = new Engineer("Hank", 21.20F);
+ Console.WriteLine("Name is: {0}", engineer.TypeName());
+ }
+}
\ No newline at end of file
diff --git a/04 - Base Classes and Inheritance/Virtual Functions/Build1.bat b/04 - Base Classes and Inheritance/Virtual Functions/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Virtual Functions/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/04 - Base Classes and Inheritance/Virtual Functions/File_1.cs b/04 - Base Classes and Inheritance/Virtual Functions/File_1.cs
new file mode 100644
index 0000000..54266e0
--- /dev/null
+++ b/04 - Base Classes and Inheritance/Virtual Functions/File_1.cs
@@ -0,0 +1,60 @@
+// 06 - Base Classes and Inheritance\Virtual Functions
+// copyright 2000 Eric Gunnerson
+using System;
+class Engineer
+{
+ public Engineer(string name, float billingRate)
+ {
+ this.name = name;
+ this.billingRate = billingRate;
+ }
+ // function now virtual
+ virtual public float CalculateCharge(float hours)
+ {
+ return(hours * billingRate);
+ }
+ // function now virtual
+ virtual public string TypeName()
+ {
+ return("Engineer");
+ }
+
+ private string name;
+ protected float billingRate;
+}
+
+class CivilEngineer: Engineer
+{
+ public CivilEngineer(string name, float billingRate) :
+ base(name, billingRate)
+ {
+ }
+ // overrides function in Engineer
+ override public float CalculateCharge(float hours)
+ {
+ if (hours < 1.0F)
+ hours = 1.0F; // minimum charge.
+ return(hours * billingRate);
+ }
+ // overrides function in Engineer
+ override public string TypeName()
+ {
+ return("Civil Engineer");
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Engineer[] earray = new Engineer[2];
+ earray[0] = new Engineer("George", 15.50F);
+ earray[1] = new CivilEngineer("Sir John", 40F);
+
+ Console.WriteLine("{0} charge = {1}",
+ earray[0].TypeName(),
+ earray[0].CalculateCharge(2F));
+ Console.WriteLine("{0} charge = {1}",
+ earray[1].TypeName(),
+ earray[1].CalculateCharge(0.75F));
+ }
+}
\ No newline at end of file
diff --git a/05 - Exception Handling/Finally/Build1.bat b/05 - Exception Handling/Finally/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/05 - Exception Handling/Finally/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/05 - Exception Handling/Finally/File_1.cs b/05 - Exception Handling/Finally/File_1.cs
new file mode 100644
index 0000000..e8f2dca
--- /dev/null
+++ b/05 - Exception Handling/Finally/File_1.cs
@@ -0,0 +1,55 @@
+// 04 - Exception Handling\Finally
+// copyright 2000 Eric Gunnerson
+using System;
+using System.IO;
+class Processor
+{
+ int count;
+ int sum;
+ public int average;
+ void CalculateAverage(int countAdd, int sumAdd)
+ {
+ count += countAdd;
+ sum += sumAdd;
+ average = sum / count;
+ }
+ public void ProcessFile()
+ {
+ FileStream f = new FileStream("data.txt", FileMode.Open);
+ try
+ {
+ StreamReader t = new StreamReader(f);
+ string line;
+ while ((line = t.ReadLine()) != null)
+ {
+ int count;
+ int sum;
+ count = Convert.ToInt32(line);
+ line = t.ReadLine();
+ sum = Convert.ToInt32(line);
+ CalculateAverage(count, sum);
+ }
+ }
+ // always executed before function exit, even if an
+ // exception was thrown in the try.
+ finally
+ {
+ f.Close();
+ }
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Processor processor = new Processor();
+ try
+ {
+ processor.ProcessFile();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception: {0}", e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Confuse/Build1.bat b/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Confuse/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Confuse/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Confuse/File_1.cs b/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Confuse/File_1.cs
new file mode 100644
index 0000000..1357f14
--- /dev/null
+++ b/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Confuse/File_1.cs
@@ -0,0 +1,36 @@
+// 04 - Exception Handling\Passing Exceptions on to the Caller\Caller Confuse
+// copyright 2000 Eric Gunnerson
+using System;
+public class Summer
+{
+ int sum = 0;
+ int count = 0;
+ float average;
+ public void DoAverage()
+ {
+ try
+ {
+ average = sum / count;
+ }
+ catch (DivideByZeroException e)
+ {
+ // do some cleanup here
+ throw;
+ }
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Summer summer = new Summer();
+ try
+ {
+ summer.DoAverage();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception {0}", e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Inform/Build1.bat b/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Inform/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Inform/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Inform/File_1.cs b/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Inform/File_1.cs
new file mode 100644
index 0000000..010620b
--- /dev/null
+++ b/05 - Exception Handling/Passing Exceptions on to the Caller/Caller Inform/File_1.cs
@@ -0,0 +1,38 @@
+// 04 - Exception Handling\Passing Exceptions on to the Caller\Caller Inform
+// copyright 2000 Eric Gunnerson
+using System;
+public class Summer
+{
+ int sum = 0;
+ int count = 0;
+ float average;
+ public void DoAverage()
+ {
+ try
+ {
+ average = sum / count;
+ }
+ catch (DivideByZeroException e)
+ {
+ // wrap exception in another one,
+ // adding additional context.
+ throw (new DivideByZeroException(
+ "Count is zero in DoAverage()", e));
+ }
+ }
+}
+public class Test
+{
+ public static void Main()
+ {
+ Summer summer = new Summer();
+ try
+ {
+ summer.DoAverage();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception: {0}", e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/05 - Exception Handling/The Exception Hierarchy/Build1.bat b/05 - Exception Handling/The Exception Hierarchy/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/05 - Exception Handling/The Exception Hierarchy/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/05 - Exception Handling/The Exception Hierarchy/Build2.bat b/05 - Exception Handling/The Exception Hierarchy/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/05 - Exception Handling/The Exception Hierarchy/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/05 - Exception Handling/The Exception Hierarchy/Build3.bat b/05 - Exception Handling/The Exception Hierarchy/Build3.bat
new file mode 100644
index 0000000..b764232
--- /dev/null
+++ b/05 - Exception Handling/The Exception Hierarchy/Build3.bat
@@ -0,0 +1 @@
+csc File_3.cs
diff --git a/05 - Exception Handling/The Exception Hierarchy/File_1.cs b/05 - Exception Handling/The Exception Hierarchy/File_1.cs
new file mode 100644
index 0000000..dd5df7e
--- /dev/null
+++ b/05 - Exception Handling/The Exception Hierarchy/File_1.cs
@@ -0,0 +1,24 @@
+// 04 - Exception Handling\The Exception Hierarchy
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ static int Zero = 0;
+ public static void Main()
+ {
+ try
+ {
+ int j = 22 / Zero;
+ }
+ // catch a specific exception
+ catch (DivideByZeroException e)
+ {
+ Console.WriteLine("DivideByZero {0}", e);
+ }
+ // catch any remaining exceptions
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception {0}", e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/05 - Exception Handling/The Exception Hierarchy/File_2.cs b/05 - Exception Handling/The Exception Hierarchy/File_2.cs
new file mode 100644
index 0000000..53346fc
--- /dev/null
+++ b/05 - Exception Handling/The Exception Hierarchy/File_2.cs
@@ -0,0 +1,24 @@
+// 04 - Exception Handling\The Exception Hierarchy
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ static int Zero = 0;
+ static void AFunction()
+ {
+ int j = 22 / Zero;
+ // the following line is never executed.
+ Console.WriteLine("In AFunction()");
+ }
+ public static void Main()
+ {
+ try
+ {
+ AFunction();
+ }
+ catch (DivideByZeroException e)
+ {
+ Console.WriteLine("DivideByZero {0}", e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/05 - Exception Handling/The Exception Hierarchy/File_3.cs b/05 - Exception Handling/The Exception Hierarchy/File_3.cs
new file mode 100644
index 0000000..75113cb
--- /dev/null
+++ b/05 - Exception Handling/The Exception Hierarchy/File_3.cs
@@ -0,0 +1,32 @@
+// 04 - Exception Handling\The Exception Hierarchy
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ static int Zero = 0;
+ static void AFunction()
+ {
+ try
+ {
+ int j = 22 / Zero;
+ }
+ // this exception doesn't match
+ catch (ArgumentOutOfRangeException e)
+ {
+ Console.WriteLine("OutOfRangeException: {0}", e);
+ }
+ Console.WriteLine("In AFunction()");
+ }
+ public static void Main()
+ {
+ try
+ {
+ AFunction();
+ }
+ // this exception doesn't match
+ catch (ArgumentException e)
+ {
+ Console.WriteLine("ArgumentException {0}", e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/05 - Exception Handling/Trying and Catching/Build1.bat b/05 - Exception Handling/Trying and Catching/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/05 - Exception Handling/Trying and Catching/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/05 - Exception Handling/Trying and Catching/File_1.cs b/05 - Exception Handling/Trying and Catching/File_1.cs
new file mode 100644
index 0000000..b6b4339
--- /dev/null
+++ b/05 - Exception Handling/Trying and Catching/File_1.cs
@@ -0,0 +1,21 @@
+// 04 - Exception Handling\Trying and Catching
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ static int Zero = 0;
+ public static void Main()
+ {
+ // watch for exceptions here
+ try
+ {
+ int j = 22 / Zero;
+ }
+ // exceptions that occur in try are transferred here
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception " + e.Message);
+ }
+ Console.WriteLine("After catch");
+ }
+}
\ No newline at end of file
diff --git a/05 - Exception Handling/User-Defined Exception Classes/Build1.bat b/05 - Exception Handling/User-Defined Exception Classes/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/05 - Exception Handling/User-Defined Exception Classes/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/05 - Exception Handling/User-Defined Exception Classes/File_1.cs b/05 - Exception Handling/User-Defined Exception Classes/File_1.cs
new file mode 100644
index 0000000..c1c96c0
--- /dev/null
+++ b/05 - Exception Handling/User-Defined Exception Classes/File_1.cs
@@ -0,0 +1,45 @@
+// 04 - Exception Handling\User-Defined Exception Classes
+// copyright 2000 Eric Gunnerson
+using System;
+public class CountIsZeroException: ApplicationException
+{
+ public CountIsZeroException()
+ {
+ }
+ public CountIsZeroException(string message)
+ : base(message)
+ {
+ }
+ public CountIsZeroException(string message, Exception inner)
+ : base(message, inner)
+ {
+ }
+}
+public class Summer
+{
+ int sum = 0;
+ int count = 0;
+ float average;
+ public void DoAverage()
+ {
+ if (count == 0)
+ throw(new CountIsZeroException("Zero count in DoAverage"));
+ else
+ average = sum / count;
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Summer summer = new Summer();
+ try
+ {
+ summer.DoAverage();
+ }
+ catch (CountIsZeroException e)
+ {
+ Console.WriteLine("CountIsZeroException: {0}", e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/App.config b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Chapter 6 - accessibility.csproj b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Chapter 6 - accessibility.csproj
new file mode 100644
index 0000000..b60587b
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Chapter 6 - accessibility.csproj
@@ -0,0 +1,59 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {43EF0584-9C86-4CFE-8A5F-31C0F5C93DF5}
+ Exe
+ Properties
+ Chapter_6___accessibility
+ Chapter 6 - accessibility
+ v4.5
+ 512
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Chapter 6 - accessibility.sln b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Chapter 6 - accessibility.sln
new file mode 100644
index 0000000..1e11c4f
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Chapter 6 - accessibility.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chapter 6 - accessibility", "Chapter 6 - accessibility.csproj", "{43EF0584-9C86-4CFE-8A5F-31C0F5C93DF5}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {43EF0584-9C86-4CFE-8A5F-31C0F5C93DF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {43EF0584-9C86-4CFE-8A5F-31C0F5C93DF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {43EF0584-9C86-4CFE-8A5F-31C0F5C93DF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {43EF0584-9C86-4CFE-8A5F-31C0F5C93DF5}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Chapter 6 - accessibility.v11.suo b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Chapter 6 - accessibility.v11.suo
new file mode 100644
index 0000000..0dcb12a
Binary files /dev/null and b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Chapter 6 - accessibility.v11.suo differ
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Logger.cs b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Logger.cs
new file mode 100644
index 0000000..4d05551
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Logger.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Chapter_6___accessibility
+{
+public class Logger
+{
+ public static void LogMessage(string message, bool includeDateAndTime)
+ {
+ if (includeDateAndTime)
+ {
+ Console.WriteLine(DateTime.Now);
+ }
+ Console.WriteLine(message);
+ }
+}
+}
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Program.cs b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Program.cs
new file mode 100644
index 0000000..5226f8d
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Program.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Chapter_6___accessibility
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ Logger.LogMessage("Warp initiated", includeDateAndTime: true);
+ }
+ }
+}
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Properties/AssemblyInfo.cs b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..001db78
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Chapter 6 - accessibility")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Chapter 6 - accessibility")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("f2ce8b83-f141-4993-a429-6a9a6695a286")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.exe b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.exe
new file mode 100644
index 0000000..6209e17
Binary files /dev/null and b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.exe differ
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.exe.config b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.exe.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.pdb b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.pdb
new file mode 100644
index 0000000..1fdb8a7
Binary files /dev/null and b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.pdb differ
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.vshost.exe b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.vshost.exe
new file mode 100644
index 0000000..212bd7f
Binary files /dev/null and b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.vshost.exe differ
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.vshost.exe.config b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.vshost.exe.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/bin/Debug/Chapter 6 - accessibility.vshost.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.csproj.FileListAbsolute.txt b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..44f31b8
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.csproj.FileListAbsolute.txt
@@ -0,0 +1,6 @@
+d:\data\booknew\chapters\code\Chapter 6 - accessibility\bin\Debug\Chapter 6 - accessibility.exe.config
+d:\data\booknew\chapters\code\Chapter 6 - accessibility\bin\Debug\Chapter 6 - accessibility.exe
+d:\data\booknew\chapters\code\Chapter 6 - accessibility\bin\Debug\Chapter 6 - accessibility.pdb
+d:\data\booknew\chapters\code\Chapter 6 - accessibility\obj\Debug\Chapter 6 - accessibility.csprojResolveAssemblyReference.cache
+d:\data\booknew\chapters\code\Chapter 6 - accessibility\obj\Debug\Chapter 6 - accessibility.exe
+d:\data\booknew\chapters\code\Chapter 6 - accessibility\obj\Debug\Chapter 6 - accessibility.pdb
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.csprojResolveAssemblyReference.cache b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.csprojResolveAssemblyReference.cache
new file mode 100644
index 0000000..ff54045
Binary files /dev/null and b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.csprojResolveAssemblyReference.cache differ
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.exe b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.exe
new file mode 100644
index 0000000..6209e17
Binary files /dev/null and b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.exe differ
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.pdb b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.pdb
new file mode 100644
index 0000000..1fdb8a7
Binary files /dev/null and b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/Chapter 6 - accessibility.pdb differ
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..84029c3
Binary files /dev/null and b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
new file mode 100644
index 0000000..e69de29
diff --git a/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/06 - Member Accessibility and Overloading/Chapter 6 - accessibility/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
new file mode 100644
index 0000000..e69de29
diff --git a/06 - Member Accessibility and Overloading/Method Overloading/Better Conversions/Build1.bat b/06 - Member Accessibility and Overloading/Method Overloading/Better Conversions/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Method Overloading/Better Conversions/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/06 - Member Accessibility and Overloading/Method Overloading/Better Conversions/File_1.cs b/06 - Member Accessibility and Overloading/Method Overloading/Better Conversions/File_1.cs
new file mode 100644
index 0000000..51bf5da
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Method Overloading/Better Conversions/File_1.cs
@@ -0,0 +1,28 @@
+// 07 - Member Accessibility and Overloading\Method Overloading\Better Conversions
+// copyright 2000 Eric Gunnerson
+using System;
+public class MyClass
+{
+ public void Process(long value)
+ {
+ Console.WriteLine("Process(long): {0}", value);
+ }
+ public void Process(short value)
+ {
+ Console.WriteLine("Process(short): {0}", value);
+ }
+}
+
+class Test
+{
+ public static void Main()
+ {
+ MyClass myClass = new MyClass();
+
+ int i = 12;
+ myClass.Process(i);
+
+ sbyte s = 12;
+ myClass.Process(s);
+ }
+}
\ No newline at end of file
diff --git a/06 - Member Accessibility and Overloading/Method Overloading/Method Hiding/Build1.bat b/06 - Member Accessibility and Overloading/Method Overloading/Method Hiding/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Method Overloading/Method Hiding/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/06 - Member Accessibility and Overloading/Method Overloading/Method Hiding/File_1.cs b/06 - Member Accessibility and Overloading/Method Overloading/Method Hiding/File_1.cs
new file mode 100644
index 0000000..93508e0
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Method Overloading/Method Hiding/File_1.cs
@@ -0,0 +1,32 @@
+// 07 - Member Accessibility and Overloading\Method Overloading\Method Hiding
+// copyright 2000 Eric Gunnerson
+using System;
+public class Base
+{
+ public void Process(short value)
+ {
+ Console.WriteLine("Base.Process(short): {0}", value);
+ }
+}
+public class Derived: Base
+{
+ public void Process(int value)
+ {
+ Console.WriteLine("Derived.Process(int): {0}", value);
+ }
+
+ public void Process(string value)
+ {
+ Console.WriteLine("Derived.Process(string): {0}", value);
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Derived d = new Derived();
+ short i = 12;
+ d.Process(i);
+ ((Base) d).Process(i);
+ }
+}
\ No newline at end of file
diff --git a/06 - Member Accessibility and Overloading/The Interaction of Class and Member Accessibility/Build1.bat b/06 - Member Accessibility and Overloading/The Interaction of Class and Member Accessibility/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/The Interaction of Class and Member Accessibility/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/06 - Member Accessibility and Overloading/The Interaction of Class and Member Accessibility/File_1.cs b/06 - Member Accessibility and Overloading/The Interaction of Class and Member Accessibility/File_1.cs
new file mode 100644
index 0000000..531cf7f
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/The Interaction of Class and Member Accessibility/File_1.cs
@@ -0,0 +1,8 @@
+// 07 - Member Accessibility and Overloading\The Interaction of Class and Member Accessibility
+// copyright 2000 Eric Gunnerson
+internal class MyHelperClass
+{
+ public void PublicFunction() {}
+ internal void InternalFunction() {}
+ protected void ProtectedFunction() {}
+}
\ No newline at end of file
diff --git a/06 - Member Accessibility and Overloading/Using Internal on Members/Build1.bat b/06 - Member Accessibility and Overloading/Using Internal on Members/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Using Internal on Members/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/06 - Member Accessibility and Overloading/Using Internal on Members/File_1.cs b/06 - Member Accessibility and Overloading/Using Internal on Members/File_1.cs
new file mode 100644
index 0000000..fb1d61d
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Using Internal on Members/File_1.cs
@@ -0,0 +1,40 @@
+// 07 - Member Accessibility and Overloading\Using Internal on Members
+// copyright 2000 Eric Gunnerson
+public class DrawingObjectGroup
+{
+ public DrawingObjectGroup()
+ {
+ objects = new DrawingObject[10];
+ objectCount = 0;
+ }
+ public void AddObject(DrawingObject obj)
+ {
+ if (objectCount < 10)
+ {
+ objects[objectCount] = obj;
+ objectCount++;
+ }
+ }
+ public void Render()
+ {
+ for (int i = 0; i < objectCount; i++)
+ {
+ objects[i].Render();
+ }
+ }
+
+ DrawingObject[] objects;
+ int objectCount;
+}
+public class DrawingObject
+{
+ internal void Render() {}
+}
+class Test
+{
+ public static void Main()
+ {
+ DrawingObjectGroup group = new DrawingObjectGroup();
+ group.AddObject(new DrawingObject());
+ }
+}
\ No newline at end of file
diff --git a/06 - Member Accessibility and Overloading/Variable-Length Parameter Lists/Build1.bat b/06 - Member Accessibility and Overloading/Variable-Length Parameter Lists/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Variable-Length Parameter Lists/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/06 - Member Accessibility and Overloading/Variable-Length Parameter Lists/File_1.cs b/06 - Member Accessibility and Overloading/Variable-Length Parameter Lists/File_1.cs
new file mode 100644
index 0000000..46006a9
--- /dev/null
+++ b/06 - Member Accessibility and Overloading/Variable-Length Parameter Lists/File_1.cs
@@ -0,0 +1,42 @@
+// 07 - Member Accessibility and Overloading\Variable-Length Parameter Lists
+// copyright 2000 Eric Gunnerson
+using System;
+class Port
+{
+ // version with a single object parameter
+ public void Write(string label, object arg)
+ {
+ WriteString(label);
+ WriteString(arg.ToString());
+ }
+ // version with an array of object parameters
+ public void Write(string label, params object[] args)
+ {
+ WriteString(label);
+ foreach (object o in args)
+ {
+ WriteString(o.ToString());
+ }
+ }
+ void WriteString(string str)
+ {
+ // writes string to the port here
+ Console.WriteLine("Port debug: {0}", str);
+ }
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Port port = new Port();
+ port.Write("Single Test", "Port ok");
+ port.Write("Port Test: ", "a", "b", 12, 14.2);
+ object[] arr = new object[4];
+ arr[0] = "The";
+ arr[1] = "answer";
+ arr[2] = "is";
+ arr[3] = 42;
+ port.Write("What is the answer?", arr);
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Constants/Build1.bat b/07 - Other Class Details/Constants/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Constants/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Constants/File_1.cs b/07 - Other Class Details/Constants/File_1.cs
new file mode 100644
index 0000000..b3c2858
--- /dev/null
+++ b/07 - Other Class Details/Constants/File_1.cs
@@ -0,0 +1,25 @@
+// 08 - Other Class Details\Constants
+// copyright 2000 Eric Gunnerson
+using System;
+enum MyEnum
+{
+ Jet
+}
+class LotsOLiterals
+{
+ // const items can't be changed.
+ // const implies static.
+ public const int value1 = 33;
+ public const string value2 = "Hello";
+ public const MyEnum value3 = MyEnum.Jet;
+}
+class Test
+{
+ public static void Main()
+ {
+ Console.WriteLine("{0} {1} {2}",
+ LotsOLiterals.value1,
+ LotsOLiterals.value2,
+ LotsOLiterals.value3);
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Build1.bat b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Build2.bat b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/File_1.cs b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/File_1.cs
new file mode 100644
index 0000000..c3e452e
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/File_1.cs
@@ -0,0 +1,32 @@
+// 08 - Other Class Details\Creation, Initialization, Destruction\Constructors
+// copyright 2000 Eric Gunnerson
+using System;
+public class BaseClass
+{
+ public BaseClass(int x)
+ {
+ this.x = x;
+ }
+ public int X
+ {
+ get
+ {
+ return(x);
+ }
+ }
+ int x;
+}
+public class Derived: BaseClass
+{
+ public Derived(int x): base(x)
+ {
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Derived d = new Derived(15);
+ Console.WriteLine("X = {0}", d.X);
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/File_2.cs b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/File_2.cs
new file mode 100644
index 0000000..a109706
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/File_2.cs
@@ -0,0 +1,38 @@
+// 08 - Other Class Details\Creation, Initialization, Destruction\Constructors
+// copyright 2000 Eric Gunnerson
+using System;
+class MyObject
+{
+ public MyObject(int x)
+ {
+ this.x = x;
+ }
+ public MyObject(int x, int y): this(x)
+ {
+ this.y = y;
+ }
+ public int X
+ {
+ get
+ {
+ return(x);
+ }
+ }
+ public int Y
+ {
+ get
+ {
+ return(y);
+ }
+ }
+ int x;
+ int y;
+}
+class Test
+{
+ public static void Main()
+ {
+ MyObject my = new MyObject(10, 20);
+ Console.WriteLine("x = {0}, y = {1}", my.X, my.Y);
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Private constructors/Build1.bat b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Private constructors/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Private constructors/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Private constructors/File_1.cs b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Private constructors/File_1.cs
new file mode 100644
index 0000000..75c47ac
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Constructors/Private constructors/File_1.cs
@@ -0,0 +1,22 @@
+// 08 - Other Class Details\Creation, Initialization, Destruction\Constructors\Private constructors
+// copyright 2000 Eric Gunnerson
+public class SystemInfo
+{
+ static SystemInfo cache = null;
+ static object cacheLock = new object();
+ private SystemInfo()
+ {
+ // useful stuff here
+ }
+
+ public static SystemInfo GetSystemInfo()
+ {
+ lock(cacheLock)
+ {
+ if (cache == null)
+ cache = new SystemInfo();
+
+ return(cache);
+ }
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Initialization/Build1.bat b/07 - Other Class Details/Creation, Initialization, Destruction/Initialization/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Initialization/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Initialization/File_1.cs b/07 - Other Class Details/Creation, Initialization, Destruction/Initialization/File_1.cs
new file mode 100644
index 0000000..6e65af8
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Initialization/File_1.cs
@@ -0,0 +1,16 @@
+// 08 - Other Class Details\Creation, Initialization, Destruction\Initialization
+// copyright 2000 Eric Gunnerson
+public class Parser // Support class
+{
+ public Parser(int number)
+ {
+ this.number = number;
+ }
+ int number;
+}
+class MyClass
+{
+ public int counter = 100;
+ public string heading = "Top";
+ private Parser parser = new Parser(100);
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/Build1.bat b/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/Build2.bat b/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/File_1.cs b/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/File_1.cs
new file mode 100644
index 0000000..483d9a7
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/File_1.cs
@@ -0,0 +1,26 @@
+// 08 - Other Class Details\Creation, Initialization, Destruction\Managing Non-Memory Resources
+// copyright 2000 Eric Gunnerson
+using System;
+using System.Runtime.InteropServices;
+
+class ResourceWrapper
+{
+ int handle = 0;
+
+ public ResourceWrapper()
+ {
+ handle = GetWindowsResource();
+ }
+
+ ~ResourceWrapper()
+ {
+ FreeWindowsResource(handle);
+ handle = 0;
+ }
+
+ [DllImport("dll.dll")]
+ static extern int GetWindowsResource();
+
+ [DllImport("dll.dll")]
+ static extern void FreeWindowsResource(int handle);
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/File_2.cs b/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/File_2.cs
new file mode 100644
index 0000000..23ab6b4
--- /dev/null
+++ b/07 - Other Class Details/Creation, Initialization, Destruction/Managing Non-Memory Resources/File_2.cs
@@ -0,0 +1,43 @@
+// 08 - Other Class Details\Creation, Initialization, Destruction\Managing Non-Memory Resources
+// copyright 2000 Eric Gunnerson
+using System;
+using System.Runtime.InteropServices;
+
+class ResourceWrapper: IDisposable
+{
+ int handle = 0;
+
+ public ResourceWrapper()
+ {
+ handle = GetWindowsResource();
+ }
+
+ // does cleanup for this object only
+ void DoDispose()
+ {
+ FreeWindowsResource(handle);
+ handle = 0;
+ }
+
+ ~ResourceWrapper()
+ {
+ DoDispose();
+ }
+
+ // dispose cleans up its object, and any objects it holds
+ // that also implement IDisposable.
+ public void Dispose()
+ {
+ DoDispose();
+ // call Dispose() on our base class (if necessary), and
+ // on any other resources we hold that implement IDisposable
+
+ GC.SuppressFinalize(this);
+ }
+
+ [DllImport("dll.dll")]
+ static extern int GetWindowsResource();
+
+ [DllImport("dll.dll")]
+ static extern void FreeWindowsResource(int handle);
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Nested Classes/Build1.bat b/07 - Other Class Details/Nested Classes/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Nested Classes/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Nested Classes/Build2.bat b/07 - Other Class Details/Nested Classes/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/07 - Other Class Details/Nested Classes/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/07 - Other Class Details/Nested Classes/File_1.cs b/07 - Other Class Details/Nested Classes/File_1.cs
new file mode 100644
index 0000000..99921cf
--- /dev/null
+++ b/07 - Other Class Details/Nested Classes/File_1.cs
@@ -0,0 +1,10 @@
+// 08 - Other Class Details\Nested Classes
+// copyright 2000 Eric Gunnerson
+public class Parser
+{
+ Token[] tokens;
+}
+public class Token
+{
+ string name;
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Nested Classes/File_2.cs b/07 - Other Class Details/Nested Classes/File_2.cs
new file mode 100644
index 0000000..206bb48
--- /dev/null
+++ b/07 - Other Class Details/Nested Classes/File_2.cs
@@ -0,0 +1,10 @@
+// 08 - Other Class Details\Nested Classes
+// copyright 2000 Eric Gunnerson
+public class Parser
+{
+ Token[] tokens;
+ private class Token
+ {
+ string name;
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/OtherClassDetails/OtherClassDetails.csproj b/07 - Other Class Details/OtherClassDetails/OtherClassDetails.csproj
new file mode 100644
index 0000000..b713b02
--- /dev/null
+++ b/07 - Other Class Details/OtherClassDetails/OtherClassDetails.csproj
@@ -0,0 +1,57 @@
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {21150F8E-372C-4BE5-80D8-6FFC47EE01E4}
+ Exe
+ Properties
+ ConsoleApplication1
+ OtherClassDetails
+ 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/07 - Other Class Details/OtherClassDetails/OtherClassDetails.csproj.user b/07 - Other Class Details/OtherClassDetails/OtherClassDetails.csproj.user
new file mode 100644
index 0000000..ace9a86
--- /dev/null
+++ b/07 - Other Class Details/OtherClassDetails/OtherClassDetails.csproj.user
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/07 - Other Class Details/OtherClassDetails/OtherClassDetails.sln b/07 - Other Class Details/OtherClassDetails/OtherClassDetails.sln
new file mode 100644
index 0000000..e1fdff1
--- /dev/null
+++ b/07 - Other Class Details/OtherClassDetails/OtherClassDetails.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C# Express 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OtherClassDetails", "OtherClassDetails.csproj", "{21150F8E-372C-4BE5-80D8-6FFC47EE01E4}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {21150F8E-372C-4BE5-80D8-6FFC47EE01E4}.Debug|x86.ActiveCfg = Debug|x86
+ {21150F8E-372C-4BE5-80D8-6FFC47EE01E4}.Debug|x86.Build.0 = Debug|x86
+ {21150F8E-372C-4BE5-80D8-6FFC47EE01E4}.Release|x86.ActiveCfg = Release|x86
+ {21150F8E-372C-4BE5-80D8-6FFC47EE01E4}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/07 - Other Class Details/OtherClassDetails/OtherClassDetails.suo b/07 - Other Class Details/OtherClassDetails/OtherClassDetails.suo
new file mode 100644
index 0000000..34a7fb6
Binary files /dev/null and b/07 - Other Class Details/OtherClassDetails/OtherClassDetails.suo differ
diff --git a/07 - Other Class Details/OtherClassDetails/Program.cs b/07 - Other Class Details/OtherClassDetails/Program.cs
new file mode 100644
index 0000000..2bf8910
--- /dev/null
+++ b/07 - Other Class Details/OtherClassDetails/Program.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OtherLanguageDetails
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ Original();
+ Method();
+ ClassHelperMethod();
+ ExtensionMethod();
+ }
+
+ static void Original()
+ {
+string test = "#Name#,#Date#,#Age#,#Salary#";
+
+string[] fieldArray = test.Split(',');
+
+List fields = new List();
+
+foreach (string field in fieldArray)
+{
+ fields.Add(field.Replace("#", ""));
+}
+
+ foreach (string field in fields)
+ {
+ Console.WriteLine(field);
+ }
+ }
+
+ static void Method()
+ {
+string test = "#Name#,#Date#,#Age#,#Salary#";
+
+List fields = ExtractFields(test);
+
+foreach (string field in fields)
+{
+ Console.WriteLine(field);
+}
+ }
+
+ static void ClassHelperMethod()
+ {
+ string test = "#Name#,#Date#,#Age#,#Salary#";
+
+List fields = StringHelper.ExtractFields(test);
+
+ foreach (string field in fields)
+ {
+ Console.WriteLine(field);
+ }
+ }
+
+ static void ExtensionMethod()
+ {
+ string test = "#Name#,#Date#,#Age#,#Salary#";
+
+ List fields = test.ExtractFields();
+
+ foreach (string field in fields)
+ {
+ Console.WriteLine(field);
+ }
+ }
+
+static List ExtractFields(string fieldString)
+{
+ string[] fieldArray = fieldString.Split(',');
+
+ List fields = new List();
+
+ foreach (string field in fieldArray)
+ {
+ fields.Add(field.Replace("#", ""));
+ }
+
+ return fields;
+}
+ }
+
+ public static class StringHelper
+ {
+ public static List ExtractFields(string fieldString)
+ {
+ string[] fieldArray = fieldString.Split(',');
+
+ List fields = new List();
+
+ foreach (string field in fieldArray)
+ {
+ fields.Add(field.Replace("#", ""));
+ }
+
+ return fields;
+ }
+ }
+
+ public static class StringExtensions
+ {
+ public static List ExtractFields(this string fieldString)
+ {
+ string[] fieldArray = fieldString.Split(',');
+
+ List fields = new List();
+
+ foreach (string field in fieldArray)
+ {
+ fields.Add(field.Replace("#", ""));
+ }
+
+ return fields;
+ }
+ }
+}
diff --git a/07 - Other Class Details/OtherClassDetails/Properties/AssemblyInfo.cs b/07 - Other Class Details/OtherClassDetails/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..b4bd104
--- /dev/null
+++ b/07 - Other Class Details/OtherClassDetails/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ConsoleApplication1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("ConsoleApplication1")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("259d94c5-1216-41a2-90c0-4486548d3304")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/07 - Other Class Details/OtherClassDetails/bin/Debug/ConsoleApplication1.vshost.exe b/07 - Other Class Details/OtherClassDetails/bin/Debug/ConsoleApplication1.vshost.exe
new file mode 100644
index 0000000..bb84a51
Binary files /dev/null and b/07 - Other Class Details/OtherClassDetails/bin/Debug/ConsoleApplication1.vshost.exe differ
diff --git a/07 - Other Class Details/OtherClassDetails/bin/Debug/ConsoleApplication1.vshost.exe.manifest b/07 - Other Class Details/OtherClassDetails/bin/Debug/ConsoleApplication1.vshost.exe.manifest
new file mode 100644
index 0000000..061c9ca
--- /dev/null
+++ b/07 - Other Class Details/OtherClassDetails/bin/Debug/ConsoleApplication1.vshost.exe.manifest
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/07 - Other Class Details/OtherClassDetails/bin/Release/ConsoleApplication1.exe b/07 - Other Class Details/OtherClassDetails/bin/Release/ConsoleApplication1.exe
new file mode 100644
index 0000000..8e1bc13
Binary files /dev/null and b/07 - Other Class Details/OtherClassDetails/bin/Release/ConsoleApplication1.exe differ
diff --git a/07 - Other Class Details/OtherClassDetails/bin/Release/ConsoleApplication1.pdb b/07 - Other Class Details/OtherClassDetails/bin/Release/ConsoleApplication1.pdb
new file mode 100644
index 0000000..019e152
Binary files /dev/null and b/07 - Other Class Details/OtherClassDetails/bin/Release/ConsoleApplication1.pdb differ
diff --git a/07 - Other Class Details/OtherClassDetails/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/07 - Other Class Details/OtherClassDetails/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..1faf597
Binary files /dev/null and b/07 - Other Class Details/OtherClassDetails/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/07 - Other Class Details/OtherClassDetails/obj/x86/Release/ConsoleApplication1.csproj.FileListAbsolute.txt b/07 - Other Class Details/OtherClassDetails/obj/x86/Release/ConsoleApplication1.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..28be997
--- /dev/null
+++ b/07 - Other Class Details/OtherClassDetails/obj/x86/Release/ConsoleApplication1.csproj.FileListAbsolute.txt
@@ -0,0 +1,5 @@
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\ConsoleApplication1\bin\Release\ConsoleApplication1.exe
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\ConsoleApplication1\bin\Release\ConsoleApplication1.pdb
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\ConsoleApplication1\obj\x86\Release\ResolveAssemblyReference.cache
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\ConsoleApplication1\obj\x86\Release\ConsoleApplication1.exe
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\ConsoleApplication1\obj\x86\Release\ConsoleApplication1.pdb
diff --git a/07 - Other Class Details/OtherClassDetails/obj/x86/Release/ConsoleApplication1.exe b/07 - Other Class Details/OtherClassDetails/obj/x86/Release/ConsoleApplication1.exe
new file mode 100644
index 0000000..8e1bc13
Binary files /dev/null and b/07 - Other Class Details/OtherClassDetails/obj/x86/Release/ConsoleApplication1.exe differ
diff --git a/07 - Other Class Details/OtherClassDetails/obj/x86/Release/ConsoleApplication1.pdb b/07 - Other Class Details/OtherClassDetails/obj/x86/Release/ConsoleApplication1.pdb
new file mode 100644
index 0000000..019e152
Binary files /dev/null and b/07 - Other Class Details/OtherClassDetails/obj/x86/Release/ConsoleApplication1.pdb differ
diff --git a/07 - Other Class Details/OtherClassDetails/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache b/07 - Other Class Details/OtherClassDetails/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..cd24a59
Binary files /dev/null and b/07 - Other Class Details/OtherClassDetails/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/07 - Other Class Details/Partial/Build1.bat b/07 - Other Class Details/Partial/Build1.bat
new file mode 100644
index 0000000..7cbdfb3
--- /dev/null
+++ b/07 - Other Class Details/Partial/Build1.bat
@@ -0,0 +1 @@
+csc Util.cs Util2.cs
diff --git a/07 - Other Class Details/Partial/Util.cs b/07 - Other Class Details/Partial/Util.cs
new file mode 100644
index 0000000..3775d13
--- /dev/null
+++ b/07 - Other Class Details/Partial/Util.cs
@@ -0,0 +1,22 @@
+#region Using directives
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#endregion
+
+namespace OtherClassDetails
+{
+ partial class Util
+ {
+ }
+
+ partial class Util4
+ {
+ }
+
+ partial class Util4
+ {
+ }
+}
diff --git a/07 - Other Class Details/Partial/Util2.cs b/07 - Other Class Details/Partial/Util2.cs
new file mode 100644
index 0000000..c6bd1eb
--- /dev/null
+++ b/07 - Other Class Details/Partial/Util2.cs
@@ -0,0 +1,25 @@
+#region Using directives
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#endregion
+
+namespace OtherClassDetails
+{
+ partial class Util
+ {
+ }
+
+ public class MyBase{}
+
+ partial class MyPartialClass : MyBase
+ {
+ public void Dispose() { }
+ }
+
+ partial class MyPartialClass : IDisposable { }
+
+ partial struct MyInt { }
+}
diff --git a/07 - Other Class Details/Readonly Fields/Build1.bat b/07 - Other Class Details/Readonly Fields/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Readonly Fields/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Readonly Fields/Build2.bat b/07 - Other Class Details/Readonly Fields/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/07 - Other Class Details/Readonly Fields/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/07 - Other Class Details/Readonly Fields/Build3.bat b/07 - Other Class Details/Readonly Fields/Build3.bat
new file mode 100644
index 0000000..b764232
--- /dev/null
+++ b/07 - Other Class Details/Readonly Fields/Build3.bat
@@ -0,0 +1 @@
+csc File_3.cs
diff --git a/07 - Other Class Details/Readonly Fields/File_1.cs b/07 - Other Class Details/Readonly Fields/File_1.cs
new file mode 100644
index 0000000..4faa837
--- /dev/null
+++ b/07 - Other Class Details/Readonly Fields/File_1.cs
@@ -0,0 +1,27 @@
+// 08 - Other Class Details\Readonly Fields
+// copyright 2000 Eric Gunnerson
+// error
+class Color
+{
+ public Color(int red, int green, int blue)
+ {
+ this.red = red;
+ this.green = green;
+ this.blue = blue;
+ }
+
+ int red;
+ int green;
+ int blue;
+ // call to new can't be used with static
+ public const Color Red = new Color(255, 0, 0);
+ public const Color Green = new Color(0, 255, 0);
+ public const Color Blue = new Color(0, 0, 255);
+}
+class Test
+{
+ static void Main()
+ {
+ Color background = Color.Red;
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Readonly Fields/File_2.cs b/07 - Other Class Details/Readonly Fields/File_2.cs
new file mode 100644
index 0000000..df4711c
--- /dev/null
+++ b/07 - Other Class Details/Readonly Fields/File_2.cs
@@ -0,0 +1,34 @@
+// 08 - Other Class Details\Readonly Fields
+// copyright 2000 Eric Gunnerson
+class Color
+{
+ public Color(int red, int green, int blue)
+ {
+ this.red = red;
+ this.green = green;
+ this.blue = blue;
+ }
+
+ int red;
+ int green;
+ int blue;
+
+ public static readonly Color Red;
+ public static readonly Color Green;
+ public static readonly Color Blue;
+
+ // static constructor
+ static Color()
+ {
+ Red = new Color(255, 0, 0);
+ Green = new Color(0, 255, 0);
+ Blue = new Color(0, 0, 255);
+ }
+}
+class Test
+{
+ static void Main()
+ {
+ Color background = Color.Red;
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Readonly Fields/File_3.cs b/07 - Other Class Details/Readonly Fields/File_3.cs
new file mode 100644
index 0000000..3d28b61
--- /dev/null
+++ b/07 - Other Class Details/Readonly Fields/File_3.cs
@@ -0,0 +1,47 @@
+// 08 - Other Class Details\Readonly Fields
+// copyright 2000 Eric Gunnerson
+class Color
+{
+ public Color(int red, int green, int blue)
+ {
+ this.red = red;
+ this.green = green;
+ this.blue = blue;
+ }
+
+ public enum PredefinedEnum
+ {
+ Red,
+ Blue,
+ Green
+ }
+ public static Color GetPredefinedColor(
+ PredefinedEnum pre)
+ {
+ switch (pre)
+ {
+ case PredefinedEnum.Red:
+ return(new Color(255, 0, 0));
+
+ case PredefinedEnum.Green:
+ return(new Color(0, 255, 0));
+
+ case PredefinedEnum.Blue:
+ return(new Color(0, 0, 255));
+
+ default:
+ return(new Color(0, 0, 0));
+ }
+ }
+ int red;
+ int blue;
+ int green;
+}
+class Test
+{
+ static void Main()
+ {
+ Color background =
+ Color.GetPredefinedColor(Color.PredefinedEnum.Blue);
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Static Constructors/Build1.bat b/07 - Other Class Details/Static Constructors/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Static Constructors/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Static Constructors/File_1.cs b/07 - Other Class Details/Static Constructors/File_1.cs
new file mode 100644
index 0000000..9b51ff3
--- /dev/null
+++ b/07 - Other Class Details/Static Constructors/File_1.cs
@@ -0,0 +1,10 @@
+// 08 - Other Class Details\Static Constructors
+// copyright 2000 Eric Gunnerson
+using System;
+class MyClass
+{
+ static MyClass()
+ {
+ Console.WriteLine("MyClass is initializing");
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Static Fields/Build1.bat b/07 - Other Class Details/Static Fields/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Static Fields/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Static Fields/File_1.cs b/07 - Other Class Details/Static Fields/File_1.cs
new file mode 100644
index 0000000..5efb76a
--- /dev/null
+++ b/07 - Other Class Details/Static Fields/File_1.cs
@@ -0,0 +1,21 @@
+// 08 - Other Class Details\Static Fields
+// copyright 2000 Eric Gunnerson
+using System;
+class MyClass
+{
+ public MyClass()
+ {
+ instanceCount++;
+ }
+ public static int instanceCount = 0;
+}
+class Test
+{
+ public static void Main()
+ {
+ MyClass my = new MyClass();
+ Console.WriteLine(MyClass.instanceCount);
+ MyClass my2 = new MyClass();
+ Console.WriteLine(MyClass.instanceCount);
+ }
+}
\ No newline at end of file
diff --git a/07 - Other Class Details/Static Member Functions/Build1.bat b/07 - Other Class Details/Static Member Functions/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/07 - Other Class Details/Static Member Functions/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/07 - Other Class Details/Static Member Functions/File_1.cs b/07 - Other Class Details/Static Member Functions/File_1.cs
new file mode 100644
index 0000000..65e4cde
--- /dev/null
+++ b/07 - Other Class Details/Static Member Functions/File_1.cs
@@ -0,0 +1,23 @@
+// 08 - Other Class Details\Static Member Functions
+// copyright 2000 Eric Gunnerson
+using System;
+class MyClass
+{
+ public MyClass()
+ {
+ instanceCount++;
+ }
+ public static int GetInstanceCount()
+ {
+ return(instanceCount);
+ }
+ static int instanceCount = 0;
+}
+class Test
+{
+ public static void Main()
+ {
+ MyClass my = new MyClass();
+ Console.WriteLine(MyClass.GetInstanceCount());
+ }
+}
\ No newline at end of file
diff --git a/08 - Structs (Value Types)/A Point Struct/Build1.bat b/08 - Structs (Value Types)/A Point Struct/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/08 - Structs (Value Types)/A Point Struct/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/08 - Structs (Value Types)/A Point Struct/File_1.cs b/08 - Structs (Value Types)/A Point Struct/File_1.cs
new file mode 100644
index 0000000..ba9faf4
--- /dev/null
+++ b/08 - Structs (Value Types)/A Point Struct/File_1.cs
@@ -0,0 +1,26 @@
+// 09 - Structs (Value Types)\A Point Struct
+// copyright 2000 Eric Gunnerson
+using System;
+struct Point
+{
+ public Point(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+ public override string ToString()
+ {
+ return(String.Format("({0}, {1})", x, y));
+ }
+
+ public int x;
+ public int y;
+}
+class Test
+{
+ public static void Main()
+ {
+ Point start = new Point(5, 5);
+ Console.WriteLine("Start: {0}", start);
+ }
+}
\ No newline at end of file
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/App.config b/08 - Structs (Value Types)/Chapter 8 - Structs/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/Chapter 8 - Structs.csproj b/08 - Structs (Value Types)/Chapter 8 - Structs/Chapter 8 - Structs.csproj
new file mode 100644
index 0000000..edf1b18
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/Chapter 8 - Structs.csproj
@@ -0,0 +1,60 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {B8E2962E-78B9-4263-8569-1EA6277D21F8}
+ Exe
+ Properties
+ Chapter_8___Structs
+ Chapter 8 - Structs
+ v4.5
+ 512
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/Chapter 8 - Structs.sln b/08 - Structs (Value Types)/Chapter 8 - Structs/Chapter 8 - Structs.sln
new file mode 100644
index 0000000..e7c2688
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/Chapter 8 - Structs.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chapter 8 - Structs", "Chapter 8 - Structs.csproj", "{B8E2962E-78B9-4263-8569-1EA6277D21F8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B8E2962E-78B9-4263-8569-1EA6277D21F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B8E2962E-78B9-4263-8569-1EA6277D21F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B8E2962E-78B9-4263-8569-1EA6277D21F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B8E2962E-78B9-4263-8569-1EA6277D21F8}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/Chapter 8 - Structs.v11.suo b/08 - Structs (Value Types)/Chapter 8 - Structs/Chapter 8 - Structs.v11.suo
new file mode 100644
index 0000000..5f19f5e
Binary files /dev/null and b/08 - Structs (Value Types)/Chapter 8 - Structs/Chapter 8 - Structs.v11.suo differ
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/Point.cs b/08 - Structs (Value Types)/Chapter 8 - Structs/Point.cs
new file mode 100644
index 0000000..628b167
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/Point.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+struct Point
+{
+ public int m_x;
+ public int m_y;
+
+ public Point(int x, int y)
+ {
+ m_x = x;
+ m_y = y;
+ }
+ public override string ToString()
+ {
+ return String.Format("({0}, {1})", m_x, m_y);
+ }
+}
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/PointHolder.cs b/08 - Structs (Value Types)/Chapter 8 - Structs/PointHolder.cs
new file mode 100644
index 0000000..143ac6d
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/PointHolder.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Chapter_8___Structs
+{
+class PointHolder
+{
+ public PointHolder(Point point)
+ {
+ Current = point;
+ }
+
+ public Point Current;
+}
+}
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/Program.cs b/08 - Structs (Value Types)/Chapter 8 - Structs/Program.cs
new file mode 100644
index 0000000..547c7a6
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/Program.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Chapter_8___Structs
+{
+ class Program
+ {
+static void Main(string[] args)
+{
+ Example();
+}
+
+static void Example()
+{
+ Point point = new Point(10, 15);
+ PointHolder pointHolder = new PointHolder(point);
+
+ Console.WriteLine(pointHolder.Current);
+
+ Point current = pointHolder.Current;
+ current.m_x = 500;
+
+ Console.WriteLine(pointHolder.Current);
+}
+ }
+}
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/Properties/AssemblyInfo.cs b/08 - Structs (Value Types)/Chapter 8 - Structs/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8ba8c2e
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Chapter 8 - Structs")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Chapter 8 - Structs")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("a6827f51-72c9-4a62-8191-10ea71d884f5")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.exe b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.exe
new file mode 100644
index 0000000..3fed961
Binary files /dev/null and b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.exe differ
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.exe.config b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.exe.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.pdb b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.pdb
new file mode 100644
index 0000000..1805eeb
Binary files /dev/null and b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.pdb differ
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.vshost.exe b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.vshost.exe
new file mode 100644
index 0000000..212bd7f
Binary files /dev/null and b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.vshost.exe differ
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.vshost.exe.config b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.vshost.exe.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/bin/Debug/Chapter 8 - Structs.vshost.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.csproj.FileListAbsolute.txt b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..955c2b9
--- /dev/null
+++ b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.csproj.FileListAbsolute.txt
@@ -0,0 +1,6 @@
+d:\data\booknew\chapters\code\Chapter 8 - Structs\bin\Debug\Chapter 8 - Structs.exe.config
+d:\data\booknew\chapters\code\Chapter 8 - Structs\obj\Debug\Chapter 8 - Structs.csprojResolveAssemblyReference.cache
+d:\data\booknew\chapters\code\Chapter 8 - Structs\bin\Debug\Chapter 8 - Structs.exe
+d:\data\booknew\chapters\code\Chapter 8 - Structs\bin\Debug\Chapter 8 - Structs.pdb
+d:\data\booknew\chapters\code\Chapter 8 - Structs\obj\Debug\Chapter 8 - Structs.exe
+d:\data\booknew\chapters\code\Chapter 8 - Structs\obj\Debug\Chapter 8 - Structs.pdb
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.csprojResolveAssemblyReference.cache b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.csprojResolveAssemblyReference.cache
new file mode 100644
index 0000000..ff54045
Binary files /dev/null and b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.csprojResolveAssemblyReference.cache differ
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.exe b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.exe
new file mode 100644
index 0000000..3fed961
Binary files /dev/null and b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.exe differ
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.pdb b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.pdb
new file mode 100644
index 0000000..1805eeb
Binary files /dev/null and b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/Chapter 8 - Structs.pdb differ
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..01ced6b
Binary files /dev/null and b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
new file mode 100644
index 0000000..e69de29
diff --git a/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/08 - Structs (Value Types)/Chapter 8 - Structs/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
new file mode 100644
index 0000000..e69de29
diff --git a/08 - Structs (Value Types)/Structs and Constructors/Build1.bat b/08 - Structs (Value Types)/Structs and Constructors/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/08 - Structs (Value Types)/Structs and Constructors/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/08 - Structs (Value Types)/Structs and Constructors/File_1.cs b/08 - Structs (Value Types)/Structs and Constructors/File_1.cs
new file mode 100644
index 0000000..b0d81a9
--- /dev/null
+++ b/08 - Structs (Value Types)/Structs and Constructors/File_1.cs
@@ -0,0 +1,26 @@
+// 09 - Structs (Value Types)\Structs and Constructors
+// copyright 2000 Eric Gunnerson
+using System;
+struct Point
+{
+ int x;
+ int y;
+
+ Point(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+ public override string ToString()
+ {
+ return(String.Format("({0}, {1})", x, y));
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Point[] points = new Point[5];
+ Console.WriteLine("[2] = {0}", points[2]);
+ }
+}
\ No newline at end of file
diff --git a/09 - Interfaces/A Simple Example/Build1.bat b/09 - Interfaces/A Simple Example/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/09 - Interfaces/A Simple Example/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/09 - Interfaces/A Simple Example/File_1.cs b/09 - Interfaces/A Simple Example/File_1.cs
new file mode 100644
index 0000000..24e8000
--- /dev/null
+++ b/09 - Interfaces/A Simple Example/File_1.cs
@@ -0,0 +1,45 @@
+// 10 - Interfaces\A Simple Example
+// copyright 2000 Eric Gunnerson
+public class DiagramObject
+{
+ public DiagramObject() {}
+}
+
+interface IScalable
+{
+ void ScaleX(float factor);
+ void ScaleY(float factor);
+}
+// A diagram object that also implements IScalable
+public class TextObject: DiagramObject, IScalable
+{
+ public TextObject(string text)
+ {
+ this.text = text;
+ }
+ // implementing IScalable.ScaleX()
+ public void ScaleX(float factor)
+ {
+ // scale the object here.
+ }
+
+ // implementing IScalable.ScaleY()
+ public void ScaleY(float factor)
+ {
+ // scale the object here.
+ }
+
+ private string text;
+}
+
+class Test
+{
+ public static void Main()
+ {
+ TextObject text = new TextObject("Hello");
+
+ IScalable scalable = (IScalable) text;
+ scalable.ScaleX(0.5F);
+ scalable.ScaleY(0.5F);
+ }
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Interfaces Based on Interfaces/Build1.bat b/09 - Interfaces/Interfaces Based on Interfaces/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/09 - Interfaces/Interfaces Based on Interfaces/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/09 - Interfaces/Interfaces Based on Interfaces/File_1.cs b/09 - Interfaces/Interfaces Based on Interfaces/File_1.cs
new file mode 100644
index 0000000..10d9e3b
--- /dev/null
+++ b/09 - Interfaces/Interfaces Based on Interfaces/File_1.cs
@@ -0,0 +1,9 @@
+// 10 - Interfaces\Interfaces Based on Interfaces
+// copyright 2000 Eric Gunnerson
+using System.Runtime.Serialization;
+using System;
+interface IComparableSerializable :
+IComparable, ISerializable
+{
+ string GetStatusString();
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Interfaces and Inheritance/Build1.bat b/09 - Interfaces/Interfaces and Inheritance/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/09 - Interfaces/Interfaces and Inheritance/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/09 - Interfaces/Interfaces and Inheritance/File_1.cs b/09 - Interfaces/Interfaces and Inheritance/File_1.cs
new file mode 100644
index 0000000..30647dc
--- /dev/null
+++ b/09 - Interfaces/Interfaces and Inheritance/File_1.cs
@@ -0,0 +1,33 @@
+// 10 - Interfaces\Interfaces and Inheritance
+// copyright 2000 Eric Gunnerson
+using System;
+interface IHelper
+{
+ void HelpMeNow();
+}
+public class Base: IHelper
+{
+ public void HelpMeNow()
+ {
+ Console.WriteLine("Base.HelpMeNow()");
+ }
+}
+// Does not implement IHelper, though it has the right
+// form.
+public class Derived: Base
+{
+ public new void HelpMeNow()
+ {
+ Console.WriteLine("Derived.HelpMeNow()");
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Derived der = new Derived();
+ der.HelpMeNow();
+ IHelper helper = (IHelper) der;
+ helper.HelpMeNow();
+ }
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Interfaces and Structs/Build1.bat b/09 - Interfaces/Interfaces and Structs/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/09 - Interfaces/Interfaces and Structs/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/09 - Interfaces/Interfaces and Structs/File_1.cs b/09 - Interfaces/Interfaces and Structs/File_1.cs
new file mode 100644
index 0000000..e973600
--- /dev/null
+++ b/09 - Interfaces/Interfaces and Structs/File_1.cs
@@ -0,0 +1,33 @@
+// 10 - Interfaces\Interfaces and Structs
+// copyright 2000 Eric Gunnerson
+using System;
+struct Number: IComparable
+{
+ int value;
+
+ public Number(int value)
+ {
+ this.value = value;
+ }
+ public int CompareTo(object obj2)
+ {
+ Number num2 = (Number) obj2;
+ if (value < num2.value)
+ return(-1);
+ else if (value > num2.value)
+ return(1);
+ else
+ return(0);
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Number x = new Number(33);
+ Number y = new Number(34);
+
+ IComparable Ic = (IComparable) x;
+ Console.WriteLine("x compared to y = {0}", Ic.CompareTo(y));
+ }
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Multiple Implementation/Build1.bat b/09 - Interfaces/Multiple Implementation/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/09 - Interfaces/Multiple Implementation/Build2.bat b/09 - Interfaces/Multiple Implementation/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/Build1.bat b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/Build3.bat b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/Build3.bat
new file mode 100644
index 0000000..b764232
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/Build3.bat
@@ -0,0 +1 @@
+csc File_3.cs
diff --git a/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/Build4.bat b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/Build4.bat
new file mode 100644
index 0000000..8bc2ca0
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/Build4.bat
@@ -0,0 +1 @@
+csc File_4.cs
diff --git a/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/File_1.cs b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/File_1.cs
new file mode 100644
index 0000000..5a2842d
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/File_1.cs
@@ -0,0 +1,38 @@
+// 10 - Interfaces\Multiple Implementation\Explicit Interface Implementation
+// copyright 2000 Eric Gunnerson
+using System;
+interface IFoo
+{
+ void Execute();
+}
+
+interface IBar
+{
+ void Execute();
+}
+
+class Tester: IFoo, IBar
+{
+ void IFoo.Execute()
+ {
+ Console.WriteLine("IFoo.Execute implementation");
+ }
+ void IBar.Execute()
+ {
+ Console.WriteLine("IBar.Execute implementation");
+ }
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Tester tester = new Tester();
+
+ IFoo iFoo = (IFoo) tester;
+ iFoo.Execute();
+
+ IBar iBar = (IBar) tester;
+ iBar.Execute();
+ }
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/File_3.cs b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/File_3.cs
new file mode 100644
index 0000000..e8bb7c7
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/File_3.cs
@@ -0,0 +1,34 @@
+// 10 - Interfaces\Multiple Implementation\Explicit Interface Implementation
+// copyright 2000 Eric Gunnerson
+// error
+using System;
+interface IFoo
+{
+ void Execute();
+}
+
+interface IBar
+{
+ void Execute();
+}
+
+class Tester: IFoo, IBar
+{
+ void IFoo.Execute()
+ {
+ Console.WriteLine("IFoo.Execute implementation");
+ }
+ void IBar.Execute()
+ {
+ Console.WriteLine("IBar.Execute implementation");
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Tester tester = new Tester();
+
+ tester.Execute();
+ }
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/File_4.cs b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/File_4.cs
new file mode 100644
index 0000000..6eaf11a
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Explicit Interface Implementation/File_4.cs
@@ -0,0 +1,37 @@
+// 10 - Interfaces\Multiple Implementation\Explicit Interface Implementation
+// copyright 2000 Eric Gunnerson
+using System;
+interface IFoo
+{
+ void Execute();
+}
+
+interface IBar
+{
+ void Execute();
+}
+class Tester: IFoo, IBar
+{
+ void IFoo.Execute()
+ {
+ Console.WriteLine("IFoo.Execute implementation");
+ }
+ void IBar.Execute()
+ {
+ Console.WriteLine("IBar.Execute implementation");
+ }
+
+ public void Execute()
+ {
+ ((IFoo) this).Execute();
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Tester tester = new Tester();
+
+ tester.Execute();
+ }
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Multiple Implementation/File_1.cs b/09 - Interfaces/Multiple Implementation/File_1.cs
new file mode 100644
index 0000000..d1f73d6
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/File_1.cs
@@ -0,0 +1,17 @@
+// 10 - Interfaces\Multiple Implementation
+// copyright 2000 Eric Gunnerson
+interface IFoo
+{
+ void ExecuteFoo();
+}
+
+interface IBar
+{
+ void ExecuteBar();
+}
+
+class Tester: IFoo, IBar
+{
+ public void ExecuteFoo() {}
+ public void ExecuteBar() {}
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Multiple Implementation/File_2.cs b/09 - Interfaces/Multiple Implementation/File_2.cs
new file mode 100644
index 0000000..cf9394e
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/File_2.cs
@@ -0,0 +1,18 @@
+// 10 - Interfaces\Multiple Implementation
+// copyright 2000 Eric Gunnerson
+// error
+interface IFoo
+{
+ void Execute();
+}
+
+interface IBar
+{
+ void Execute();
+}
+
+class Tester: IFoo, IBar
+{
+ // IFoo or IBar implementation?
+ public void Execute() {}
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Multiple Implementation/Implementation Hiding/Build1.bat b/09 - Interfaces/Multiple Implementation/Implementation Hiding/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Implementation Hiding/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/09 - Interfaces/Multiple Implementation/Implementation Hiding/File_1.cs b/09 - Interfaces/Multiple Implementation/Implementation Hiding/File_1.cs
new file mode 100644
index 0000000..7b4a2f3
--- /dev/null
+++ b/09 - Interfaces/Multiple Implementation/Implementation Hiding/File_1.cs
@@ -0,0 +1,33 @@
+// 10 - Interfaces\Multiple Implementation\Implementation Hiding
+// copyright 2000 Eric Gunnerson
+using System;
+class DrawingSurface
+{
+
+}
+interface IRenderIcon
+{
+ void DrawIcon(DrawingSurface surface, int x, int y);
+ void DragIcon(DrawingSurface surface, int x, int y, int x2, int y2);
+ void ResizeIcon(DrawingSurface surface, int xsize, int ysize);
+}
+class Employee: IRenderIcon
+{
+ public Employee(int id, string name)
+ {
+ this.id = id;
+ this.name = name;
+ }
+ void IRenderIcon.DrawIcon(DrawingSurface surface, int x, int y)
+ {
+ }
+ void IRenderIcon.DragIcon(DrawingSurface surface, int x, int y,
+ int x2, int y2)
+ {
+ }
+ void IRenderIcon.ResizeIcon(DrawingSurface surface, int xsize, int ysize)
+ {
+ }
+ int id;
+ string name;
+}
\ No newline at end of file
diff --git a/09 - Interfaces/The As Operator/Build1.bat b/09 - Interfaces/The As Operator/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/09 - Interfaces/The As Operator/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/09 - Interfaces/The As Operator/File_1.cs b/09 - Interfaces/The As Operator/File_1.cs
new file mode 100644
index 0000000..90238ce
--- /dev/null
+++ b/09 - Interfaces/The As Operator/File_1.cs
@@ -0,0 +1,59 @@
+// 10 - Interfaces\The As Operator
+// copyright 2000 Eric Gunnerson
+using System;
+interface IScalable
+{
+ void ScaleX(float factor);
+ void ScaleY(float factor);
+}
+public class DiagramObject
+{
+ public DiagramObject() {}
+}
+public class TextObject: DiagramObject, IScalable
+{
+ public TextObject(string text)
+ {
+ this.text = text;
+ }
+ // implementing IScalable.ScaleX()
+ public void ScaleX(float factor)
+ {
+ Console.WriteLine("ScaleX: {0} {1}", text, factor);
+ // scale the object here.
+ }
+
+ // implementing IScalable.ScaleY()
+ public void ScaleY(float factor)
+ {
+ Console.WriteLine("ScaleY: {0} {1}", text, factor);
+ // scale the object here.
+ }
+
+ private string text;
+}
+class Test
+{
+ public static void Main()
+ {
+ DiagramObject[] dArray = new DiagramObject[100];
+
+ dArray[0] = new DiagramObject();
+ dArray[1] = new TextObject("Text Dude");
+ dArray[2] = new TextObject("Text Backup");
+
+ // array gets initialized here, with classes that
+ // derive from DiagramObject. Some of them implement
+ // IScalable.
+
+ foreach (DiagramObject d in dArray)
+ {
+ IScalable scalable = d as IScalable;
+ if (scalable != null)
+ {
+ scalable.ScaleX(0.1F);
+ scalable.ScaleY(10.0F);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/09 - Interfaces/Working with Interfaces/Build1.bat b/09 - Interfaces/Working with Interfaces/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/09 - Interfaces/Working with Interfaces/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/09 - Interfaces/Working with Interfaces/File_1.cs b/09 - Interfaces/Working with Interfaces/File_1.cs
new file mode 100644
index 0000000..d12794a
--- /dev/null
+++ b/09 - Interfaces/Working with Interfaces/File_1.cs
@@ -0,0 +1,59 @@
+// 10 - Interfaces\Working with Interfaces
+// copyright 2000 Eric Gunnerson
+using System;
+interface IScalable
+{
+ void ScaleX(float factor);
+ void ScaleY(float factor);
+}
+public class DiagramObject
+{
+ public DiagramObject() {}
+}
+public class TextObject: DiagramObject, IScalable
+{
+ public TextObject(string text)
+ {
+ this.text = text;
+ }
+ // implementing IScalable.ScaleX()
+ public void ScaleX(float factor)
+ {
+ Console.WriteLine("ScaleX: {0} {1}", text, factor);
+ // scale the object here.
+ }
+
+ // implementing IScalable.ScaleY()
+ public void ScaleY(float factor)
+ {
+ Console.WriteLine("ScaleY: {0} {1}", text, factor);
+ // scale the object here.
+ }
+
+ private string text;
+}
+class Test
+{
+ public static void Main()
+ {
+ DiagramObject[] dArray = new DiagramObject[100];
+
+ dArray[0] = new DiagramObject();
+ dArray[1] = new TextObject("Text Dude");
+ dArray[2] = new TextObject("Text Backup");
+
+ // array gets initialized here, with classes that
+ // derive from DiagramObject. Some of them implement
+ // IScalable.
+
+ foreach (DiagramObject d in dArray)
+ {
+ if (d is IScalable)
+ {
+ IScalable scalable = (IScalable) d;
+ scalable.ScaleX(0.1F);
+ scalable.ScaleY(10.0F);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/A Versioning Example/Build1.bat b/10 - Versioning and Aliases/A Versioning Example/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/10 - Versioning and Aliases/A Versioning Example/Build2.bat b/10 - Versioning and Aliases/A Versioning Example/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/10 - Versioning and Aliases/A Versioning Example/Build3.bat b/10 - Versioning and Aliases/A Versioning Example/Build3.bat
new file mode 100644
index 0000000..b764232
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/Build3.bat
@@ -0,0 +1 @@
+csc File_3.cs
diff --git a/10 - Versioning and Aliases/A Versioning Example/Build4.bat b/10 - Versioning and Aliases/A Versioning Example/Build4.bat
new file mode 100644
index 0000000..8bc2ca0
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/Build4.bat
@@ -0,0 +1 @@
+csc File_4.cs
diff --git a/10 - Versioning and Aliases/A Versioning Example/Build5.bat b/10 - Versioning and Aliases/A Versioning Example/Build5.bat
new file mode 100644
index 0000000..3d4a61f
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/Build5.bat
@@ -0,0 +1 @@
+csc File_5.cs
diff --git a/10 - Versioning and Aliases/A Versioning Example/File_1.cs b/10 - Versioning and Aliases/A Versioning Example/File_1.cs
new file mode 100644
index 0000000..5bb9a9b
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/File_1.cs
@@ -0,0 +1,8 @@
+// 11 - Versioning\A Versioning Example
+// copyright 2000 Eric Gunnerson
+public class Control
+{
+}
+public class MyControl: Control
+{
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/A Versioning Example/File_2.cs b/10 - Versioning and Aliases/A Versioning Example/File_2.cs
new file mode 100644
index 0000000..f97a722
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/File_2.cs
@@ -0,0 +1,10 @@
+// 11 - Versioning\A Versioning Example
+// copyright 2000 Eric Gunnerson
+public class Control
+{
+
+}
+public class MyControl: Control
+{
+ public virtual void Foo() {}
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/A Versioning Example/File_3.cs b/10 - Versioning and Aliases/A Versioning Example/File_3.cs
new file mode 100644
index 0000000..4ddd091
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/File_3.cs
@@ -0,0 +1,11 @@
+// 11 - Versioning\A Versioning Example
+// copyright 2000 Eric Gunnerson
+public class Control
+{
+ // newly added virtual
+ public virtual void Foo() {}
+}
+public class MyControl: Control
+{
+ public virtual void Foo() {}
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/A Versioning Example/File_4.cs b/10 - Versioning and Aliases/A Versioning Example/File_4.cs
new file mode 100644
index 0000000..0fcff90
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/File_4.cs
@@ -0,0 +1,11 @@
+// 11 - Versioning\A Versioning Example
+// copyright 2000 Eric Gunnerson
+class Control
+{
+ public virtual void Foo() {}
+}
+class MyControl: Control
+{
+ // not an override
+ public new virtual void Foo() {}
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/A Versioning Example/File_5.cs b/10 - Versioning and Aliases/A Versioning Example/File_5.cs
new file mode 100644
index 0000000..175f733
--- /dev/null
+++ b/10 - Versioning and Aliases/A Versioning Example/File_5.cs
@@ -0,0 +1,11 @@
+// 11 - Versioning\A Versioning Example
+// copyright 2000 Eric Gunnerson
+class Control
+{
+ public virtual void Foo() {}
+}
+class MyControl: Control
+{
+ // an override for Control.Foo()
+ public override void Foo() {}
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.csproj b/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.csproj
new file mode 100644
index 0000000..42bee33
--- /dev/null
+++ b/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.csproj
@@ -0,0 +1,61 @@
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {2FDCD8A1-F856-489F-ADEC-555344F2324E}
+ Exe
+ Properties
+ Chapter_10_Versioning
+ Chapter 10 Versioning
+ v4.0
+ Client
+ 512
+
+
+ x86
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ x86
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+ Fred
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.csproj.user b/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.csproj.user
new file mode 100644
index 0000000..ace9a86
--- /dev/null
+++ b/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.csproj.user
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.sln b/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.sln
new file mode 100644
index 0000000..226ad4e
--- /dev/null
+++ b/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C# Express 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chapter 10 Versioning", "Chapter 10 Versioning.csproj", "{2FDCD8A1-F856-489F-ADEC-555344F2324E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2FDCD8A1-F856-489F-ADEC-555344F2324E}.Debug|x86.ActiveCfg = Debug|x86
+ {2FDCD8A1-F856-489F-ADEC-555344F2324E}.Debug|x86.Build.0 = Debug|x86
+ {2FDCD8A1-F856-489F-ADEC-555344F2324E}.Release|x86.ActiveCfg = Release|x86
+ {2FDCD8A1-F856-489F-ADEC-555344F2324E}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.suo b/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.suo
new file mode 100644
index 0000000..6e1545f
Binary files /dev/null and b/10 - Versioning and Aliases/Chapter 10 Versioning/Chapter 10 Versioning.suo differ
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/Employee1.cs b/10 - Versioning and Aliases/Chapter 10 Versioning/Employee1.cs
new file mode 100644
index 0000000..251dad6
--- /dev/null
+++ b/10 - Versioning and Aliases/Chapter 10 Versioning/Employee1.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MyCompany.HumanResources.Application.DataModel
+{
+ class Employee
+ {
+ public string Name { get; set; }
+ }
+}
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/Employee2.cs b/10 - Versioning and Aliases/Chapter 10 Versioning/Employee2.cs
new file mode 100644
index 0000000..24f22df
--- /dev/null
+++ b/10 - Versioning and Aliases/Chapter 10 Versioning/Employee2.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MyCompany.Computer.Network.Model.Classes
+{
+ class Employee
+ {
+ public string Name { get; set; }
+ }
+}
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/Program.cs b/10 - Versioning and Aliases/Chapter 10 Versioning/Program.cs
new file mode 100644
index 0000000..72d7830
--- /dev/null
+++ b/10 - Versioning and Aliases/Chapter 10 Versioning/Program.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using NetworkEmployee = MyCompany.Computer.Network.Model.Classes.Employee;
+using HREmployee = MyCompany.HumanResources.Application.DataModel.Employee;
+
+namespace Chapter_10_Versioning
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+
+ }
+
+public MyCompany.Computer.Network.Model.Classes.Employee CopyEmployeeData2(MyCompany.HumanResources.Application.DataModel.Employee hrEmployee)
+{
+ MyCompany.Computer.Network.Model.Classes.Employee networkEmployee = new MyCompany.Computer.Network.Model.Classes.Employee();
+ networkEmployee.Name = hrEmployee.Name;
+
+ return networkEmployee;
+}
+
+public NetworkEmployee CopyEmployeeData(HREmployee hrEmployee)
+{
+ NetworkEmployee networkEmployee = new NetworkEmployee();
+ networkEmployee.Name = hrEmployee.Name;
+
+ return networkEmployee;
+}
+
+ }
+}
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/Properties/AssemblyInfo.cs b/10 - Versioning and Aliases/Chapter 10 Versioning/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..750ead3
--- /dev/null
+++ b/10 - Versioning and Aliases/Chapter 10 Versioning/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Chapter 10 Versioning")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Chapter 10 Versioning")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("a8ed280a-ba1b-4930-a010-127d3a1cdcad")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/bin/Debug/Chapter 10 Versioning.vshost.exe b/10 - Versioning and Aliases/Chapter 10 Versioning/bin/Debug/Chapter 10 Versioning.vshost.exe
new file mode 100644
index 0000000..bb84a51
Binary files /dev/null and b/10 - Versioning and Aliases/Chapter 10 Versioning/bin/Debug/Chapter 10 Versioning.vshost.exe differ
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/10 - Versioning and Aliases/Chapter 10 Versioning/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..32eca11
Binary files /dev/null and b/10 - Versioning and Aliases/Chapter 10 Versioning/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/10 - Versioning and Aliases/Chapter 10 Versioning/obj/x86/Debug/build.force b/10 - Versioning and Aliases/Chapter 10 Versioning/obj/x86/Debug/build.force
new file mode 100644
index 0000000..e69de29
diff --git a/10 - Versioning and Aliases/ExternAlias/MyApp.exe b/10 - Versioning and Aliases/ExternAlias/MyApp.exe
new file mode 100644
index 0000000..651df29
Binary files /dev/null and b/10 - Versioning and Aliases/ExternAlias/MyApp.exe differ
diff --git a/10 - Versioning and Aliases/ExternAlias/math.cs b/10 - Versioning and Aliases/ExternAlias/math.cs
new file mode 100644
index 0000000..ee1a2a8
--- /dev/null
+++ b/10 - Versioning and Aliases/ExternAlias/math.cs
@@ -0,0 +1,8 @@
+//in assembly Math.dll
+namespace AcmeScientific
+{
+ public class Math
+ {
+ public int Calc() { return 0;}
+ }
+}
diff --git a/10 - Versioning and Aliases/ExternAlias/maths.dll b/10 - Versioning and Aliases/ExternAlias/maths.dll
new file mode 100644
index 0000000..78a750e
Binary files /dev/null and b/10 - Versioning and Aliases/ExternAlias/maths.dll differ
diff --git a/10 - Versioning and Aliases/ExternAlias/source.cs b/10 - Versioning and Aliases/ExternAlias/source.cs
new file mode 100644
index 0000000..5cef490
--- /dev/null
+++ b/10 - Versioning and Aliases/ExternAlias/source.cs
@@ -0,0 +1,16 @@
+extern alias Maths;
+extern alias Utils;
+
+namespace AcmeScientific.MyApp
+{
+class App{
+ static void Main()
+ {
+ Maths::AcmeScientific.Math m = new Maths::AcmeScientific.Math();
+ m.Calc();
+
+ Utils::AcmeScientific.Math u = new Utils::AcmeScientific.Math();
+ u.DoSums();
+ }
+ }
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/ExternAlias/source1.cs b/10 - Versioning and Aliases/ExternAlias/source1.cs
new file mode 100644
index 0000000..6ee16fc
--- /dev/null
+++ b/10 - Versioning and Aliases/ExternAlias/source1.cs
@@ -0,0 +1,13 @@
+extern alias Maths;
+using Maths::AcmeScientific;
+
+namespace AcmeScientific.MyApp
+{
+class App{
+ static void Main()
+ {
+ Math m = new Math();
+ m.Calc();
+ }
+ }
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/ExternAlias/source2.cs b/10 - Versioning and Aliases/ExternAlias/source2.cs
new file mode 100644
index 0000000..8145f69
--- /dev/null
+++ b/10 - Versioning and Aliases/ExternAlias/source2.cs
@@ -0,0 +1,12 @@
+using AcmeScientific;
+
+namespace AcmeScientific.MyApp
+{
+class App{
+ static void Main()
+ {
+ Math m = new Math();
+ m.Calc();
+ }
+ }
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/ExternAlias/source3.cs b/10 - Versioning and Aliases/ExternAlias/source3.cs
new file mode 100644
index 0000000..970127a
--- /dev/null
+++ b/10 - Versioning and Aliases/ExternAlias/source3.cs
@@ -0,0 +1,12 @@
+using global::AcmeScientific;
+
+namespace AcmeScientific.MyApp
+{
+class App{
+ static void Main()
+ {
+ Math m = new Math();
+ m.Calc();
+ }
+ }
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/ExternAlias/utils.cs b/10 - Versioning and Aliases/ExternAlias/utils.cs
new file mode 100644
index 0000000..fffad7d
--- /dev/null
+++ b/10 - Versioning and Aliases/ExternAlias/utils.cs
@@ -0,0 +1,8 @@
+//in assembly Utils.dll
+namespace AcmeScientific
+{
+ public class Math
+ {
+ public void DoSums() {}
+ }
+}
\ No newline at end of file
diff --git a/10 - Versioning and Aliases/ExternAlias/utils.dll b/10 - Versioning and Aliases/ExternAlias/utils.dll
new file mode 100644
index 0000000..1b7ee3a
Binary files /dev/null and b/10 - Versioning and Aliases/ExternAlias/utils.dll differ
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/Do/Build1.bat b/11 - Statements and Flow of Execution/Iteration Statements/Do/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/Do/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/Do/File_1.cs b/11 - Statements and Flow of Execution/Iteration Statements/Do/File_1.cs
new file mode 100644
index 0000000..3423b6f
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/Do/File_1.cs
@@ -0,0 +1,15 @@
+// 12 - Statements and Flow of Execution\Iteration Statements\Do
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ int n = 0;
+ do
+ {
+ Console.WriteLine("Number is {0}", n);
+ n++;
+ } while (n < 10);
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/For/Build1.bat b/11 - Statements and Flow of Execution/Iteration Statements/For/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/For/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/For/Build2.bat b/11 - Statements and Flow of Execution/Iteration Statements/For/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/For/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/For/File_1.cs b/11 - Statements and Flow of Execution/Iteration Statements/For/File_1.cs
new file mode 100644
index 0000000..b4c70bf
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/For/File_1.cs
@@ -0,0 +1,11 @@
+// 12 - Statements and Flow of Execution\Iteration Statements\For
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ for (int n = 0; n < 10; n++)
+ Console.WriteLine("Number is {0}", n);
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/For/File_2.cs b/11 - Statements and Flow of Execution/Iteration Statements/For/File_2.cs
new file mode 100644
index 0000000..faedd1b
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/For/File_2.cs
@@ -0,0 +1,18 @@
+// 12 - Statements and Flow of Execution\Iteration Statements\For
+// copyright 2000 Eric Gunnerson
+// error
+using System;
+class Test
+{
+ public static void Main()
+ {
+ for (int n = 0; n < 10; n++)
+ {
+ if (n == 8)
+ break;
+ Console.WriteLine("Number is {0}", n);
+ }
+ // error; n is out of scope
+ Console.WriteLine("Last Number is {0}", n);
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/Foreach/Build1.bat b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/Foreach/Build2.bat b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/Foreach/Build3.bat b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/Build3.bat
new file mode 100644
index 0000000..b764232
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/Build3.bat
@@ -0,0 +1 @@
+csc File_3.cs
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/Foreach/File_1.cs b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/File_1.cs
new file mode 100644
index 0000000..73bbf90
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/File_1.cs
@@ -0,0 +1,20 @@
+// 12 - Statements and Flow of Execution\Iteration Statements\Foreach
+// copyright 2000 Eric Gunnerson
+using System;
+using System.Collections;
+class MyObject
+{
+}
+class Test
+{
+ public static void Process(ArrayList arr)
+ {
+ for (int nIndex = 0; nIndex < arr.Count; nIndex++)
+ {
+ // cast is required by ArrayList stores
+ // object references
+ MyObject current = (MyObject) arr[nIndex];
+ Console.WriteLine("Item: {0}", current);
+ }
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/Foreach/File_2.cs b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/File_2.cs
new file mode 100644
index 0000000..89ec8ac
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/File_2.cs
@@ -0,0 +1,17 @@
+// 12 - Statements and Flow of Execution\Iteration Statements\Foreach
+// copyright 2000 Eric Gunnerson
+using System;
+using System.Collections;
+class MyObject
+{
+}
+class Test
+{
+ public static void Process(ArrayList arr)
+ {
+ foreach (MyObject current in arr)
+ {
+ Console.WriteLine("Item: {0}", current);
+ }
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/Foreach/File_3.cs b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/File_3.cs
new file mode 100644
index 0000000..229096f
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/Foreach/File_3.cs
@@ -0,0 +1,21 @@
+// 12 - Statements and Flow of Execution\Iteration Statements\Foreach
+// copyright 2000 Eric Gunnerson
+using System;
+using System.Collections;
+class Test
+{
+ public static void Main()
+ {
+ Hashtable hash = new Hashtable();
+ hash.Add("Fred", "Flintstone");
+ hash.Add("Barney", "Rubble");
+ hash.Add("Mr.", "Slate");
+ hash.Add("Wilma", "Flintstone");
+ hash.Add("Betty", "Rubble");
+
+ foreach (string firstName in hash.Keys)
+ {
+ Console.WriteLine("{0} {1}", firstName, hash[firstName]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/While/Build1.bat b/11 - Statements and Flow of Execution/Iteration Statements/While/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/While/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/While/Build2.bat b/11 - Statements and Flow of Execution/Iteration Statements/While/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/While/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/While/File_1.cs b/11 - Statements and Flow of Execution/Iteration Statements/While/File_1.cs
new file mode 100644
index 0000000..31215b2
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/While/File_1.cs
@@ -0,0 +1,15 @@
+// 12 - Statements and Flow of Execution\Iteration Statements\While
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ int n = 0;
+ while (n < 10)
+ {
+ Console.WriteLine("Number is {0}", n);
+ n++;
+ }
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Iteration Statements/While/File_2.cs b/11 - Statements and Flow of Execution/Iteration Statements/While/File_2.cs
new file mode 100644
index 0000000..297907c
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Iteration Statements/While/File_2.cs
@@ -0,0 +1,22 @@
+// 12 - Statements and Flow of Execution\Iteration Statements\While
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ int n = 0;
+ while (n < 10)
+ {
+ if (n == 3)
+ {
+ n++;
+ continue;
+ }
+ if (n == 8)
+ break;
+ Console.WriteLine("Number is {0}", n);
+ n++;
+ }
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Selection Statements/If/Build1.bat b/11 - Statements and Flow of Execution/Selection Statements/If/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Selection Statements/If/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/11 - Statements and Flow of Execution/Selection Statements/If/File_1.cs b/11 - Statements and Flow of Execution/Selection Statements/If/File_1.cs
new file mode 100644
index 0000000..c4a6a5f
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Selection Statements/If/File_1.cs
@@ -0,0 +1,17 @@
+// 12 - Statements and Flow of Execution\Selection Statements\If
+// copyright 2000 Eric Gunnerson
+// error
+using System;
+class Test
+{
+ public static void Main()
+ {
+ int value;
+
+ if (value) // invalid
+ System.Console.WriteLine("true");
+
+ if (value == 0) // must use this
+ System.Console.WriteLine("true");
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Selection Statements/Switch/Build1.bat b/11 - Statements and Flow of Execution/Selection Statements/Switch/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Selection Statements/Switch/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/11 - Statements and Flow of Execution/Selection Statements/Switch/Build2.bat b/11 - Statements and Flow of Execution/Selection Statements/Switch/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Selection Statements/Switch/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/11 - Statements and Flow of Execution/Selection Statements/Switch/File_1.cs b/11 - Statements and Flow of Execution/Selection Statements/Switch/File_1.cs
new file mode 100644
index 0000000..db2700c
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Selection Statements/Switch/File_1.cs
@@ -0,0 +1,29 @@
+// 12 - Statements and Flow of Execution\Selection Statements\Switch
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public void Process(int i)
+ {
+ switch (i)
+ {
+ case 1:
+ case 2:
+ // code here handles both 1 and 2
+ Console.WriteLine("Low Number");
+ break;
+
+ case 3:
+ Console.WriteLine("3");
+ goto case 4;
+
+ case 4:
+ Console.WriteLine("Middle Number");
+ break;
+
+ default:
+ Console.WriteLine("Default Number");
+ break;
+ }
+ }
+}
\ No newline at end of file
diff --git a/11 - Statements and Flow of Execution/Selection Statements/Switch/File_2.cs b/11 - Statements and Flow of Execution/Selection Statements/Switch/File_2.cs
new file mode 100644
index 0000000..54b485e
--- /dev/null
+++ b/11 - Statements and Flow of Execution/Selection Statements/Switch/File_2.cs
@@ -0,0 +1,24 @@
+// 12 - Statements and Flow of Execution\Selection Statements\Switch
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public void Process(string htmlTag)
+ {
+ switch (htmlTag)
+ {
+ case "P":
+ Console.WriteLine("Paragraph start");
+ break;
+ case "DIV":
+ Console.WriteLine("Division");
+ break;
+ case "FORM":
+ Console.WriteLine("Form Tag");
+ break;
+ default:
+ Console.WriteLine("Unrecognized tag");
+ break;
+ }
+ }
+}
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/Build.bat b/12 - Variable Scoping and Definite Assignment/Build.bat
new file mode 100644
index 0000000..6b55348
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Build.bat
@@ -0,0 +1 @@
+csc File_.cs
diff --git a/12 - Variable Scoping and Definite Assignment/Build1.bat b/12 - Variable Scoping and Definite Assignment/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/App.config b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/App.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment.csproj b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment.csproj
new file mode 100644
index 0000000..0ba1189
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment.csproj
@@ -0,0 +1,61 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {DECF55EC-60F3-4F63-AB44-ED1695CA59ED}
+ Exe
+ Properties
+ Chapter_12___Variable_Scoping_and_Definite_Assignment
+ Chapter 12 - Variable Scoping and Definite Assignment
+ v4.5
+ 512
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment.sln b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment.sln
new file mode 100644
index 0000000..0c82d50
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chapter 12 - Variable Scoping and Definite Assignment", "Chapter 12 - Variable Scoping and Definite Assignment.csproj", "{DECF55EC-60F3-4F63-AB44-ED1695CA59ED}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {DECF55EC-60F3-4F63-AB44-ED1695CA59ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DECF55EC-60F3-4F63-AB44-ED1695CA59ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DECF55EC-60F3-4F63-AB44-ED1695CA59ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DECF55EC-60F3-4F63-AB44-ED1695CA59ED}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment.v11.suo b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment.v11.suo
new file mode 100644
index 0000000..e90712a
Binary files /dev/null and b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment.v11.suo differ
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/ClassDefiniteAssignment.cs b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/ClassDefiniteAssignment.cs
new file mode 100644
index 0000000..26ae965
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/ClassDefiniteAssignment.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Chapter_12___Variable_Scoping_and_Definite_Assignment
+{
+class AlwaysNullName
+{
+ string m_name;
+
+ string GetName()
+ {
+ return m_name;
+ }
+}
+}
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/MyClass.cs b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/MyClass.cs
new file mode 100644
index 0000000..30c804f
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/MyClass.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Chapter_12___Variable_Scoping_and_Definite_Assignment
+{
+ class MyClass
+ {
+ public MyClass(int value)
+ {
+ m_value = value;
+ }
+ public int Calculate()
+ {
+ return (m_value * 10);
+ }
+ public int m_value;
+ }
+ class Test
+ {
+ public static void Mainly()
+ {
+ MyClass mine;
+
+ //Console.WriteLine("{0}", mine.m_value); // error
+ //Console.WriteLine("{0}", mine.Calculate()); // error
+ mine = new MyClass(12);
+ Console.WriteLine("{0}", mine.m_value); // okay now…
+ }
+ }
+
+}
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/MyObject.cs b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/MyObject.cs
new file mode 100644
index 0000000..213df67
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/MyObject.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Chapter_12___Variable_Scoping_and_Definite_Assignment
+{
+ class MyObject
+ {
+ public MyObject(int x)
+ {
+ this.x = x;
+ }
+ int x;
+ }
+}
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Program.cs b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Program.cs
new file mode 100644
index 0000000..0f0a0da
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Program.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Chapter_12___Variable_Scoping_and_Definite_Assignment
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ }
+ }
+}
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Properties/AssemblyInfo.cs b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..e1bea46
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Chapter 12 - Variable Scoping and Definite Assignment")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Chapter 12 - Variable Scoping and Definite Assignment")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5146d7c4-0ae1-495c-846e-0f036275d2c3")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.exe b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.exe
new file mode 100644
index 0000000..b2efc5d
Binary files /dev/null and b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.exe differ
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.exe.config b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.exe.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.pdb b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.pdb
new file mode 100644
index 0000000..130370f
Binary files /dev/null and b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.pdb differ
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.vshost.exe b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.vshost.exe
new file mode 100644
index 0000000..212bd7f
Binary files /dev/null and b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.vshost.exe differ
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.vshost.exe.config b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.vshost.exe.config
new file mode 100644
index 0000000..8e15646
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/bin/Debug/Chapter 12 - Variable Scoping and Definite Assignment.vshost.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.csproj.FileListAbsolute.txt b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..6b1f2b8
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.csproj.FileListAbsolute.txt
@@ -0,0 +1,6 @@
+d:\data\booknew\chapters\code\Chapter 12 - Variable Scoping and Definite Assignment\bin\Debug\Chapter 12 - Variable Scoping and Definite Assignment.exe.config
+d:\data\booknew\chapters\code\Chapter 12 - Variable Scoping and Definite Assignment\obj\Debug\Chapter 12 - Variable Scoping and Definite Assignment.csprojResolveAssemblyReference.cache
+d:\data\booknew\chapters\code\Chapter 12 - Variable Scoping and Definite Assignment\bin\Debug\Chapter 12 - Variable Scoping and Definite Assignment.exe
+d:\data\booknew\chapters\code\Chapter 12 - Variable Scoping and Definite Assignment\bin\Debug\Chapter 12 - Variable Scoping and Definite Assignment.pdb
+d:\data\booknew\chapters\code\Chapter 12 - Variable Scoping and Definite Assignment\obj\Debug\Chapter 12 - Variable Scoping and Definite Assignment.exe
+d:\data\booknew\chapters\code\Chapter 12 - Variable Scoping and Definite Assignment\obj\Debug\Chapter 12 - Variable Scoping and Definite Assignment.pdb
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.csprojResolveAssemblyReference.cache b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.csprojResolveAssemblyReference.cache
new file mode 100644
index 0000000..ff54045
Binary files /dev/null and b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.csprojResolveAssemblyReference.cache differ
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.exe b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.exe
new file mode 100644
index 0000000..b2efc5d
Binary files /dev/null and b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.exe differ
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.pdb b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.pdb
new file mode 100644
index 0000000..130370f
Binary files /dev/null and b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/Chapter 12 - Variable Scoping and Definite Assignment.pdb differ
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..a0a7756
Binary files /dev/null and b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
new file mode 100644
index 0000000..e69de29
diff --git a/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/12 - Variable Scoping and Definite Assignment/Chapter 12 - Variable Scoping and Definite Assignment/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
new file mode 100644
index 0000000..e69de29
diff --git a/12 - Variable Scoping and Definite Assignment/Definite Assignment/Build1.bat b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/12 - Variable Scoping and Definite Assignment/Definite Assignment/Build2.bat b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/12 - Variable Scoping and Definite Assignment/Definite Assignment/Build3.bat b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Build3.bat
new file mode 100644
index 0000000..b764232
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Build3.bat
@@ -0,0 +1 @@
+csc File_3.cs
diff --git a/12 - Variable Scoping and Definite Assignment/Definite Assignment/Definite Assignment and Arrays/Build1.bat b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Definite Assignment and Arrays/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Definite Assignment and Arrays/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/12 - Variable Scoping and Definite Assignment/Definite Assignment/Definite Assignment and Arrays/File_1.cs b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Definite Assignment and Arrays/File_1.cs
new file mode 100644
index 0000000..94e69a3
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Definite Assignment/Definite Assignment and Arrays/File_1.cs
@@ -0,0 +1,27 @@
+// 13 - Variable Scoping and Definite Assignment\Definite Assignment\Definite Assignment and Arrays
+// copyright 2000 Eric Gunnerson
+using System;
+struct Complex
+{
+ public Complex(float real, float imaginary)
+ {
+ this.real = real;
+ this.imaginary = imaginary;
+ }
+ public override string ToString()
+ {
+ return(String.Format("({0}, {0})", real, imaginary));
+ }
+
+ public float real;
+ public float imaginary;
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Complex[] arr = new Complex[10];
+ Console.WriteLine("Element 5: {0}", arr[5]); // legal
+ }
+}
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/Definite Assignment/File_1.cs b/12 - Variable Scoping and Definite Assignment/Definite Assignment/File_1.cs
new file mode 100644
index 0000000..e49e2bc
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Definite Assignment/File_1.cs
@@ -0,0 +1,12 @@
+// 13 - Variable Scoping and Definite Assignment\Definite Assignment
+// copyright 2000 Eric Gunnerson
+// error
+using System;
+class Test
+{
+ public static void Main()
+ {
+ int n;
+ Console.WriteLine("Value of n is {0}", n);
+ }
+}
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/Definite Assignment/File_2.cs b/12 - Variable Scoping and Definite Assignment/Definite Assignment/File_2.cs
new file mode 100644
index 0000000..4351af1
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Definite Assignment/File_2.cs
@@ -0,0 +1,28 @@
+// 13 - Variable Scoping and Definite Assignment\Definite Assignment
+// copyright 2000 Eric Gunnerson
+// error
+using System;
+class MyClass
+{
+ public MyClass(int value)
+ {
+ this.value = value;
+ }
+ public int Calculate()
+ {
+ return(value * 10);
+ }
+ public int value;
+}
+class Test
+{
+ public static void Main()
+ {
+ MyClass mine;
+
+ Console.WriteLine("{0}", mine.value); // error
+ Console.WriteLine("{0}", mine.Calculate()); // error
+ mine = new MyClass(12);
+ Console.WriteLine("{0}", mine.value); // okay now
+ }
+}
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/Definite Assignment/File_3.cs b/12 - Variable Scoping and Definite Assignment/Definite Assignment/File_3.cs
new file mode 100644
index 0000000..c32c78d
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/Definite Assignment/File_3.cs
@@ -0,0 +1,38 @@
+// 13 - Variable Scoping and Definite Assignment\Definite Assignment
+// copyright 2000 Eric Gunnerson
+using System;
+struct Complex
+{
+ public Complex(float real, float imaginary)
+ {
+ this.real = real;
+ this.imaginary = imaginary;
+ }
+ public override string ToString()
+ {
+ return(String.Format("({0}, {1})", real, imaginary));
+ }
+
+ public float real;
+ public float imaginary;
+}
+
+class Test
+{
+ public static void Main()
+ {
+ Complex myNumber1;
+ Complex myNumber2;
+ Complex myNumber3;
+
+ myNumber1 = new Complex();
+ Console.WriteLine("Number 1: {0}", myNumber1);
+
+ myNumber2 = new Complex(5.0F, 4.0F);
+ Console.WriteLine("Number 2: {0}", myNumber2);
+
+ myNumber3.real = 1.5F;
+ myNumber3.imaginary = 15F;
+ Console.WriteLine("Number 3: {0}", myNumber3);
+ }
+}
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/File_.cs b/12 - Variable Scoping and Definite Assignment/File_.cs
new file mode 100644
index 0000000..ca7d7fe
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/File_.cs
@@ -0,0 +1,13 @@
+// 13 - Variable Scoping and Definite Assignment
+// copyright 2000 Eric Gunnerson
+using System;
+class MyObject
+{
+ public MyObject(int x, int y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+ int x;
+ int y;
+}
\ No newline at end of file
diff --git a/12 - Variable Scoping and Definite Assignment/File_1.cs b/12 - Variable Scoping and Definite Assignment/File_1.cs
new file mode 100644
index 0000000..fb67cd4
--- /dev/null
+++ b/12 - Variable Scoping and Definite Assignment/File_1.cs
@@ -0,0 +1,17 @@
+// 13 - Variable Scoping and Definite Assignment
+// copyright 2000 Eric Gunnerson
+// error
+using System;
+class MyObject
+{
+ public void Process()
+ {
+ int x = 12;
+ for (int y = 1; y < 10; y++)
+ {
+ // no way to name outer x here.
+ int x = 14;
+ Console.WriteLine("x = {0}", x);
+ }
+ }
+}
\ No newline at end of file
diff --git a/13 - Operators and Expressions/Arithmetic Operators/Addition (+) over/Numeric Addition/Build1.bat b/13 - Operators and Expressions/Arithmetic Operators/Addition (+) over/Numeric Addition/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/13 - Operators and Expressions/Arithmetic Operators/Addition (+) over/Numeric Addition/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/13 - Operators and Expressions/Arithmetic Operators/Addition (+) over/Numeric Addition/File_1.cs b/13 - Operators and Expressions/Arithmetic Operators/Addition (+) over/Numeric Addition/File_1.cs
new file mode 100644
index 0000000..bac3e06
--- /dev/null
+++ b/13 - Operators and Expressions/Arithmetic Operators/Addition (+) over/Numeric Addition/File_1.cs
@@ -0,0 +1,16 @@
+// 14 - Operators and Expressions\Arithmetic Operators\Addition (+) over\Numeric Addition
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ byte val1 = 200;
+ byte val2 = 201;
+ byte sum = (byte) (val1 + val2); // no exception
+ checked
+ {
+ byte sum2 = (byte) (val1 + val2); // exception
+ }
+ }
+}
\ No newline at end of file
diff --git a/13 - Operators and Expressions/Built-In Operators/Build1.bat b/13 - Operators and Expressions/Built-In Operators/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/13 - Operators and Expressions/Built-In Operators/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/13 - Operators and Expressions/Built-In Operators/File_1.cs b/13 - Operators and Expressions/Built-In Operators/File_1.cs
new file mode 100644
index 0000000..74bbc09
--- /dev/null
+++ b/13 - Operators and Expressions/Built-In Operators/File_1.cs
@@ -0,0 +1,16 @@
+// 14 - Operators and Expressions\Built-In Operators
+// copyright 2000 Eric Gunnerson
+// error
+class Test
+{
+ public static void Main()
+ {
+ short s1 = 15;
+ short s2 = 16;
+ short ssum = (short) (s1 + s2); // cast is required
+
+ int i1 = 15;
+ int i2 = 16;
+ int isum = i1 + i2; // no cast required
+ }
+}
\ No newline at end of file
diff --git a/13 - Operators and Expressions/Checked and Unchecked Expressions/Build1.bat b/13 - Operators and Expressions/Checked and Unchecked Expressions/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/13 - Operators and Expressions/Checked and Unchecked Expressions/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/13 - Operators and Expressions/Checked and Unchecked Expressions/Build2.bat b/13 - Operators and Expressions/Checked and Unchecked Expressions/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/13 - Operators and Expressions/Checked and Unchecked Expressions/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/13 - Operators and Expressions/Checked and Unchecked Expressions/File_1.cs b/13 - Operators and Expressions/Checked and Unchecked Expressions/File_1.cs
new file mode 100644
index 0000000..105aaee
--- /dev/null
+++ b/13 - Operators and Expressions/Checked and Unchecked Expressions/File_1.cs
@@ -0,0 +1,16 @@
+// 14 - Operators and Expressions\Checked and Unchecked Expressions
+// copyright 2000 Eric Gunnerson
+using System;
+
+class Test
+{
+ public static void Main()
+ {
+ checked
+ {
+ byte a = 55;
+ byte b = 210;
+ byte c = (byte) (a + b);
+ }
+ }
+}
\ No newline at end of file
diff --git a/13 - Operators and Expressions/Checked and Unchecked Expressions/File_2.cs b/13 - Operators and Expressions/Checked and Unchecked Expressions/File_2.cs
new file mode 100644
index 0000000..b98c815
--- /dev/null
+++ b/13 - Operators and Expressions/Checked and Unchecked Expressions/File_2.cs
@@ -0,0 +1,16 @@
+// 14 - Operators and Expressions\Checked and Unchecked Expressions
+// copyright 2000 Eric Gunnerson
+using System;
+
+class Test
+{
+ public static void Main()
+ {
+ unchecked
+ {
+ byte a = 55;
+ byte b = 210;
+ byte c = (byte) (a + b);
+ }
+ }
+}
\ No newline at end of file
diff --git a/13 - Operators and Expressions/Type operators/Is/Build1.bat b/13 - Operators and Expressions/Type operators/Is/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/13 - Operators and Expressions/Type operators/Is/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/13 - Operators and Expressions/Type operators/Is/File_1.cs b/13 - Operators and Expressions/Type operators/Is/File_1.cs
new file mode 100644
index 0000000..aa85f9d
--- /dev/null
+++ b/13 - Operators and Expressions/Type operators/Is/File_1.cs
@@ -0,0 +1,35 @@
+// 14 - Operators and Expressions\Type operators\Is
+// copyright 2000 Eric Gunnerson
+using System;
+interface IAnnoy
+{
+ void PokeSister(string name);
+}
+class Brother: IAnnoy
+{
+ public void PokeSister(string name)
+ {
+ Console.WriteLine("Poking {0}", name);
+ }
+}
+class BabyBrother
+{
+}
+class Test
+{
+ public static void AnnoyHer(string sister, params object[] annoyers)
+ {
+ foreach (object o in annoyers)
+ {
+ if (o is IAnnoy)
+ {
+ IAnnoy annoyer = (IAnnoy) o;
+ annoyer.PokeSister(sister);
+ }
+ }
+ }
+ public static void Main()
+ {
+ Test.AnnoyHer("Jane", new Brother(), new BabyBrother());
+ }
+}
\ No newline at end of file
diff --git a/14 - Conversions/Conversions of Classes (Reference Types)/To an Interface the Object Might Implement/Build1.bat b/14 - Conversions/Conversions of Classes (Reference Types)/To an Interface the Object Might Implement/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/14 - Conversions/Conversions of Classes (Reference Types)/To an Interface the Object Might Implement/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/14 - Conversions/Conversions of Classes (Reference Types)/To an Interface the Object Might Implement/File_1.cs b/14 - Conversions/Conversions of Classes (Reference Types)/To an Interface the Object Might Implement/File_1.cs
new file mode 100644
index 0000000..6ca2eb4
--- /dev/null
+++ b/14 - Conversions/Conversions of Classes (Reference Types)/To an Interface the Object Might Implement/File_1.cs
@@ -0,0 +1,60 @@
+// 15 - Conversions\Conversions of Classes (Reference Types)\To an Interface the Object Might Implement
+// copyright 2000 Eric Gunnerson
+using System;
+interface IDebugDump
+{
+ string DumpObject();
+}
+class Simple
+{
+ public Simple(int value)
+ {
+ this.value = value;
+ }
+ public override string ToString()
+ {
+ return(value.ToString());
+ }
+ int value;
+}
+class Complicated: IDebugDump
+{
+ public Complicated(string name)
+ {
+ this.name = name;
+ }
+ public override string ToString()
+ {
+ return(name);
+ }
+ string IDebugDump.DumpObject()
+ {
+ return(String.Format(
+ "{0}\nLatency: {1}\nRequests: {2}\nFailures: {3}\n",
+ new object[] {name, latency, requestCount, failedCount} ));
+ }
+ string name;
+ int latency = 0;
+ int requestCount = 0;
+ int failedCount = 0;
+}
+class Test
+{
+ public static void DoConsoleDump(params object[] arr)
+ {
+ foreach (object o in arr)
+ {
+ IDebugDump dumper = o as IDebugDump;
+ if (dumper != null)
+ Console.WriteLine("{0}", dumper.DumpObject());
+ else
+ Console.WriteLine("{0}", o);
+ }
+ }
+ public static void Main()
+ {
+ Simple s = new Simple(13);
+ Complicated c = new Complicated("Tracking Test");
+ DoConsoleDump(s, c);
+ }
+}
\ No newline at end of file
diff --git a/14 - Conversions/Conversions of Classes (Reference Types)/To the Base Class of an Object/Build1.bat b/14 - Conversions/Conversions of Classes (Reference Types)/To the Base Class of an Object/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/14 - Conversions/Conversions of Classes (Reference Types)/To the Base Class of an Object/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/14 - Conversions/Conversions of Classes (Reference Types)/To the Base Class of an Object/File_1.cs b/14 - Conversions/Conversions of Classes (Reference Types)/To the Base Class of an Object/File_1.cs
new file mode 100644
index 0000000..4444ecd
--- /dev/null
+++ b/14 - Conversions/Conversions of Classes (Reference Types)/To the Base Class of an Object/File_1.cs
@@ -0,0 +1,31 @@
+// 15 - Conversions\Conversions of Classes (Reference Types)\To the Base Class of an Object
+// copyright 2000 Eric Gunnerson
+using System;
+public class Base
+{
+ public virtual void WhoAmI()
+ {
+ Console.WriteLine("Base");
+ }
+}
+public class Derived: Base
+{
+ public override void WhoAmI()
+ {
+ Console.WriteLine("Derived");
+ }
+}
+public class Test
+{
+ public static void Main()
+ {
+ Derived d = new Derived();
+ Base b = d;
+
+ b.WhoAmI();
+ Derived d2 = (Derived) b;
+
+ object o = d;
+ Derived d3 = (Derived) o;
+ }
+}
\ No newline at end of file
diff --git a/14 - Conversions/Numeric Types/Build1.bat b/14 - Conversions/Numeric Types/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/14 - Conversions/Numeric Types/Checked Conversions/Build1.bat b/14 - Conversions/Numeric Types/Checked Conversions/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Checked Conversions/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/14 - Conversions/Numeric Types/Checked Conversions/Build2.bat b/14 - Conversions/Numeric Types/Checked Conversions/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Checked Conversions/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/14 - Conversions/Numeric Types/Checked Conversions/File_1.cs b/14 - Conversions/Numeric Types/Checked Conversions/File_1.cs
new file mode 100644
index 0000000..31d0136
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Checked Conversions/File_1.cs
@@ -0,0 +1,15 @@
+// 15 - Conversions\Numeric Types\Checked Conversions
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ checked
+ {
+ uint value1 = 312;
+ byte value2 = (byte) value1;
+ Console.WriteLine("Value: {0}", value2);
+ }
+ }
+}
\ No newline at end of file
diff --git a/14 - Conversions/Numeric Types/Checked Conversions/File_2.cs b/14 - Conversions/Numeric Types/Checked Conversions/File_2.cs
new file mode 100644
index 0000000..9d0bbb6
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Checked Conversions/File_2.cs
@@ -0,0 +1,15 @@
+// 15 - Conversions\Numeric Types\Checked Conversions
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ uint value1 = 312;
+ byte value2;
+
+ value2 = unchecked((byte) value1); // never checked
+ value2 = (byte) value1; // checked if /checked
+ value2 = checked((byte) value1); // always checked
+ }
+}
\ No newline at end of file
diff --git a/14 - Conversions/Numeric Types/Conversions and Member Lookup/Build1.bat b/14 - Conversions/Numeric Types/Conversions and Member Lookup/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Conversions and Member Lookup/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/14 - Conversions/Numeric Types/Conversions and Member Lookup/Build3.bat b/14 - Conversions/Numeric Types/Conversions and Member Lookup/Build3.bat
new file mode 100644
index 0000000..b764232
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Conversions and Member Lookup/Build3.bat
@@ -0,0 +1 @@
+csc File_3.cs
diff --git a/14 - Conversions/Numeric Types/Conversions and Member Lookup/File_1.cs b/14 - Conversions/Numeric Types/Conversions and Member Lookup/File_1.cs
new file mode 100644
index 0000000..d8cacd1
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Conversions and Member Lookup/File_1.cs
@@ -0,0 +1,28 @@
+// 15 - Conversions\Numeric Types\Conversions and Member Lookup
+// copyright 2000 Eric Gunnerson
+using System;
+class Conv
+{
+ public static void Process(sbyte value)
+ {
+ Console.WriteLine("sbyte {0}", value);
+ }
+ public static void Process(short value)
+ {
+ Console.WriteLine("short {0}", value);
+ }
+ public static void Process(int value)
+ {
+ Console.WriteLine("int {0}", value);
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ int value1 = 2;
+ sbyte value2 = 1;
+ Conv.Process(value1);
+ Conv.Process(value2);
+ }
+}
\ No newline at end of file
diff --git a/14 - Conversions/Numeric Types/Conversions and Member Lookup/File_3.cs b/14 - Conversions/Numeric Types/Conversions and Member Lookup/File_3.cs
new file mode 100644
index 0000000..2e15abd
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Conversions and Member Lookup/File_3.cs
@@ -0,0 +1,22 @@
+// 15 - Conversions\Numeric Types\Conversions and Member Lookup
+// copyright 2000 Eric Gunnerson
+using System;
+class Conv
+{
+ public static void Process(short value)
+ {
+ Console.WriteLine("short {0}", value);
+ }
+ public static void Process(ushort value)
+ {
+ Console.WriteLine("ushort {0}", value);
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ byte value = 3;
+ Conv.Process(value);
+ }
+}
\ No newline at end of file
diff --git a/14 - Conversions/Numeric Types/Explicit Numeric Conversions/Build1.bat b/14 - Conversions/Numeric Types/Explicit Numeric Conversions/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Explicit Numeric Conversions/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/14 - Conversions/Numeric Types/Explicit Numeric Conversions/File_1.cs b/14 - Conversions/Numeric Types/Explicit Numeric Conversions/File_1.cs
new file mode 100644
index 0000000..3c6f8b6
--- /dev/null
+++ b/14 - Conversions/Numeric Types/Explicit Numeric Conversions/File_1.cs
@@ -0,0 +1,12 @@
+// 15 - Conversions\Numeric Types\Explicit Numeric Conversions
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ uint value1 = 312;
+ byte value2 = (byte) value1;
+ Console.WriteLine("Value2: {0}", value2);
+ }
+}
\ No newline at end of file
diff --git a/14 - Conversions/Numeric Types/File_1.cs b/14 - Conversions/Numeric Types/File_1.cs
new file mode 100644
index 0000000..dafd441
--- /dev/null
+++ b/14 - Conversions/Numeric Types/File_1.cs
@@ -0,0 +1,18 @@
+// 15 - Conversions\Numeric Types
+// copyright 2000 Eric Gunnerson
+class Test
+{
+ public static void Main()
+ {
+ // all implicit
+ sbyte v = 55;
+ short v2 = v;
+ int v3 = v2;
+ long v4 = v3;
+
+ // explicit to "smaller" types
+ v3 = (int) v4;
+ v2 = (short) v3;
+ v = (sbyte) v2;
+ }
+}
\ No newline at end of file
diff --git a/15 - Arrays/Array Conversions/Build1.bat b/15 - Arrays/Array Conversions/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/15 - Arrays/Array Conversions/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/15 - Arrays/Array Conversions/File_1.cs b/15 - Arrays/Array Conversions/File_1.cs
new file mode 100644
index 0000000..6bae418
--- /dev/null
+++ b/15 - Arrays/Array Conversions/File_1.cs
@@ -0,0 +1,18 @@
+// 16 - Arrays\Array Conversions
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void PrintArray(object[] arr)
+ {
+ foreach (object obj in arr)
+ Console.WriteLine("Word: {0}", obj);
+ }
+ public static void Main()
+ {
+ string s = "I will not buy this record, it is scratched.";
+ char[] separators = {' '};
+ string[] words = s.Split(separators);
+ PrintArray(words);
+ }
+}
\ No newline at end of file
diff --git a/15 - Arrays/Arrays of Reference Types/Build1.bat b/15 - Arrays/Arrays of Reference Types/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/15 - Arrays/Arrays of Reference Types/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/15 - Arrays/Arrays of Reference Types/Build2.bat b/15 - Arrays/Arrays of Reference Types/Build2.bat
new file mode 100644
index 0000000..27777ef
--- /dev/null
+++ b/15 - Arrays/Arrays of Reference Types/Build2.bat
@@ -0,0 +1 @@
+csc File_2.cs
diff --git a/15 - Arrays/Arrays of Reference Types/File_1.cs b/15 - Arrays/Arrays of Reference Types/File_1.cs
new file mode 100644
index 0000000..595fd6c
--- /dev/null
+++ b/15 - Arrays/Arrays of Reference Types/File_1.cs
@@ -0,0 +1,19 @@
+// 16 - Arrays\Arrays of Reference Types
+// copyright 2000 Eric Gunnerson
+class Employee
+{
+ public void LoadFromDatabase(int employeeID)
+ {
+ // load code here
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Employee[] emps = new Employee[3];
+ emps[0].LoadFromDatabase(15);
+ emps[1].LoadFromDatabase(35);
+ emps[2].LoadFromDatabase(255);
+ }
+}
\ No newline at end of file
diff --git a/15 - Arrays/Arrays of Reference Types/File_2.cs b/15 - Arrays/Arrays of Reference Types/File_2.cs
new file mode 100644
index 0000000..53a75d8
--- /dev/null
+++ b/15 - Arrays/Arrays of Reference Types/File_2.cs
@@ -0,0 +1,21 @@
+// 16 - Arrays\Arrays of Reference Types
+// copyright 2000 Eric Gunnerson
+class Employee
+{
+ public static Employee LoadFromDatabase(int employeeID)
+ {
+ Employee emp = new Employee();
+ // load code here
+ return(emp);
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ Employee[] emps = new Employee[3];
+ emps[0] = Employee.LoadFromDatabase(15);
+ emps[1] = Employee.LoadFromDatabase(35);
+ emps[2] = Employee.LoadFromDatabase(255);
+ }
+}
\ No newline at end of file
diff --git a/15 - Arrays/Multidimensional and Jagged Arrays/Jagged Arrays/Build1.bat b/15 - Arrays/Multidimensional and Jagged Arrays/Jagged Arrays/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/15 - Arrays/Multidimensional and Jagged Arrays/Jagged Arrays/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/15 - Arrays/Multidimensional and Jagged Arrays/Jagged Arrays/File_1.cs b/15 - Arrays/Multidimensional and Jagged Arrays/Jagged Arrays/File_1.cs
new file mode 100644
index 0000000..8f80e9d
--- /dev/null
+++ b/15 - Arrays/Multidimensional and Jagged Arrays/Jagged Arrays/File_1.cs
@@ -0,0 +1,21 @@
+// 16 - Arrays\Multidimensional and Jagged Arrays\Jagged Arrays
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ int[][] matrix = {new int[5], new int[4], new int[2] };
+ matrix[0][3] = 4;
+ matrix[1][1] = 8;
+ matrix[2][0] = 5;
+
+ for (int i = 0; i < matrix.Length; i++)
+ {
+ for (int j = 0; j < matrix[i].Length; j++)
+ {
+ Console.WriteLine("matrix[{0}, {1}] = {2}", i, j, matrix[i][j]);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/15 - Arrays/Multidimensional and Jagged Arrays/Multidimensional Arrays/Build1.bat b/15 - Arrays/Multidimensional and Jagged Arrays/Multidimensional Arrays/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/15 - Arrays/Multidimensional and Jagged Arrays/Multidimensional Arrays/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/15 - Arrays/Multidimensional and Jagged Arrays/Multidimensional Arrays/File_1.cs b/15 - Arrays/Multidimensional and Jagged Arrays/Multidimensional Arrays/File_1.cs
new file mode 100644
index 0000000..b053bf3
--- /dev/null
+++ b/15 - Arrays/Multidimensional and Jagged Arrays/Multidimensional Arrays/File_1.cs
@@ -0,0 +1,18 @@
+// 16 - Arrays\Multidimensional and Jagged Arrays\Multidimensional Arrays
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ int[,] matrix = { {1, 1}, {2, 2}, {3, 5}, {4, 5}, {134, 44} };
+
+ for (int i = 0; i < matrix.GetLength(0); i++)
+ {
+ for (int j = 0; j < matrix.GetLength(1); j++)
+ {
+ Console.WriteLine("matrix[{0}, {1}] = {2}", i, j, matrix[i, j]);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/15 - Arrays/The System.Array Type/Reverse/Build1.bat b/15 - Arrays/The System.Array Type/Reverse/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/15 - Arrays/The System.Array Type/Reverse/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/15 - Arrays/The System.Array Type/Reverse/File_1.cs b/15 - Arrays/The System.Array Type/Reverse/File_1.cs
new file mode 100644
index 0000000..cc2dbd5
--- /dev/null
+++ b/15 - Arrays/The System.Array Type/Reverse/File_1.cs
@@ -0,0 +1,15 @@
+// 16 - Arrays\The System.Array Type\Reverse
+// copyright 2000 Eric Gunnerson
+using System;
+class Test
+{
+ public static void Main()
+ {
+ int[] arr = {5, 6, 7};
+ Array.Reverse(arr);
+ foreach (int value in arr)
+ {
+ Console.WriteLine("Value: {0}", value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/16 - Properties/Accessors/Build1.bat b/16 - Properties/Accessors/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/16 - Properties/Accessors/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/16 - Properties/Accessors/File_1.cs b/16 - Properties/Accessors/File_1.cs
new file mode 100644
index 0000000..2274ce7
--- /dev/null
+++ b/16 - Properties/Accessors/File_1.cs
@@ -0,0 +1,18 @@
+// 18 - Properties\Accessors
+// copyright 2000 Eric Gunnerson
+class Test
+{
+ private string name;
+
+ public string Name
+ {
+ get
+ {
+ return name;
+ }
+ set
+ {
+ name = value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/16 - Properties/Chapter 16 properties/Chapter 16 properties.csproj b/16 - Properties/Chapter 16 properties/Chapter 16 properties.csproj
new file mode 100644
index 0000000..ed96699
--- /dev/null
+++ b/16 - Properties/Chapter 16 properties/Chapter 16 properties.csproj
@@ -0,0 +1,58 @@
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {DDF3BE3D-C04E-48AF-8EBF-7C543B0D3DBB}
+ Exe
+ Properties
+ Chapter_16_properties
+ Chapter 16 properties
+ 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/16 - Properties/Chapter 16 properties/Chapter 16 properties.csproj.user b/16 - Properties/Chapter 16 properties/Chapter 16 properties.csproj.user
new file mode 100644
index 0000000..ace9a86
--- /dev/null
+++ b/16 - Properties/Chapter 16 properties/Chapter 16 properties.csproj.user
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/16 - Properties/Chapter 16 properties/Chapter 16 properties.sln b/16 - Properties/Chapter 16 properties/Chapter 16 properties.sln
new file mode 100644
index 0000000..5de2694
--- /dev/null
+++ b/16 - Properties/Chapter 16 properties/Chapter 16 properties.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C# Express 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chapter 16 properties", "Chapter 16 properties.csproj", "{DDF3BE3D-C04E-48AF-8EBF-7C543B0D3DBB}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {DDF3BE3D-C04E-48AF-8EBF-7C543B0D3DBB}.Debug|x86.ActiveCfg = Debug|x86
+ {DDF3BE3D-C04E-48AF-8EBF-7C543B0D3DBB}.Debug|x86.Build.0 = Debug|x86
+ {DDF3BE3D-C04E-48AF-8EBF-7C543B0D3DBB}.Release|x86.ActiveCfg = Release|x86
+ {DDF3BE3D-C04E-48AF-8EBF-7C543B0D3DBB}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/16 - Properties/Chapter 16 properties/Chapter 16 properties.suo b/16 - Properties/Chapter 16 properties/Chapter 16 properties.suo
new file mode 100644
index 0000000..06a5cc1
Binary files /dev/null and b/16 - Properties/Chapter 16 properties/Chapter 16 properties.suo differ
diff --git a/16 - Properties/Chapter 16 properties/Program.cs b/16 - Properties/Chapter 16 properties/Program.cs
new file mode 100644
index 0000000..b376d18
--- /dev/null
+++ b/16 - Properties/Chapter 16 properties/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Chapter_16_properties
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+
+ }
+
+string m_name;
+public string Name
+{
+ get { return m_name; }
+ set { m_name = value; }
+}
+ }
+}
diff --git a/16 - Properties/Chapter 16 properties/Properties/AssemblyInfo.cs b/16 - Properties/Chapter 16 properties/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..f8dba17
--- /dev/null
+++ b/16 - Properties/Chapter 16 properties/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Chapter 16 properties")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Chapter 16 properties")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d9e85b94-d6ae-4d0c-81b4-d16d345ab5c4")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/16 - Properties/Chapter 16 properties/Test.cs b/16 - Properties/Chapter 16 properties/Test.cs
new file mode 100644
index 0000000..5767cfb
--- /dev/null
+++ b/16 - Properties/Chapter 16 properties/Test.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Chapter_16_properties
+{
+ class Test
+ {
+ public string Name { get; set; }
+ }
+
+}
diff --git a/16 - Properties/Chapter 16 properties/bin/Debug/Chapter 16 properties.vshost.exe b/16 - Properties/Chapter 16 properties/bin/Debug/Chapter 16 properties.vshost.exe
new file mode 100644
index 0000000..bb84a51
Binary files /dev/null and b/16 - Properties/Chapter 16 properties/bin/Debug/Chapter 16 properties.vshost.exe differ
diff --git a/16 - Properties/Chapter 16 properties/bin/Release/Chapter 16 properties.exe b/16 - Properties/Chapter 16 properties/bin/Release/Chapter 16 properties.exe
new file mode 100644
index 0000000..06568b4
Binary files /dev/null and b/16 - Properties/Chapter 16 properties/bin/Release/Chapter 16 properties.exe differ
diff --git a/16 - Properties/Chapter 16 properties/bin/Release/Chapter 16 properties.pdb b/16 - Properties/Chapter 16 properties/bin/Release/Chapter 16 properties.pdb
new file mode 100644
index 0000000..04093ea
Binary files /dev/null and b/16 - Properties/Chapter 16 properties/bin/Release/Chapter 16 properties.pdb differ
diff --git a/16 - Properties/Chapter 16 properties/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/16 - Properties/Chapter 16 properties/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..22b3ee2
Binary files /dev/null and b/16 - Properties/Chapter 16 properties/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/16 - Properties/Chapter 16 properties/obj/x86/Release/Chapter 16 properties.csproj.FileListAbsolute.txt b/16 - Properties/Chapter 16 properties/obj/x86/Release/Chapter 16 properties.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..004c76b
--- /dev/null
+++ b/16 - Properties/Chapter 16 properties/obj/x86/Release/Chapter 16 properties.csproj.FileListAbsolute.txt
@@ -0,0 +1,5 @@
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\Chapter 16 properties\bin\Release\Chapter 16 properties.exe
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\Chapter 16 properties\bin\Release\Chapter 16 properties.pdb
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\Chapter 16 properties\obj\x86\Release\ResolveAssemblyReference.cache
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\Chapter 16 properties\obj\x86\Release\Chapter 16 properties.exe
+C:\Users\Eric Gunnerson\AppData\Local\Temporary Projects\Chapter 16 properties\obj\x86\Release\Chapter 16 properties.pdb
diff --git a/16 - Properties/Chapter 16 properties/obj/x86/Release/Chapter 16 properties.exe b/16 - Properties/Chapter 16 properties/obj/x86/Release/Chapter 16 properties.exe
new file mode 100644
index 0000000..06568b4
Binary files /dev/null and b/16 - Properties/Chapter 16 properties/obj/x86/Release/Chapter 16 properties.exe differ
diff --git a/16 - Properties/Chapter 16 properties/obj/x86/Release/Chapter 16 properties.pdb b/16 - Properties/Chapter 16 properties/obj/x86/Release/Chapter 16 properties.pdb
new file mode 100644
index 0000000..04093ea
Binary files /dev/null and b/16 - Properties/Chapter 16 properties/obj/x86/Release/Chapter 16 properties.pdb differ
diff --git a/16 - Properties/Chapter 16 properties/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache b/16 - Properties/Chapter 16 properties/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000..9da5530
Binary files /dev/null and b/16 - Properties/Chapter 16 properties/obj/x86/Release/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/16 - Properties/Property Efficiency/Build1.bat b/16 - Properties/Property Efficiency/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/16 - Properties/Property Efficiency/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/16 - Properties/Property Efficiency/File_1.cs b/16 - Properties/Property Efficiency/File_1.cs
new file mode 100644
index 0000000..3aeb5c0
--- /dev/null
+++ b/16 - Properties/Property Efficiency/File_1.cs
@@ -0,0 +1,18 @@
+// 18 - Properties\Property Efficiency
+// copyright 2000 Eric Gunnerson
+class Test
+{
+ private string name;
+
+ public string Name
+ {
+ get
+ {
+ return name;
+ }
+ set
+ {
+ name = value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/16 - Properties/Side Effects When Setting Values/Build1.bat b/16 - Properties/Side Effects When Setting Values/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/16 - Properties/Side Effects When Setting Values/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/16 - Properties/Side Effects When Setting Values/File_1.cs b/16 - Properties/Side Effects When Setting Values/File_1.cs
new file mode 100644
index 0000000..bcc6c76
--- /dev/null
+++ b/16 - Properties/Side Effects When Setting Values/File_1.cs
@@ -0,0 +1,64 @@
+// 18 - Properties\Side Effects When Setting Values
+// copyright 2000 Eric Gunnerson
+using System;
+using System.Collections;
+class Basket
+{
+ internal void UpdateTotal()
+ {
+ total = 0;
+ foreach (BasketItem item in items)
+ {
+ total += item.Total;
+ }
+ }
+
+ ArrayList items = new ArrayList();
+ Decimal total;
+}
+class BasketItem
+{
+ BasketItem(Basket basket)
+ {
+ this.basket = basket;
+ }
+ public int Quantity
+ {
+ get
+ {
+ return(quantity);
+ }
+ set
+ {
+ quantity = value;
+ basket.UpdateTotal();
+ }
+ }
+ public Decimal Price
+ {
+ get
+ {
+ return(price);
+ }
+ set
+ {
+ price = value;
+ basket.UpdateTotal();
+ }
+ }
+ public Decimal Total
+ {
+ get
+ {
+ // volume discount; 10% if 10 or more are purchased
+ if (quantity >= 10)
+ return(quantity * price * 0.90m);
+ else
+ return(quantity * price);
+ }
+ }
+
+ int quantity; // count of the item
+ Decimal price; // price of the item
+ Basket basket; // reference back to the basket
+}
\ No newline at end of file
diff --git a/16 - Properties/Static Properties/Build1.bat b/16 - Properties/Static Properties/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/16 - Properties/Static Properties/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/16 - Properties/Static Properties/File_1.cs b/16 - Properties/Static Properties/File_1.cs
new file mode 100644
index 0000000..e589a61
--- /dev/null
+++ b/16 - Properties/Static Properties/File_1.cs
@@ -0,0 +1,44 @@
+// 18 - Properties\Static Properties
+// copyright 2000 Eric Gunnerson
+class Color
+{
+ public Color(int red, int green, int blue)
+ {
+ this.red = red;
+ this.green = green;
+ this.blue = blue;
+ }
+
+ int red;
+ int green;
+ int blue;
+
+ public static Color Red
+ {
+ get
+ {
+ return(new Color(255, 0, 0));
+ }
+ }
+ public static Color Green
+ {
+ get
+ {
+ return(new Color(0, 255, 0));
+ }
+ }
+ public static Color Blue
+ {
+ get
+ {
+ return(new Color(0, 0, 255));
+ }
+ }
+}
+class Test
+{
+ static void Main()
+ {
+ Color background = Color.Red;
+ }
+}
\ No newline at end of file
diff --git a/16 - Properties/Use of Properties/Build1.bat b/16 - Properties/Use of Properties/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/16 - Properties/Use of Properties/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/16 - Properties/Use of Properties/File_1.cs b/16 - Properties/Use of Properties/File_1.cs
new file mode 100644
index 0000000..dc9a57b
--- /dev/null
+++ b/16 - Properties/Use of Properties/File_1.cs
@@ -0,0 +1,39 @@
+// 18 - Properties\Use of Properties
+// copyright 2000 Eric Gunnerson
+using System;
+class Auto
+{
+ public Auto(int id, string name)
+ {
+ this.id = id;
+ this.name = name;
+ }
+
+ // query to find # produced
+ public int ProductionCount
+ {
+ get
+ {
+ if (productionCount == -1)
+ {
+ // fetch count from database here.
+ }
+ return(productionCount);
+ }
+ }
+ public int SalesCount
+ {
+ get
+ {
+ if (salesCount == -1)
+ {
+ // query each dealership for data
+ }
+ return(salesCount);
+ }
+ }
+ string name;
+ int id;
+ int productionCount = -1;
+ int salesCount = -1;
+}
\ No newline at end of file
diff --git a/16 - Properties/Virtual Properties/Build1.bat b/16 - Properties/Virtual Properties/Build1.bat
new file mode 100644
index 0000000..6d9e0df
--- /dev/null
+++ b/16 - Properties/Virtual Properties/Build1.bat
@@ -0,0 +1 @@
+csc File_1.cs
diff --git a/16 - Properties/Virtual Properties/File_1.cs b/16 - Properties/Virtual Properties/File_1.cs
new file mode 100644
index 0000000..b861b87
--- /dev/null
+++ b/16 - Properties/Virtual Properties/File_1.cs
@@ -0,0 +1,31 @@
+// 18 - Properties\Virtual Properties
+// copyright 2000 Eric Gunnerson
+using System;
+
+public abstract class DrawingObject
+{
+ public abstract string Name
+ {
+ get;
+ }
+}
+class Circle: DrawingObject
+{
+ string name = "Circle";
+
+ public override string Name
+ {
+ get
+ {
+ return(name);
+ }
+ }
+}
+class Test
+{
+ public static void Main()
+ {
+ DrawingObject d = new Circle();
+ Console.WriteLine("Name: {0}", d.Name);
+ }
+}
\ No newline at end of file
diff --git a/17 - Generics/Chapter 16 - Generic Types/Auto.cs b/17 - Generics/Chapter 16 - Generic Types/Auto.cs
new file mode 100644
index 0000000..f459d34
--- /dev/null
+++ b/17 - Generics/Chapter 16 - Generic Types/Auto.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Chapter_16___Generic_Types
+{
+ class Auto
+ {
+ }
+}
diff --git a/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.csproj b/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.csproj
new file mode 100644
index 0000000..75c3ca5
--- /dev/null
+++ b/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.csproj
@@ -0,0 +1,68 @@
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {8566616D-B466-40AA-B4AE-E27ACEA9E621}
+ Exe
+ Properties
+ Chapter_16___Generic_Types
+ Chapter 16 - Generic Types
+ 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/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.csproj.user b/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.csproj.user
new file mode 100644
index 0000000..ace9a86
--- /dev/null
+++ b/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.csproj.user
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.sln b/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.sln
new file mode 100644
index 0000000..935b555
--- /dev/null
+++ b/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C# Express 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chapter 16 - Generic Types", "Chapter 16 - Generic Types.csproj", "{8566616D-B466-40AA-B4AE-E27ACEA9E621}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8566616D-B466-40AA-B4AE-E27ACEA9E621}.Debug|x86.ActiveCfg = Debug|x86
+ {8566616D-B466-40AA-B4AE-E27ACEA9E621}.Debug|x86.Build.0 = Debug|x86
+ {8566616D-B466-40AA-B4AE-E27ACEA9E621}.Release|x86.ActiveCfg = Release|x86
+ {8566616D-B466-40AA-B4AE-E27ACEA9E621}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.suo b/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.suo
new file mode 100644
index 0000000..c0ca5d0
Binary files /dev/null and b/17 - Generics/Chapter 16 - Generic Types/Chapter 16 - Generic Types.suo differ
diff --git a/17 - Generics/Chapter 16 - Generic Types/GenericCollectionCovariance.cs b/17 - Generics/Chapter 16 - Generic Types/GenericCollectionCovariance.cs
new file mode 100644
index 0000000..60ce49f
--- /dev/null
+++ b/17 - Generics/Chapter 16 - Generic Types/GenericCollectionCovariance.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Chapter_16___Generic_Types
+{
+interface IFirstItem // remove 'out' to show the compiler error.
+{
+ T GetFirstItem();
+ //void NotLegal(T parameter); // also generates an error.
+}
+class MyFirstList : List, IFirstItem
+{
+ public MyFirstList() { }
+
+ public T GetFirstItem()
+ {
+ return this[0];
+ }
+}
+
+ class GenericCollectionCovariance
+ {
+ void Example()
+ {
+ MyFirstList sedans = new MyFirstList();
+ sedans.Add(new Sedan());
+
+ TestService();
+ }
+
+void TestService()
+{
+ MyFirstList sedans = new MyFirstList();
+ sedans.Add(new Sedan());
+
+ PerformService(sedans);
+}
+void PerformService(IFirstItem autos)
+{
+}
+ }
+}
diff --git a/17 - Generics/Chapter 16 - Generic Types/GenericContravariance.cs b/17 - Generics/Chapter 16 - Generic Types/GenericContravariance.cs
new file mode 100644
index 0000000..88f75c4
--- /dev/null
+++ b/17 - Generics/Chapter 16 - Generic Types/GenericContravariance.cs
@@ -0,0 +1,31 @@
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Chapter_16___Generic_Types
+{
+interface IEqual
+{
+ bool IsEqual(T x, T y);
+}
+class Comparer : IEqual