├── README.md ├── Sources ├── Week7 │ └── Demo │ │ └── MultiForms │ │ ├── recs.txt │ │ ├── MultiForms.csproj │ │ ├── StringExtension.cs │ │ ├── Program.cs │ │ ├── Rectangle.cs │ │ ├── CreateForm.cs │ │ ├── EditForm.cs │ │ ├── MainForm.cs │ │ ├── CreateForm.Designer.cs │ │ ├── EditForm.Designer.cs │ │ ├── CreateForm.resx │ │ ├── EditForm.resx │ │ ├── MainForm.resx │ │ └── MainForm.Designer.cs ├── Week1 │ ├── Demo │ │ ├── FileInputOutput │ │ │ ├── in.txt │ │ │ ├── out.txt │ │ │ ├── FileInputOutput.csproj │ │ │ └── Program.cs │ │ └── StandardInputOutput │ │ │ ├── StandardInputOutput.csproj │ │ │ └── Program.cs │ └── Lab │ │ └── RecsInput │ │ ├── RecsInput.csproj │ │ └── Program.cs ├── Week4 │ └── Demo │ │ ├── Action_Func_Demo │ │ ├── recs.txt │ │ ├── Action_Func_Demo.csproj │ │ ├── Rectangle.cs │ │ └── Program.cs │ │ └── DelegateDemo │ │ ├── Calculation.cs │ │ ├── DelegateDemo.csproj │ │ ├── Program.cs │ │ └── Operation.cs ├── Week2 │ ├── Lab │ │ └── People_OOP │ │ │ ├── People.txt │ │ │ ├── People_OOP.csproj │ │ │ ├── Program.cs │ │ │ └── Models │ │ │ └── Person.cs │ └── Demo │ │ └── RecObjectsDemo │ │ ├── RecObjectsDemo.csproj │ │ ├── Program.cs │ │ └── Rectangle.cs ├── Week3 │ ├── Lab │ │ └── People_List │ │ │ ├── People.txt │ │ │ ├── People_List.csproj │ │ │ ├── Models │ │ │ └── Person.cs │ │ │ └── Program.cs │ └── Demo │ │ └── RecObjectsDemo(List) │ │ ├── RecObjectsDemo(List).csproj │ │ ├── Rectangle.cs │ │ └── Program.cs ├── Week5 │ ├── Demo │ │ └── Prop_Event_Demo │ │ │ ├── RectangleHandler.cs │ │ │ ├── Prop_Event_Demo.csproj │ │ │ ├── Program.cs │ │ │ └── Rectangle.cs │ └── Lab │ │ └── Person_EventHandling │ │ ├── Person_EventHandling.csproj │ │ ├── Program.cs │ │ ├── PersonList.cs │ │ └── Person.cs └── Week6 │ └── Demo │ └── Recs_WinForm_Demo │ ├── Recs_WinForm_Demo.csproj │ ├── Rectangle.cs │ ├── Program.cs │ ├── Form1.cs │ ├── Form1.resx │ └── Form1.Designer.cs ├── Introduction.txt ├── .gitignore └── Codes.sln /README.md: -------------------------------------------------------------------------------- 1 | # csharpdemo 2 | Demo Projects for RUPP C# Course 3 | -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/recs.txt: -------------------------------------------------------------------------------- 1 | 5/7 2 | 4/9 3 | 3/8 4 | 5/6 5 | 2/12 6 | 6/7 -------------------------------------------------------------------------------- /Sources/Week1/Demo/FileInputOutput/in.txt: -------------------------------------------------------------------------------- 1 | Chan Veasna 2 | Royal University of Phnom Penh -------------------------------------------------------------------------------- /Sources/Week4/Demo/Action_Func_Demo/recs.txt: -------------------------------------------------------------------------------- 1 | 5/8 2 | 4/7 3 | 4/9 4 | 3/12 5 | 7/8 6 | 2/20 7 | 5/6 -------------------------------------------------------------------------------- /Sources/Week1/Demo/FileInputOutput/out.txt: -------------------------------------------------------------------------------- 1 | Hello Chan Veasna from Royal University of Phnom Penh. 2 | -------------------------------------------------------------------------------- /Sources/Week4/Demo/DelegateDemo/Calculation.cs: -------------------------------------------------------------------------------- 1 | namespace DelegateDemo; 2 | public delegate double Calculation(double x, double y); 3 | -------------------------------------------------------------------------------- /Sources/Week2/Lab/People_OOP/People.txt: -------------------------------------------------------------------------------- 1 | Heng Long/Male/23 2 | Doung Malina/Female/28 3 | Prak Vichet/Male/18 4 | Keo Nary/Female/33 5 | Prom Narita/Female/26 -------------------------------------------------------------------------------- /Sources/Week3/Lab/People_List/People.txt: -------------------------------------------------------------------------------- 1 | Heng Long/Male/23 2 | Doung Malina/Female/28 3 | Prak Vichet/Male/18 4 | Keo Nary/Female/33 5 | Prom Narita/Female/26 -------------------------------------------------------------------------------- /Sources/Week5/Demo/Prop_Event_Demo/RectangleHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Prop_Event_Demo; 8 | 9 | public delegate void RectangleHandler(Rectangle rect); 10 | 11 | -------------------------------------------------------------------------------- /Sources/Week4/Demo/DelegateDemo/DelegateDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Week1/Lab/RecsInput/RecsInput.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Week5/Demo/Prop_Event_Demo/Prop_Event_Demo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Week2/Demo/RecObjectsDemo/RecObjectsDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Week3/Demo/RecObjectsDemo(List)/RecObjectsDemo(List).csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Week5/Lab/Person_EventHandling/Person_EventHandling.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Week1/Demo/StandardInputOutput/StandardInputOutput.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Week6/Demo/Recs_WinForm_Demo/Recs_WinForm_Demo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net6.0-windows 6 | enable 7 | true 8 | enable 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Week4/Demo/Action_Func_Demo/Action_Func_Demo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | 10 | PreserveNewest 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Sources/Week2/Lab/People_OOP/People_OOP.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | PreserveNewest 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Sources/Week3/Lab/People_List/People_List.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | PreserveNewest 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Sources/Week1/Demo/FileInputOutput/FileInputOutput.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | PreserveNewest 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/MultiForms.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net6.0-windows 6 | enable 7 | true 8 | enable 9 | 10 | 11 | 12 | 13 | PreserveNewest 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/StringExtension.cs: -------------------------------------------------------------------------------- 1 | namespace MultiForms; 2 | 3 | public static class StringExtension 4 | { 5 | public static List? ToValues(this string str, string separator = "/") 6 | { 7 | string[] arr = str.Split(separator); 8 | List result = new(); 9 | foreach (string ele in arr) 10 | { 11 | if (double.TryParse(ele, out double value) == false) 12 | return null; 13 | result.Add(value); 14 | } 15 | return result; 16 | } 17 | } -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/Program.cs: -------------------------------------------------------------------------------- 1 | namespace MultiForms 2 | { 3 | internal static class Program 4 | { 5 | /// 6 | /// The main entry point for the application. 7 | /// 8 | [STAThread] 9 | static void Main() 10 | { 11 | // To customize application configuration such as set high DPI settings or default font, 12 | // see https://aka.ms/applicationconfiguration. 13 | ApplicationConfiguration.Initialize(); 14 | Application.Run(new MainForm()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Sources/Week4/Demo/DelegateDemo/Program.cs: -------------------------------------------------------------------------------- 1 | namespace DelegateDemo 2 | { 3 | internal class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | Operation op = new(50, 20); 8 | op.View(new List{Add, Sub, Mul, Div }); 9 | } 10 | 11 | public static double Add(double x, double y) { return x + y; } 12 | public static double Sub(double x, double y) { return x - y; } 13 | public static double Mul(double x, double y) { return x * y; } 14 | public static double Div(double x, double y) { return x / y; } 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /Sources/Week5/Lab/Person_EventHandling/Program.cs: -------------------------------------------------------------------------------- 1 | namespace Person_EventHandling; 2 | 3 | internal class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | PersonList people = new(); 8 | Person.Create("Heng Map", "Male", 34); 9 | Person.Create("Doung Nita", "Female", 25); 10 | Person.Create("Chan Dara", "Male", 45); 11 | Person.Create("Mut Vanny", "Female", 23); 12 | Person.Create("Vong Neary", "Female", 21); 13 | 14 | people.GenderGroupView(); 15 | 16 | Console.WriteLine("\n[All people in ascending of names]"); 17 | people.Elements.OrderBy(x => x.Name) 18 | .ToList() 19 | .ForEach(p => Console.WriteLine(p.Info)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/Rectangle.cs: -------------------------------------------------------------------------------- 1 | namespace MultiForms; 2 | 3 | public delegate void RectangleHandler(Rectangle rec); 4 | public class Rectangle 5 | { 6 | static int Count = 0; 7 | public static event RectangleHandler? Created; 8 | public static Rectangle CreateInstance(double wd, double lng) 9 | { 10 | Rectangle rec= new Rectangle() 11 | { 12 | Width = wd, 13 | Length = lng 14 | }; 15 | Created?.Invoke(rec); 16 | return rec; 17 | } 18 | private int _no; 19 | public int No => _no; 20 | public double Width { get; set; } = 0; 21 | public double Length { get; set; } = 0; 22 | public double Area => Width * Length; 23 | private Rectangle() { _no = ++Count; } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Sources/Week5/Lab/Person_EventHandling/PersonList.cs: -------------------------------------------------------------------------------- 1 | namespace Person_EventHandling; 2 | 3 | public class PersonList 4 | { 5 | private List pers = new(); 6 | public PersonList() 7 | { 8 | Person.Created += p => pers.Add(p); 9 | } 10 | public List Elements => new List(pers); 11 | 12 | public List Genders => pers.Select(e => e.Gender).Distinct().ToList(); 13 | public void GenderGroupView() 14 | { 15 | Genders.ForEach(g => 16 | { 17 | Console.WriteLine($"[{g} People]"); 18 | pers.Where(p => p.Gender == g).ToList() 19 | .ForEach(e => Console.WriteLine($"Age:{e.Age}, Name:{e.Name}")); 20 | Console.WriteLine(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/Week4/Demo/DelegateDemo/Operation.cs: -------------------------------------------------------------------------------- 1 | using System.Security.Cryptography.X509Certificates; 2 | 3 | namespace DelegateDemo; 4 | public class Operation 5 | { 6 | public double _one = 0.0; 7 | public double _two = 1.0; 8 | 9 | public Operation() { } 10 | public Operation(double one, double two) {_one = one; _two = two; } 11 | 12 | public double GetOne() { return _one; } 13 | public double GetTwo() { return _two; } 14 | public double Result(Calculation calc) { return calc(_one, _two); } 15 | public void View(List calculations) 16 | { 17 | foreach(var calc in calculations) 18 | { 19 | Console.WriteLine($"{calc.Method.Name}({this.GetOne()}, {this.GetOne()})=>{this.Result(calc)}"); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Sources/Week6/Demo/Recs_WinForm_Demo/Rectangle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Recs_WinForm_Demo 8 | { 9 | public class Rectangle 10 | { 11 | static int Count = 0; 12 | 13 | public static Rectangle CreateInstance(double wd, double lng) 14 | { 15 | return new Rectangle() 16 | { 17 | Width = wd, 18 | Length = lng 19 | }; 20 | } 21 | private int _no; 22 | public int No => _no; 23 | public double Width { get; set; } = 0; 24 | public double Length { get; set; } = 0; 25 | public double Area => Width * Length; 26 | private Rectangle() { _no = ++Count; } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/Week5/Lab/Person_EventHandling/Person.cs: -------------------------------------------------------------------------------- 1 | namespace Person_EventHandling; 2 | public delegate void CreatedHandler(Person p); 3 | public class Person 4 | { 5 | public static event CreatedHandler? Created; 6 | public static void Create(string name, string gender, byte age) 7 | { 8 | Person newPerson = new Person() 9 | { 10 | Name = name, 11 | Gender = gender, 12 | Age = age 13 | }; 14 | Created?.Invoke(newPerson); 15 | } 16 | private Person() { } 17 | public string Name { get; set; } = default!; 18 | public string Gender { get; set; } = default!; 19 | public byte Age { get; set; } = default; 20 | 21 | public string Info 22 | { 23 | get 24 | { 25 | return $"Name:{Name}, Gender:{Gender}, Age:{Age}"; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/Week1/Demo/FileInputOutput/Program.cs: -------------------------------------------------------------------------------- 1 | internal class Program 2 | { 3 | private static void Main(string[] args) 4 | { 5 | Console.WriteLine("Hello Application to input from and output to files"); 6 | string inputFile = "in.txt"; 7 | string outputFile = "out.txt"; 8 | 9 | Console.WriteLine($"Reading \"name\" and \"universitity\" from {inputFile}..."); 10 | var stdIn = Console.In; 11 | Console.SetIn(File.OpenText(inputFile)); 12 | string name = Console.ReadLine()??"(NA)"; 13 | string university = Console.ReadLine() ?? "(NA)"; 14 | 15 | var stdOut = Console.Out; 16 | Console.WriteLine($"Writing a line to {outputFile}..."); 17 | Console.SetOut(File.CreateText(outputFile)); 18 | string result = $"Hello {name} from {university}."; 19 | Console.WriteLine(result); 20 | Console.Out.Close(); 21 | 22 | Console.SetOut(stdOut); 23 | Console.SetIn(stdIn); 24 | Console.WriteLine("Press any key..."); 25 | Console.ReadKey(); 26 | } 27 | } -------------------------------------------------------------------------------- /Sources/Week6/Demo/Recs_WinForm_Demo/Program.cs: -------------------------------------------------------------------------------- 1 | namespace Recs_WinForm_Demo 2 | { 3 | internal static class Program 4 | { 5 | /// 6 | /// The main entry point for the application. 7 | /// 8 | [STAThread] 9 | static void Main() 10 | { 11 | // To customize application configuration such as set high DPI settings or default font, 12 | // see https://aka.ms/applicationconfiguration. 13 | InitRectangles(); 14 | ApplicationConfiguration.Initialize(); 15 | Application.Run(new Form1()); 16 | } 17 | 18 | public static List Recs => _recs; 19 | private static List _recs = new(); 20 | private static void InitRectangles() 21 | { 22 | (new List 23 | { 24 | Rectangle.CreateInstance(5, 8), 25 | Rectangle.CreateInstance(6, 8), 26 | Rectangle.CreateInstance(3, 7), 27 | Rectangle.CreateInstance(2, 12), 28 | Rectangle.CreateInstance(4, 9), 29 | }).ForEach(rect => { _recs.Add(rect); }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Introduction.txt: -------------------------------------------------------------------------------- 1 | 1-Source codes for demo: 2 | https://github.com/tpsreng/csharpdemo 3 | 4 | 2-C# Tutorials: 5 | https://www.tutorialsteacher.com/csharp 6 | https://www.w3schools.com/cs/index.php 7 | 8 | https://www.youtube.com/watch?v=HB1aPYPPJ24&list=PL0eyrZgxdwhxD9HhtpuZV22KxEJAZ55X- 9 | https://www.youtube.com/watch?v=QAHfPdZnBGQ&list=PLq5Uz3LSFff8GmtFeoXRZCtWBKQ0kWl-H 10 | https://www.youtube.com/watch?v=52r9qUToOD8&list=PLLAZ4kZ9dFpNIBTYHNDrhfE9C-imUXCmk&index=1 11 | 12 | 3-Online Compilers: 13 | https://dotnetfiddle.net/ 14 | https://onecompiler.com/csharp 15 | https://replit.com/languages/csharp (charge) 16 | 17 | 4-Editors: 18 | VS Code: https://code.visualstudio.com/ 19 | Visual Studio 2022 (community edition): https://visualstudio.microsoft.com/ 20 | 21 | 5-Net CLI to create .net project (for sdk 6) 22 | Console app > dotnet new console -o FirstConsoleApp -f net6.0 --use-program-main 23 | WinForm app > dotnet new WinForms -o FirstWinFormApp -f net6.0 --use-program-main 24 | 25 | 6-Tutorial for creating a console project in VS code 26 | https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code 27 | 28 | 7-Tutorial for creating a console project in Visual Studio 2022 29 | https://learn.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio?pivots=dotnet-6-0 -------------------------------------------------------------------------------- /Sources/Week1/Demo/StandardInputOutput/Program.cs: -------------------------------------------------------------------------------- 1 | namespace StandardInputOutput; 2 | class Program 3 | { 4 | static void Main(string[] args) 5 | { 6 | //Test1(); 7 | Test2(); 8 | } 9 | static void Test2() 10 | { 11 | Console.WriteLine("Input data..."); 12 | Console.Write($">{"Name",-10}: "); 13 | string? name = Console.ReadLine(); 14 | 15 | Console.Write($">{"Age", -10}: "); 16 | int age = Int32.Parse(Console.ReadLine() ?? ""); 17 | 18 | Console.Write($"<{"Height",-10}: "); 19 | float hgt = float.Parse(Console.ReadLine() ?? ""); 20 | 21 | Console.WriteLine(); 22 | Console.WriteLine("Output Information..."); 23 | Console.WriteLine($">{"Name",-10}: {name}"); 24 | Console.WriteLine($">{"Age",-10}: {age}"); 25 | Console.WriteLine($">{"Height",-10}: {hgt}"); 26 | } 27 | static void Test1() 28 | { 29 | Console.Write("Input a name : "); 30 | string? name = Console.ReadLine(); 31 | 32 | Console.Write("Input an age : "); 33 | int age = Int32.Parse(Console.ReadLine() ?? ""); 34 | 35 | Console.Write("Input a height: "); 36 | float hgt = float.Parse(Console.ReadLine() ?? ""); 37 | 38 | Console.WriteLine($"{"Name",-10}: {name}"); 39 | Console.WriteLine($"{"Age",-10}: {age}"); 40 | Console.WriteLine($"{"Height",-10}: {hgt}"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Sources/Week1/Lab/RecsInput/Program.cs: -------------------------------------------------------------------------------- 1 | namespace RecsInput; 2 | class Program 3 | { 4 | static void Main(string[] args) 5 | { 6 | Console.WriteLine("Rectangles' data (width & length separated by space, eg. 2 5)"); 7 | 8 | string result = ""; 9 | double totalArea = 0.0; 10 | int count = 0; 11 | while (true) 12 | { 13 | Console.Write($"[{count + 1}] : "); 14 | var line = Console.ReadLine(); 15 | if (line == null) break; 16 | var data = line.Split(' '); 17 | if (data.Length < 2) break; 18 | if (double.TryParse(data[0], out double width)==false) continue; 19 | if(double.TryParse(data[1], out double length)==false) continue; 20 | count++; 21 | double area = width * length; 22 | totalArea += area; 23 | var lineInfo = $"{count,10} {width,10:n2} {length,10:n2} {area,10:n2}"; 24 | if (result != "") result += "\n"; 25 | result += lineInfo; 26 | } 27 | if (count == 0) return; 28 | string heading = $"{"no",10} {"width",10} {"length",10} {"area",10}"; 29 | string bar = new string('-', 43); 30 | Console.WriteLine(); 31 | Console.WriteLine(heading); 32 | Console.WriteLine(bar); 33 | Console.WriteLine(result); 34 | Console.WriteLine(bar); 35 | var totalText = $"Total:{totalArea:n2}"; 36 | Console.WriteLine($"{totalText,43}"); 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Sources/Week2/Lab/People_OOP/Program.cs: -------------------------------------------------------------------------------- 1 | using People_OOP.Models; 2 | 3 | namespace People_OOP 4 | { 5 | internal class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | string datafile = "people.txt"; 10 | if (File.Exists(datafile) == false) 11 | { 12 | Console.WriteLine($"Data file, {datafile} does not exist"); 13 | return; 14 | } 15 | Console.SetIn(new StreamReader(datafile)); 16 | 17 | int count = 0; 18 | int lines = 0; 19 | string result = ""; 20 | while (true) 21 | { 22 | lines++; 23 | Console.Write($"Reading line {lines}..."); 24 | string? data = Console.ReadLine(); 25 | if (string.IsNullOrEmpty(data)) 26 | { 27 | Console.WriteLine(">Nothing"); 28 | break; 29 | } 30 | Person p = new Person(); 31 | if (p.SetData(data, "/") == false) 32 | { 33 | Console.WriteLine(">Invalid"); 34 | continue; 35 | } 36 | Console.WriteLine(">Ok"); 37 | count++; 38 | if (result != "") result += "\n"; 39 | result += p.GetInfo(); 40 | } 41 | Console.WriteLine(); 42 | Console.WriteLine(Person.GetHeading()); 43 | Console.WriteLine(Person.GetBar()); 44 | Console.WriteLine(result); 45 | Console.WriteLine(Person.GetBar()); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/CreateForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace MultiForms 12 | { 13 | public partial class CreateForm : Form 14 | { 15 | public CreateForm() 16 | { 17 | InitializeComponent(); 18 | btnClear.Click += (sender, e) => { txtWidth.Clear(); txtLength.Clear(); }; 19 | btnCreate.Click += DoClickCreate; 20 | } 21 | 22 | private void DoClickCreate(object? sender, EventArgs e) 23 | { 24 | List messages = new(); 25 | if (double.TryParse(txtWidth.Text, out double wd) == false) 26 | { 27 | messages.Add($"Invalid width, {txtWidth.Text}"); 28 | } 29 | if (double.TryParse(txtLength.Text, out double lng) == false) 30 | { 31 | messages.Add($"Invalid Length, {txtWidth.Text}"); 32 | } 33 | if (messages.Count > 0) 34 | { 35 | string msg = messages.Aggregate((a, b) => a + "\n" + b); 36 | MessageBox.Show(msg, "Creating", MessageBoxButtons.OK, MessageBoxIcon.Error); 37 | return; 38 | } 39 | Rectangle rec = Rectangle.CreateInstance(wd, lng); 40 | MessageBox.Show($"A rectangle no, {rec.No}, was successfully created", "Creating", 41 | MessageBoxButtons.OK, MessageBoxIcon.Information); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Sources/Week2/Demo/RecObjectsDemo/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection.Metadata.Ecma335; 2 | 3 | namespace RecObjectsDemo 4 | { 5 | internal class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | int countWidth = 6; 10 | Rectangle.FieldWidth = 15; 11 | Rectangle.DecimalPoint = 5; 12 | Rectangle rec = new(); 13 | 14 | Console.WriteLine("Rectangles"); 15 | Console.WriteLine("Input width and length separated by space (eg. 2 5) or empty to stop."); 16 | 17 | var result = ""; 18 | var totalArea = 0.0; 19 | var count = 0; 20 | while (true) 21 | { 22 | Console.Write($"[{count + 1}]: "); 23 | var line = Console.ReadLine(); 24 | if (string.IsNullOrEmpty(line)) break; 25 | if (rec.SetData(line) == false) continue; 26 | 27 | totalArea += rec.GetArea(); 28 | count++; 29 | var subResult =string.Format($"{{0,{countWidth}}} {{1}}", count, rec.GetInfo()); 30 | if (result != "") result += "\n"; 31 | result += subResult; 32 | } 33 | 34 | if (count == 0) return; 35 | 36 | string heading = string.Format($"{{0,{countWidth}}} ", "no") + Rectangle.GetHeading(); 37 | string bar = new string('-', countWidth + 1) + Rectangle.GetBar('-'); 38 | string totalFormat = $"Total:{{0:N{Rectangle.DecimalPoint}}}"; 39 | var totalText = string.Format($"{{0,{bar.Length}}}",string.Format(totalFormat, totalArea)); 40 | 41 | Console.WriteLine(); 42 | Console.WriteLine(heading); 43 | Console.WriteLine(bar); 44 | Console.WriteLine(result); 45 | Console.WriteLine(bar); 46 | Console.WriteLine(totalText); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/EditForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace MultiForms 12 | { 13 | public delegate void UpdatedHandler(EditForm sender, Rectangle rec); 14 | public partial class EditForm : Form 15 | { 16 | public event UpdatedHandler? Updated; 17 | Rectangle _rec = default!; 18 | public EditForm(Rectangle rec) 19 | { 20 | InitializeComponent(); 21 | _rec = rec; 22 | ViewCurRectangle(); 23 | btnCancel.Click += (sender, e) => ViewCurRectangle(); 24 | btnUpdate.Click += DoClickUpdate; 25 | } 26 | 27 | private void DoClickUpdate(object? sender, EventArgs e) 28 | { 29 | List messages = new(); 30 | if (double.TryParse(txtWidth.Text, out double wd) == false) 31 | { 32 | messages.Add($"Invalid width, {txtWidth.Text}"); 33 | } 34 | if (double.TryParse(txtLength.Text, out double lng) == false) 35 | { 36 | messages.Add($"Invalid Length, {txtWidth.Text}"); 37 | } 38 | if (messages.Count > 0) 39 | { 40 | string msg = messages.Aggregate((a, b) => a + "\n" + b); 41 | MessageBox.Show(msg, "Updating", MessageBoxButtons.OK, MessageBoxIcon.Error); 42 | return; 43 | } 44 | 45 | _rec.Width = wd; 46 | _rec.Length = lng; 47 | Updated?.Invoke(this, _rec); 48 | MessageBox.Show($"A rectangle no, {_rec.No}, was successfully updated", "Updating", 49 | MessageBoxButtons.OK, MessageBoxIcon.Information); 50 | } 51 | 52 | private void ViewCurRectangle() 53 | { 54 | txtWidth.Text = _rec.Width.ToString(); 55 | txtLength.Text = _rec.Length.ToString(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Sources/Week2/Lab/People_OOP/Models/Person.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace People_OOP.Models 4 | { 5 | public class Person 6 | { 7 | //static members 8 | public static int NameFieldWidth { get; set; } = 30; 9 | public static int GenderFieldWidth { get; set; } = 6; 10 | public static int AgeFieldWidth { get; set; } = 4; 11 | //static metnods 12 | public static string GetHeading() 13 | { 14 | string nameText = string.Format($"{{0,{-NameFieldWidth}}}", "name"); 15 | string genderText = string.Format($"{{0,{-GenderFieldWidth}}}", "gender"); 16 | string ageText = string.Format($"{{0, {AgeFieldWidth}}}", "age"); 17 | return $"{nameText} {genderText} {ageText}"; 18 | } 19 | public static string GetBar(char c='-') 20 | { 21 | return new string(c, NameFieldWidth + GenderFieldWidth + AgeFieldWidth + 2); 22 | } 23 | 24 | //instance fields 25 | protected string _name=""; 26 | protected string _gender=""; 27 | protected byte _age=0; 28 | 29 | //instance methods 30 | public string GetName() => _name; 31 | public string GetGender() => _gender; 32 | public byte GetAge() => _age; 33 | 34 | public bool SetData(string data, string delimiter) 35 | { 36 | string[] arr = data.Split(delimiter); 37 | if (arr.Length < 3) return false; 38 | string name = arr[0].Trim(); 39 | string gender = arr[1].Trim(); 40 | if (byte.TryParse(arr[2], out byte age) == false) return false; 41 | _name = name; 42 | _gender= gender; 43 | _age = age; 44 | return true; 45 | } 46 | public string GetInfo() 47 | { 48 | string nameInfo = string.Format($"{{0,{-NameFieldWidth}}}", _name); 49 | string genderInfo = string.Format($"{{0,{-GenderFieldWidth}}}", _gender); 50 | string ageInfo = string.Format($"{{0, {AgeFieldWidth}}}", _age); 51 | return $"{nameInfo} {genderInfo} {ageInfo}"; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Sources/Week5/Demo/Prop_Event_Demo/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Markup; 2 | 3 | namespace Prop_Event_Demo; 4 | 5 | internal class Program 6 | { 7 | static List ModifiedRecs = new(); 8 | static void Main(string[] args) 9 | { 10 | 11 | //Creating and initializing a list of rectangles 12 | List recs = new List 13 | { new(4, 6) 14 | , new(3, 7) 15 | , new(2, 9) 16 | , new(5, 8) 17 | , new(6, 7) 18 | , new(3, 10) 19 | }; 20 | 21 | //Subcripting for every rectangle's event DataModified 22 | recs.ForEach(r => r.DataModified += (r) => 23 | { 24 | ModifiedRecs.Add(r); 25 | Console.WriteLine($"The rectangle, {r.No}, was modified"); 26 | }); 27 | 28 | //Viewing rectangles 29 | ViewRectangles(recs); 30 | Pause(); 31 | 32 | //Modifying 3 rectangles 33 | recs[0].Data = new List { 4, 8 }; 34 | recs[3].Width = 2; 35 | recs[5].Length = 12; 36 | Pause(); 37 | 38 | //Viewing Rectangles 39 | ViewRectangles(recs); 40 | } 41 | static void Pause() 42 | { 43 | Console.Write("Press any key continue..."); 44 | Console.ReadKey(); 45 | Console.WriteLine(); 46 | Console.WriteLine(); 47 | 48 | } 49 | static void ViewRectangles(List recs) 50 | { 51 | ConsoleColor color = Console.BackgroundColor; 52 | ConsoleColor modColor = ConsoleColor.DarkRed; 53 | Console.WriteLine(Rectangle.GetHeading()); 54 | string bar = Rectangle.GetBar('-'); 55 | Console.WriteLine(bar); 56 | recs.ForEach((r) => 57 | { 58 | Console.BackgroundColor = (ModifiedRecs.Contains(r)) ? modColor : color; 59 | Console.WriteLine(r.Info); 60 | }); 61 | Console.BackgroundColor = color; 62 | Console.WriteLine(bar); 63 | string areaTotal = string.Format("Area Total:{0:N3}", recs.Sum(r => r.Area)); 64 | Console.WriteLine(string.Format($"{{0,{bar.Length}}}", areaTotal)); 65 | 66 | ModifiedRecs.Clear(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Sources/Week3/Lab/People_List/Models/Person.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace People_OOP.Models 4 | { 5 | public class Person 6 | { 7 | //static members 8 | public static int NameFieldWidth { get; set; } = 30; 9 | public static int GenderFieldWidth { get; set; } = 6; 10 | public static int AgeFieldWidth { get; set; } = 4; 11 | //static metnods 12 | public static string GetHeading() 13 | { 14 | string nameText = string.Format($"{{0,{-NameFieldWidth}}}", "name"); 15 | string genderText = string.Format($"{{0,{-GenderFieldWidth}}}", "gender"); 16 | string ageText = string.Format($"{{0, {AgeFieldWidth}}}", "age"); 17 | return $"{nameText} {genderText} {ageText}"; 18 | } 19 | public static string GetBar(char c='-') 20 | { 21 | return new string(c, NameFieldWidth + GenderFieldWidth + AgeFieldWidth + 2); 22 | } 23 | 24 | //instance fields 25 | protected string _name=""; 26 | protected string _gender=""; 27 | protected byte _age=0; 28 | 29 | //instance methods 30 | public string GetName() => _name; 31 | public string GetGender() => _gender; 32 | public string SetGender(string gender)=> _gender = gender; 33 | public byte GetAge() => _age; 34 | 35 | public bool SetData(string data, string delimiter) 36 | { 37 | string[] arr = data.Split(delimiter); 38 | if (arr.Length < 3) return false; 39 | string name = arr[0].Trim(); 40 | string gender = arr[1].Trim(); 41 | if (byte.TryParse(arr[2], out byte age) == false) return false; 42 | _name = name; 43 | _gender= gender; 44 | _age = age; 45 | return true; 46 | } 47 | public string GetInfo() 48 | { 49 | string nameInfo = string.Format($"{{0,{-NameFieldWidth}}}", _name); 50 | string genderInfo = string.Format($"{{0,{-GenderFieldWidth}}}", _gender); 51 | string ageInfo = string.Format($"{{0, {AgeFieldWidth}}}", _age); 52 | return $"{nameInfo} {genderInfo} {ageInfo}"; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Sources/Week4/Demo/Action_Func_Demo/Rectangle.cs: -------------------------------------------------------------------------------- 1 | namespace Action_Func_Demo; 2 | public class Rectangle 3 | { 4 | #region static members 5 | //static fields 6 | public static int FieldWidth = 8; 7 | public static int DecimalPoint = 2; 8 | 9 | //static metnods 10 | public static string GetHeading() 11 | { 12 | string nameText = string.Format($"{{0,{FieldWidth}}}", "width"); 13 | string genderText = string.Format($"{{0,{FieldWidth}}}", "length"); 14 | string ageText = string.Format($"{{0, {FieldWidth}}}", "area"); 15 | return $"{nameText} {genderText} {ageText}"; 16 | } 17 | 18 | public static string GetBar(char c = '-') 19 | { 20 | return new string(c, FieldWidth * 3 + 2); 21 | } 22 | #endregion 23 | 24 | #region instance members 25 | //instance fields 26 | protected double _width = 0.0; 27 | protected double _length = 0.0; 28 | protected double _area = 0.0; 29 | protected bool _isAreaToUpdate = false; 30 | 31 | //instance constructors 32 | public Rectangle() { } 33 | public Rectangle(double width, double length) 34 | { 35 | _width = width; 36 | _length = length; 37 | _isAreaToUpdate = true; 38 | } 39 | 40 | //instance methods 41 | public double GetWidth() { return _width; } 42 | 43 | public double GetLength() { return _length; } 44 | 45 | public double GetArea() 46 | { 47 | if (_isAreaToUpdate) _area = _width * _length; 48 | return _area; 49 | } 50 | 51 | public bool SetData(string data, string separator = " ") 52 | { 53 | string[] sides = data.Split(separator); 54 | if (sides.Length < 2) return false; 55 | if (double.TryParse(sides[0], out double wd) == false) return false; 56 | if (double.TryParse(sides[1], out double lng) == false) return false; 57 | _width = wd; 58 | _length = lng; 59 | _isAreaToUpdate = true; 60 | return true; 61 | } 62 | 63 | public string GetInfo() 64 | { 65 | string format = "{0," + $"{FieldWidth}:N{DecimalPoint}" + "}"; 66 | string wdInfo = string.Format(format, GetWidth()); 67 | string lngInfo = string.Format(format, GetLength()); 68 | string areaInfo = string.Format(format, GetArea()); 69 | return $"{wdInfo} {lngInfo} {areaInfo}"; 70 | } 71 | #endregion 72 | } -------------------------------------------------------------------------------- /Sources/Week3/Demo/RecObjectsDemo(List)/Rectangle.cs: -------------------------------------------------------------------------------- 1 | namespace RecObjectsDemo 2 | { 3 | public class Rectangle 4 | { 5 | #region static members 6 | //static fields 7 | public static int FieldWidth = 8; 8 | public static int DecimalPoint = 2; 9 | 10 | //static metnods 11 | public static string GetHeading() 12 | { 13 | string nameText = string.Format($"{{0,{FieldWidth}}}", "width"); 14 | string genderText = string.Format($"{{0,{FieldWidth}}}", "length"); 15 | string ageText = string.Format($"{{0, {FieldWidth}}}", "area"); 16 | return $"{nameText} {genderText} {ageText}"; 17 | } 18 | 19 | public static string GetBar(char c = '-') 20 | { 21 | return new string(c, FieldWidth * 3 + 2); 22 | } 23 | #endregion 24 | 25 | #region instance members 26 | //instance fields 27 | protected double _width = 0.0; 28 | protected double _length = 0.0; 29 | protected double _area = 0.0; 30 | protected bool _isAreaToUpdate = false; 31 | 32 | //instance constructors 33 | public Rectangle() { } 34 | public Rectangle(double width, double length) 35 | { 36 | _width = width; 37 | _length = length; 38 | _isAreaToUpdate = true; 39 | } 40 | 41 | //instance methods 42 | public double GetWidth() { return _width; } 43 | 44 | public double GetLength() { return _length; } 45 | 46 | public double GetArea() 47 | { 48 | if (_isAreaToUpdate) _area = _width * _length; 49 | return _area; } 50 | 51 | public bool SetData(string data, string separator=" ") 52 | { 53 | string[] sides = data.Split(separator); 54 | if (sides.Length < 2) return false; 55 | if (double.TryParse(sides[0], out double wd)==false) return false; 56 | if(double.TryParse(sides[1], out double lng)==false) return false; 57 | _width = wd; 58 | _length = lng; 59 | _isAreaToUpdate = true; 60 | return true; 61 | } 62 | 63 | public string GetInfo() 64 | { 65 | string format ="{0," + $"{FieldWidth}:N{DecimalPoint}" +"}"; 66 | string wdInfo = string.Format(format, GetWidth()); 67 | string lngInfo = string.Format(format, GetLength()); 68 | string areaInfo = string.Format(format, GetArea()); 69 | return $"{wdInfo} {lngInfo} {areaInfo}"; 70 | } 71 | #endregion 72 | } 73 | } -------------------------------------------------------------------------------- /Sources/Week2/Demo/RecObjectsDemo/Rectangle.cs: -------------------------------------------------------------------------------- 1 | namespace RecObjectsDemo 2 | { 3 | public class Rectangle 4 | { 5 | #region static members 6 | //static fields 7 | public static int FieldWidth = 8; 8 | public static int DecimalPoint = 2; 9 | 10 | //static metnods 11 | public static string GetHeading() 12 | { 13 | string wdText = string.Format($"{{0,{FieldWidth}}}", "width"); 14 | string lngText = string.Format($"{{0,{FieldWidth}}}", "length"); 15 | string areaText = string.Format($"{{0, {FieldWidth}}}", "area"); 16 | return $"{wdText} {lngText} {areaText}"; 17 | } 18 | 19 | public static string GetBar(char c = '-') 20 | { 21 | return new string(c, FieldWidth * 3 + 2); 22 | } 23 | #endregion 24 | 25 | #region instance members 26 | //instance fields 27 | protected double _width = 0.0; 28 | protected double _length = 0.0; 29 | protected double _area = 0.0; 30 | protected bool _isAreaToUpdate = false; 31 | 32 | //instance constructors 33 | public Rectangle() { } 34 | public Rectangle(double width, double length) 35 | { 36 | _width = width; 37 | _length = length; 38 | _isAreaToUpdate = true; 39 | } 40 | 41 | //instance methods 42 | public double GetWidth() { return _width; } 43 | 44 | public double GetLength() { return _length; } 45 | 46 | public double GetArea() 47 | { 48 | if (_isAreaToUpdate) _area = _width * _length; 49 | return _area; } 50 | 51 | public bool SetData(string data, string separator=" ") 52 | { 53 | string[] sides = data.Split(separator); 54 | if (sides.Length < 2) return false; 55 | if (double.TryParse(sides[0], out double wd)==false) return false; 56 | if(double.TryParse(sides[1], out double lng)==false) return false; 57 | _width = wd; 58 | _length = lng; 59 | _isAreaToUpdate = true; 60 | return true; 61 | } 62 | 63 | public string GetInfo() 64 | { 65 | string format ="{0," + $"{FieldWidth}:N{DecimalPoint}" +"}"; 66 | string wdInfo = string.Format(format, GetWidth()); 67 | string lngInfo = string.Format(format, GetLength()); 68 | string areaInfo = string.Format(format, GetArea()); 69 | return $"{wdInfo} {lngInfo} {areaInfo}"; 70 | } 71 | #endregion 72 | } 73 | } -------------------------------------------------------------------------------- /Sources/Week5/Demo/Prop_Event_Demo/Rectangle.cs: -------------------------------------------------------------------------------- 1 | namespace Prop_Event_Demo; 2 | 3 | public class Rectangle 4 | { 5 | #region static members 6 | private static int Instances = 0; 7 | //static RW properties 8 | public static int FieldWidth { get; set; } = 8; 9 | public static int DecimalPoint { get; set; } = 2; 10 | 11 | //static methods 12 | public static string GetHeading() 13 | { 14 | string noText = string.Format($"{{0,{FieldWidth}}}", "no"); 15 | string nameText = string.Format($"{{0,{FieldWidth}}}", "width"); 16 | string genderText = string.Format($"{{0,{FieldWidth}}}", "length"); 17 | string ageText = string.Format($"{{0, {FieldWidth}}}", "area"); 18 | return $"{noText} {nameText} {genderText} {ageText}"; 19 | } 20 | 21 | public static string GetBar(char c = '-') 22 | { 23 | return new string(c, FieldWidth * 4 + 3); 24 | } 25 | #endregion 26 | 27 | #region instance members 28 | //instance events 29 | public RectangleHandler? DataModified = null; 30 | 31 | //instance fields 32 | protected int _no = 0; 33 | protected double _width = 0.0; 34 | protected double _length = 0.0; 35 | 36 | //instance constructors 37 | public Rectangle() { _no = ++Instances; } 38 | public Rectangle(double width, double length) 39 | { 40 | _no = ++Instances; 41 | _width = width; 42 | _length = length; 43 | } 44 | 45 | //Instance RW properties 46 | public double Width 47 | { 48 | get { return _width; } 49 | set { _width = value; DataModified?.Invoke(this); } 50 | } 51 | public double Length 52 | { 53 | get { return _length; } 54 | set { _length = value; DataModified?.Invoke(this); } 55 | } 56 | 57 | //Write-only property 58 | public List Data 59 | { 60 | set 61 | { 62 | if (value.Count < 2) return; 63 | _width = value[0]; 64 | _length = value[1]; 65 | DataModified?.Invoke(this); 66 | } 67 | } 68 | 69 | //Read-only properties 70 | public int No { get { return _no; } } 71 | public double Area { get { return _width * _length; } } 72 | public string Info 73 | { 74 | get 75 | { 76 | string format = "{0," + $"{FieldWidth}:N{DecimalPoint}" + "}"; 77 | string noInfo = string.Format($"{{0,{FieldWidth}}}", _no); 78 | string wdInfo = string.Format(format, _width); 79 | string lngInfo = string.Format(format, _length); 80 | string areaInfo = string.Format(format, Area); 81 | return $"{noInfo} {wdInfo} {lngInfo} {areaInfo}"; 82 | } 83 | } 84 | #endregion 85 | } 86 | -------------------------------------------------------------------------------- /Sources/Week3/Lab/People_List/Program.cs: -------------------------------------------------------------------------------- 1 | using People_OOP.Models; 2 | using System.Text; 3 | 4 | namespace People_OOP 5 | { 6 | internal class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | string datafile = "people.txt"; 11 | List people = GetPeople(datafile); 12 | 13 | Console.WriteLine("\nOriginal people"); 14 | ViewPeople(people); 15 | 16 | Pause(); 17 | List filterPeople = FilterPeopleOverAge(people, 25); 18 | filterPeople.Sort(AgeComparison); 19 | Console.WriteLine("\nPeople with age>25 in decending of ages"); 20 | ViewPeople(filterPeople); 21 | 22 | Pause(); 23 | people.Sort(NameComparison); 24 | Console.WriteLine("\nPeople in ascending of names"); 25 | ViewPeople(people); 26 | } 27 | static void Pause() 28 | { 29 | Console.WriteLine("Any key to continue..."); 30 | Console.ReadKey(); 31 | } 32 | static List GetPeople(string file) 33 | { 34 | TextReader reader = Console.In; 35 | Console.SetIn(new StreamReader(file)); 36 | List result = new(); 37 | while (true) 38 | { 39 | string? data = Console.ReadLine(); 40 | if (data == null) break; 41 | Person p = new Person(); 42 | if (p.SetData(data, "/") == false) continue; 43 | result.Add(p); 44 | } 45 | Console.SetIn(reader); 46 | return result; 47 | } 48 | static void ViewPeople(List pers) 49 | { 50 | if (pers.Count == 0) 51 | { 52 | Console.WriteLine("No people to be shown out"); 53 | } 54 | Console.WriteLine(Person.GetHeading()); 55 | Console.WriteLine(Person.GetBar()); 56 | for (int index = 0; index < pers.Count; index++) 57 | { 58 | Console.WriteLine(pers[index].GetInfo()); 59 | } 60 | Console.WriteLine(Person.GetBar()); 61 | } 62 | static List FilterPeopleOverAge(List pers, int age) 63 | { 64 | List result = new(); 65 | foreach (Person p in pers) 66 | if (p.GetAge() > age) { result.Add(p); } 67 | return result; 68 | } 69 | static int AgeComparison(Person x, Person y) 70 | { 71 | return y.GetAge().CompareTo(x.GetAge()); 72 | } 73 | static int NameComparison(Person x, Person y) 74 | { 75 | return x.GetName().CompareTo(y.GetName()); 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /Sources/Week4/Demo/Action_Func_Demo/Program.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Linq.Expressions; 7 | using System.Reflection.Metadata; 8 | 9 | namespace Action_Func_Demo; 10 | 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | #region Getting rectangles where their data are from file 16 | var stdIn = Console.In; 17 | Console.SetIn(File.OpenText("recs.txt")); 18 | List recs = new List(); 19 | while (true) 20 | { 21 | string data = Console.ReadLine(); 22 | if (data == null) break; 23 | Rectangle rec = new(); 24 | if (rec.SetData(data, "/")) recs.Add(rec); 25 | } 26 | Console.SetIn(stdIn); 27 | #endregion 28 | 29 | #region Viewing Rectangles> Action with a method 30 | Action view = ViewRectangle; 31 | foreach (Rectangle r in recs) view(r); 32 | #endregion 33 | Pause(); 34 | 35 | #region Viewing Rectangles> Action with anonymous method 36 | Action view2 = delegate (Rectangle r) { Console.WriteLine(r.GetInfo()); }; 37 | foreach (Rectangle r in recs) view(r); 38 | #endregion 39 | Pause(); 40 | 41 | #region Viewing Rectangles> Lambda expression as argument of a paramter typed of Action 42 | recs.ForEach( 43 | (r) => Console.WriteLine(r.GetInfo()) 44 | ); 45 | #endregion 46 | Pause(); 47 | 48 | #region Area Total> Func with anonymous method 49 | Func func = delegate (Rectangle r){ return r.GetArea(); }; 50 | double? totalArea = recs.Sum(func); 51 | Console.WriteLine($"Area Total: {totalArea:N3}"); 52 | #endregion 53 | Pause(); 54 | 55 | #region Area Total> Lambda expression as argument of a paramter typed of Func 56 | double? totalArea2 = recs.Sum(r=>r.GetArea()); 57 | Console.WriteLine($"Area Total: {totalArea2:N3}"); 58 | #endregion 59 | Pause(); 60 | 61 | #region Ordering Rectangles: Lambda expression as argument 62 | var orderedRecs = recs.OrderBy(r=>r.GetArea()) 63 | .ToList(); 64 | orderedRecs.ForEach(r => Console.WriteLine(r.GetInfo())); 65 | #endregion 66 | Pause(); 67 | 68 | #region Filtering Rectangles: Lambda expression as argument 69 | var filterRecs = recs.Where(r=>r.GetArea() >= 40) 70 | .ToList(); 71 | filterRecs.ForEach(r => Console.WriteLine(r.GetInfo())); 72 | #endregion 73 | } 74 | static void Pause() 75 | { 76 | Console.Write("Press any key to continue..."); 77 | Console.ReadKey(); 78 | Console.WriteLine(); 79 | Console.WriteLine(); 80 | } 81 | static void ViewRectangle(Rectangle r) => Console.WriteLine(r.GetInfo()); 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/MainForm.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace MultiForms; 3 | 4 | public partial class MainForm : Form 5 | { 6 | List _recs= new List(); 7 | List _editing = new(); 8 | public MainForm() 9 | { 10 | InitializeComponent(); 11 | Rectangle.Created += (rec) => 12 | { 13 | _recs.Add(rec); 14 | AddRecToView(rec); 15 | }; 16 | LoadRectangles(); 17 | 18 | 19 | btnNew.Click += (sender, e) => new CreateForm().Show(); 20 | btnEdit.Click += DoClickEdit; 21 | btnDelete.Click += DoClickDelete; 22 | } 23 | 24 | private void DoClickDelete(object? sender, EventArgs e) 25 | { 26 | if (dgvRecs.CurrentRow == null) return; 27 | Rectangle? rec = _recs.FirstOrDefault(r => r.No == (int)dgvRecs.CurrentRow.Cells[0].Value); 28 | if (rec == null) return; 29 | if (_editing.Contains(rec)) 30 | { 31 | MessageBox.Show($"The rectangle no, {rec.No}, is currently being edited?", "Deleting", 32 | MessageBoxButtons.OK, MessageBoxIcon.Stop); 33 | return; 34 | } 35 | var result = MessageBox.Show($"Are you sure to delete a rectangle no, {rec.No}?", "Deleting", 36 | MessageBoxButtons.YesNo, MessageBoxIcon.Question); 37 | if (result == DialogResult.No) return; 38 | if (_recs.Remove(rec)) 39 | { 40 | dgvRecs.Rows.Remove(dgvRecs.CurrentRow); 41 | ViewOverallInfo(); 42 | } 43 | } 44 | 45 | private void DoClickEdit(object? sender, EventArgs e) 46 | { 47 | if (dgvRecs.CurrentRow == null) return; 48 | Rectangle? rec = _recs.FirstOrDefault(r => r.No == (int)dgvRecs.CurrentRow.Cells[0].Value); 49 | if (rec == null) return; 50 | EditForm frm = new EditForm(rec); 51 | frm.Updated += DoOnRecUpdated; 52 | frm.Show(); 53 | _editing.Add(rec); 54 | frm.FormClosed += (sender, e) => _editing.Remove(rec); 55 | } 56 | 57 | private void DoOnRecUpdated(EditForm sender, Rectangle rec) 58 | { 59 | foreach(DataGridViewRow row in dgvRecs.Rows) 60 | { 61 | if ( rec.No==(int)row.Cells[0].Value) 62 | { 63 | row.SetValues(rec.No, rec.Width, rec.Length, rec.Area); 64 | ViewOverallInfo(); 65 | break; 66 | } 67 | } 68 | 69 | } 70 | 71 | private void ViewOverallInfo() 72 | { 73 | txtCount.Text = _recs.Count.ToString(); 74 | txtTotal.Text = _recs.Sum(rec => rec.Area).ToString("N2"); 75 | } 76 | private void LoadRectangles() 77 | { 78 | _recs.Clear(); 79 | string[] lines = File.ReadAllLines("recs.txt"); 80 | foreach(string line in lines) 81 | { 82 | List? sides = line.ToValues(); 83 | if (sides == null) continue; 84 | if (sides.Count < 2) continue; 85 | Rectangle.CreateInstance(sides[0], sides[1]); 86 | } 87 | } 88 | private void AddRecToView(Rectangle rec) 89 | { 90 | dgvRecs.Rows.Add(rec.No, rec.Width, rec.Length, rec.Area); 91 | ViewOverallInfo(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Sources/Week6/Demo/Recs_WinForm_Demo/Form1.cs: -------------------------------------------------------------------------------- 1 | namespace Recs_WinForm_Demo 2 | { 3 | public partial class Form1 : Form 4 | { 5 | private DataGridViewRow? curRow = null; 6 | public Form1() 7 | { 8 | InitializeComponent(); 9 | ConfigGridView(); 10 | 11 | btnRefresh.Click += (object? sender, EventArgs e) => 12 | { 13 | dgvRecs.Rows.Clear(); 14 | curRow = null; 15 | Program.Recs.ForEach(rect => 16 | { 17 | dgvRecs.Rows.Add(rect.No, rect.Width, rect.Length, rect.Area); 18 | }); 19 | }; 20 | 21 | btnGridRemove.Click += (object? sender, EventArgs e) => 22 | { 23 | if (dgvRecs.CurrentRow == null) return; 24 | dgvRecs.Rows.Remove(dgvRecs.CurrentRow); 25 | }; 26 | 27 | btnDataRemove.Click += (object? sender, EventArgs e) => 28 | { 29 | if (dgvRecs.CurrentRow == null) return; 30 | int? no = (int?)dgvRecs.CurrentRow.Cells["colNo"].Value; 31 | Rectangle? removed = Program.Recs.FirstOrDefault(rect => rect.No == no); 32 | if (removed!=null && Program.Recs.Remove(removed)) 33 | { 34 | Task.Run(()=>MessageBox.Show($"A rectangle no, {removed.No}, was successfully removed")); 35 | ViewCurrentRectangle(); 36 | } 37 | }; 38 | 39 | btnRemoveBoth.Click += (object? sender, EventArgs e) => 40 | { 41 | if (dgvRecs.CurrentRow == null) return; 42 | Rectangle removed = Program.Recs[dgvRecs.CurrentRow.Index]; 43 | if (Program.Recs.Remove(removed)) 44 | { 45 | dgvRecs.Rows.Remove(dgvRecs.CurrentRow); 46 | } 47 | }; 48 | 49 | dgvRecs.SelectionChanged += (object? sender, EventArgs e) => 50 | { 51 | if (dgvRecs.CurrentRow != curRow) ViewCurrentRectangle(); 52 | }; 53 | } 54 | private void ViewCurrentRectangle() 55 | { 56 | curRow = dgvRecs.CurrentRow; 57 | int? no = (int?)curRow?.Cells["colNo"].Value; 58 | Rectangle? curRec = Program.Recs.FirstOrDefault(rect => rect.No == no); 59 | txtNo.Text = curRec?.No.ToString(); 60 | txtWidth.Text = curRec?.Width.ToString(); 61 | txtLength.Text = curRec?.Length.ToString(); 62 | txtArea.Text = curRec?.Area.ToString(); 63 | } 64 | 65 | void ConfigGridView() 66 | { 67 | dgvRecs.Columns.Clear(); 68 | dgvRecs.Columns.Add("colNo", "No"); 69 | dgvRecs.Columns.Add("colWidth", "Width"); 70 | dgvRecs.Columns.Add("colLength", "Length"); 71 | dgvRecs.Columns.Add("colArea", "Area"); 72 | 73 | foreach(DataGridViewColumn col in dgvRecs.Columns) 74 | { 75 | col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; 76 | if (col.Name == "colNo") continue; 77 | col.DefaultCellStyle.Format = "N2"; 78 | } 79 | dgvRecs.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; 80 | } 81 | 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Sources/Week3/Demo/RecObjectsDemo(List)/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection.Metadata.Ecma335; 2 | 3 | namespace RecObjectsDemo 4 | { 5 | internal class Program 6 | { 7 | static int countWidth = 6; 8 | static void Main(string[] args) 9 | { 10 | Rectangle.FieldWidth = 15; 11 | Rectangle.DecimalPoint = 3; 12 | 13 | List recs = GetInputRecs(); 14 | Console.Write("Press any key to see the output"); 15 | Console.ReadKey(); 16 | ShowRecs(recs); 17 | 18 | if (recs.Count > 0) 19 | { 20 | Console.Write("Press any key continue"); 21 | Console.ReadKey(); 22 | int no = -1; 23 | while (true) 24 | { 25 | Console.Write("\nRectangle number to be removed: "); 26 | if (int.TryParse(Console.ReadLine(), out no) == false) 27 | { 28 | Console.WriteLine("Invalid input"); 29 | continue; 30 | } 31 | if (no-1 > 0 && no-1 < recs.Count) break; 32 | Console.WriteLine($"Number must in [1, {recs.Count}]"); 33 | } 34 | recs.RemoveAt(no-1); 35 | Console.WriteLine($"A rectangle number, {no}, was removed"); 36 | ShowRecs(recs); 37 | } 38 | 39 | } 40 | private static List GetInputRecs() 41 | { 42 | Console.WriteLine("Rectangles"); 43 | Console.WriteLine("Input width and length separated by space (eg. 2 5) or empty to stop."); 44 | 45 | List recs = new List(); 46 | var count = 0; 47 | while (true) 48 | { 49 | Console.Write($"[{count + 1}]: "); 50 | var line = Console.ReadLine(); 51 | if (string.IsNullOrEmpty(line)) break; 52 | Rectangle rec = new(); 53 | if (rec.SetData(line) == false) continue; 54 | recs.Add(rec); 55 | } 56 | return recs; 57 | } 58 | 59 | private static void ShowRecs(List recs) 60 | { 61 | if (recs.Count == 0) 62 | Console.WriteLine("No rectangles to be shown out"); 63 | double total = 0; 64 | string result = ""; 65 | for(int index=0; index 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | label1 = new Label(); 32 | txtWidth = new TextBox(); 33 | txtLength = new TextBox(); 34 | label2 = new Label(); 35 | btnClear = new Button(); 36 | btnCreate = new Button(); 37 | SuspendLayout(); 38 | // 39 | // label1 40 | // 41 | label1.AutoSize = true; 42 | label1.Location = new Point(22, 52); 43 | label1.Name = "label1"; 44 | label1.Size = new Size(49, 20); 45 | label1.TabIndex = 0; 46 | label1.Text = "Width"; 47 | // 48 | // txtWidth 49 | // 50 | txtWidth.Location = new Point(22, 75); 51 | txtWidth.Name = "txtWidth"; 52 | txtWidth.Size = new Size(94, 27); 53 | txtWidth.TabIndex = 1; 54 | txtWidth.TextAlign = HorizontalAlignment.Right; 55 | // 56 | // txtLength 57 | // 58 | txtLength.Location = new Point(133, 75); 59 | txtLength.Name = "txtLength"; 60 | txtLength.Size = new Size(94, 27); 61 | txtLength.TabIndex = 3; 62 | txtLength.TextAlign = HorizontalAlignment.Right; 63 | // 64 | // label2 65 | // 66 | label2.AutoSize = true; 67 | label2.Location = new Point(133, 52); 68 | label2.Name = "label2"; 69 | label2.Size = new Size(54, 20); 70 | label2.TabIndex = 2; 71 | label2.Text = "Length"; 72 | // 73 | // btnClear 74 | // 75 | btnClear.Location = new Point(22, 12); 76 | btnClear.Name = "btnClear"; 77 | btnClear.Size = new Size(94, 29); 78 | btnClear.TabIndex = 4; 79 | btnClear.Text = "Clear"; 80 | btnClear.UseVisualStyleBackColor = true; 81 | // 82 | // btnCreate 83 | // 84 | btnCreate.Location = new Point(133, 113); 85 | btnCreate.Name = "btnCreate"; 86 | btnCreate.Size = new Size(94, 29); 87 | btnCreate.TabIndex = 5; 88 | btnCreate.Text = "Create"; 89 | btnCreate.UseVisualStyleBackColor = true; 90 | // 91 | // CreateForm 92 | // 93 | AutoScaleDimensions = new SizeF(8F, 20F); 94 | AutoScaleMode = AutoScaleMode.Font; 95 | ClientSize = new Size(249, 149); 96 | Controls.Add(btnCreate); 97 | Controls.Add(btnClear); 98 | Controls.Add(txtLength); 99 | Controls.Add(label2); 100 | Controls.Add(txtWidth); 101 | Controls.Add(label1); 102 | MaximizeBox = false; 103 | MinimizeBox = false; 104 | Name = "CreateForm"; 105 | Text = "Creating Rectangles"; 106 | ResumeLayout(false); 107 | PerformLayout(); 108 | } 109 | 110 | #endregion 111 | 112 | private Label label1; 113 | private TextBox txtWidth; 114 | private TextBox txtLength; 115 | private Label label2; 116 | private Button btnClear; 117 | private Button btnCreate; 118 | } 119 | } -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/EditForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MultiForms 2 | { 3 | partial class EditForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | btnUpdate = new Button(); 32 | btnCancel = new Button(); 33 | txtLength = new TextBox(); 34 | label2 = new Label(); 35 | txtWidth = new TextBox(); 36 | label1 = new Label(); 37 | txtNo = new TextBox(); 38 | label3 = new Label(); 39 | SuspendLayout(); 40 | // 41 | // btnUpdate 42 | // 43 | btnUpdate.Location = new Point(228, 112); 44 | btnUpdate.Name = "btnUpdate"; 45 | btnUpdate.Size = new Size(94, 29); 46 | btnUpdate.TabIndex = 11; 47 | btnUpdate.Text = "Update"; 48 | btnUpdate.UseVisualStyleBackColor = true; 49 | // 50 | // btnCancel 51 | // 52 | btnCancel.Location = new Point(12, 12); 53 | btnCancel.Name = "btnCancel"; 54 | btnCancel.Size = new Size(94, 29); 55 | btnCancel.TabIndex = 10; 56 | btnCancel.Text = "Cancel"; 57 | btnCancel.UseVisualStyleBackColor = true; 58 | // 59 | // txtLength 60 | // 61 | txtLength.Location = new Point(228, 70); 62 | txtLength.Name = "txtLength"; 63 | txtLength.Size = new Size(94, 27); 64 | txtLength.TabIndex = 9; 65 | txtLength.TextAlign = HorizontalAlignment.Right; 66 | // 67 | // label2 68 | // 69 | label2.AutoSize = true; 70 | label2.Location = new Point(228, 47); 71 | label2.Name = "label2"; 72 | label2.Size = new Size(54, 20); 73 | label2.TabIndex = 8; 74 | label2.Text = "Length"; 75 | // 76 | // txtWidth 77 | // 78 | txtWidth.Location = new Point(117, 70); 79 | txtWidth.Name = "txtWidth"; 80 | txtWidth.Size = new Size(94, 27); 81 | txtWidth.TabIndex = 7; 82 | txtWidth.TextAlign = HorizontalAlignment.Right; 83 | // 84 | // label1 85 | // 86 | label1.AutoSize = true; 87 | label1.Location = new Point(117, 47); 88 | label1.Name = "label1"; 89 | label1.Size = new Size(49, 20); 90 | label1.TabIndex = 6; 91 | label1.Text = "Width"; 92 | // 93 | // txtNo 94 | // 95 | txtNo.Location = new Point(12, 70); 96 | txtNo.Name = "txtNo"; 97 | txtNo.ReadOnly = true; 98 | txtNo.Size = new Size(94, 27); 99 | txtNo.TabIndex = 13; 100 | txtNo.TextAlign = HorizontalAlignment.Right; 101 | // 102 | // label3 103 | // 104 | label3.AutoSize = true; 105 | label3.Location = new Point(12, 47); 106 | label3.Name = "label3"; 107 | label3.Size = new Size(29, 20); 108 | label3.TabIndex = 12; 109 | label3.Text = "No"; 110 | // 111 | // EditForm 112 | // 113 | AutoScaleDimensions = new SizeF(8F, 20F); 114 | AutoScaleMode = AutoScaleMode.Font; 115 | ClientSize = new Size(343, 157); 116 | Controls.Add(txtNo); 117 | Controls.Add(label3); 118 | Controls.Add(btnUpdate); 119 | Controls.Add(btnCancel); 120 | Controls.Add(txtLength); 121 | Controls.Add(label2); 122 | Controls.Add(txtWidth); 123 | Controls.Add(label1); 124 | MaximizeBox = false; 125 | MinimizeBox = false; 126 | Name = "EditForm"; 127 | Text = "Editing Rectangle"; 128 | ResumeLayout(false); 129 | PerformLayout(); 130 | } 131 | 132 | #endregion 133 | 134 | private Button btnUpdate; 135 | private Button btnCancel; 136 | private TextBox txtLength; 137 | private Label label2; 138 | private TextBox txtWidth; 139 | private Label label1; 140 | private TextBox txtNo; 141 | private Label label3; 142 | } 143 | } -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/CreateForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/EditForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Sources/Week6/Demo/Recs_WinForm_Demo/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/MainForm.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | -------------------------------------------------------------------------------- /Sources/Week7/Demo/MultiForms/MainForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MultiForms 2 | { 3 | partial class MainForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle(); 32 | DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle(); 33 | DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle(); 34 | DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle(); 35 | dgvRecs = new DataGridView(); 36 | Column1 = new DataGridViewTextBoxColumn(); 37 | Column2 = new DataGridViewTextBoxColumn(); 38 | Column3 = new DataGridViewTextBoxColumn(); 39 | Column4 = new DataGridViewTextBoxColumn(); 40 | label1 = new Label(); 41 | txtCount = new TextBox(); 42 | txtTotal = new TextBox(); 43 | label2 = new Label(); 44 | btnNew = new Button(); 45 | btnEdit = new Button(); 46 | btnDelete = new Button(); 47 | ((System.ComponentModel.ISupportInitialize)dgvRecs).BeginInit(); 48 | SuspendLayout(); 49 | // 50 | // dgvRecs 51 | // 52 | dgvRecs.AllowUserToAddRows = false; 53 | dgvRecs.AllowUserToDeleteRows = false; 54 | dgvRecs.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; 55 | dgvRecs.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; 56 | dgvRecs.Columns.AddRange(new DataGridViewColumn[] { Column1, Column2, Column3, Column4 }); 57 | dgvRecs.Location = new Point(12, 80); 58 | dgvRecs.Name = "dgvRecs"; 59 | dgvRecs.ReadOnly = true; 60 | dgvRecs.RowHeadersWidth = 51; 61 | dgvRecs.RowTemplate.Height = 29; 62 | dgvRecs.Size = new Size(473, 358); 63 | dgvRecs.TabIndex = 0; 64 | // 65 | // Column1 66 | // 67 | dataGridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleRight; 68 | Column1.DefaultCellStyle = dataGridViewCellStyle1; 69 | Column1.HeaderText = "No"; 70 | Column1.MinimumWidth = 6; 71 | Column1.Name = "Column1"; 72 | Column1.ReadOnly = true; 73 | Column1.Width = 58; 74 | // 75 | // Column2 76 | // 77 | dataGridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleRight; 78 | dataGridViewCellStyle2.Format = "N2"; 79 | Column2.DefaultCellStyle = dataGridViewCellStyle2; 80 | Column2.HeaderText = "Width"; 81 | Column2.MinimumWidth = 6; 82 | Column2.Name = "Column2"; 83 | Column2.ReadOnly = true; 84 | Column2.Width = 78; 85 | // 86 | // Column3 87 | // 88 | dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleRight; 89 | dataGridViewCellStyle3.Format = "N2"; 90 | Column3.DefaultCellStyle = dataGridViewCellStyle3; 91 | Column3.HeaderText = "Length"; 92 | Column3.MinimumWidth = 6; 93 | Column3.Name = "Column3"; 94 | Column3.ReadOnly = true; 95 | Column3.Width = 83; 96 | // 97 | // Column4 98 | // 99 | dataGridViewCellStyle4.Alignment = DataGridViewContentAlignment.MiddleRight; 100 | dataGridViewCellStyle4.Format = "N2"; 101 | Column4.DefaultCellStyle = dataGridViewCellStyle4; 102 | Column4.HeaderText = "Area"; 103 | Column4.MinimumWidth = 6; 104 | Column4.Name = "Column4"; 105 | Column4.ReadOnly = true; 106 | Column4.Width = 69; 107 | // 108 | // label1 109 | // 110 | label1.AutoSize = true; 111 | label1.Location = new Point(18, 18); 112 | label1.Name = "label1"; 113 | label1.Size = new Size(81, 20); 114 | label1.TabIndex = 1; 115 | label1.Text = "Rectangles"; 116 | // 117 | // txtCount 118 | // 119 | txtCount.Location = new Point(103, 14); 120 | txtCount.Name = "txtCount"; 121 | txtCount.ReadOnly = true; 122 | txtCount.Size = new Size(70, 27); 123 | txtCount.TabIndex = 2; 124 | txtCount.TextAlign = HorizontalAlignment.Right; 125 | // 126 | // txtTotal 127 | // 128 | txtTotal.Location = new Point(102, 48); 129 | txtTotal.Name = "txtTotal"; 130 | txtTotal.ReadOnly = true; 131 | txtTotal.Size = new Size(113, 27); 132 | txtTotal.TabIndex = 3; 133 | txtTotal.TextAlign = HorizontalAlignment.Right; 134 | // 135 | // label2 136 | // 137 | label2.AutoSize = true; 138 | label2.Location = new Point(18, 51); 139 | label2.Name = "label2"; 140 | label2.Size = new Size(77, 20); 141 | label2.TabIndex = 4; 142 | label2.Text = "Area Total"; 143 | // 144 | // btnNew 145 | // 146 | btnNew.Location = new Point(493, 121); 147 | btnNew.Name = "btnNew"; 148 | btnNew.Size = new Size(94, 29); 149 | btnNew.TabIndex = 5; 150 | btnNew.Text = "New"; 151 | btnNew.UseVisualStyleBackColor = true; 152 | // 153 | // btnEdit 154 | // 155 | btnEdit.Location = new Point(495, 162); 156 | btnEdit.Name = "btnEdit"; 157 | btnEdit.Size = new Size(94, 29); 158 | btnEdit.TabIndex = 6; 159 | btnEdit.Text = "Edit"; 160 | btnEdit.UseVisualStyleBackColor = true; 161 | // 162 | // btnDelete 163 | // 164 | btnDelete.Location = new Point(494, 404); 165 | btnDelete.Name = "btnDelete"; 166 | btnDelete.Size = new Size(94, 29); 167 | btnDelete.TabIndex = 7; 168 | btnDelete.Text = "Delete"; 169 | btnDelete.UseVisualStyleBackColor = true; 170 | // 171 | // MainForm 172 | // 173 | AutoScaleDimensions = new SizeF(8F, 20F); 174 | AutoScaleMode = AutoScaleMode.Font; 175 | ClientSize = new Size(595, 452); 176 | Controls.Add(btnDelete); 177 | Controls.Add(btnEdit); 178 | Controls.Add(btnNew); 179 | Controls.Add(label2); 180 | Controls.Add(txtTotal); 181 | Controls.Add(txtCount); 182 | Controls.Add(label1); 183 | Controls.Add(dgvRecs); 184 | MaximizeBox = false; 185 | MinimizeBox = false; 186 | Name = "MainForm"; 187 | Text = "Rectangles"; 188 | ((System.ComponentModel.ISupportInitialize)dgvRecs).EndInit(); 189 | ResumeLayout(false); 190 | PerformLayout(); 191 | } 192 | 193 | #endregion 194 | 195 | private DataGridView dgvRecs; 196 | private Label label1; 197 | private TextBox txtCount; 198 | private TextBox txtTotal; 199 | private Label label2; 200 | private DataGridViewTextBoxColumn Column1; 201 | private DataGridViewTextBoxColumn Column2; 202 | private DataGridViewTextBoxColumn Column3; 203 | private DataGridViewTextBoxColumn Column4; 204 | private Button btnNew; 205 | private Button btnEdit; 206 | private Button btnDelete; 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.tlog 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 298 | *.vbp 299 | 300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 301 | *.dsw 302 | *.dsp 303 | 304 | # Visual Studio 6 technical files 305 | *.ncb 306 | *.aps 307 | 308 | # Visual Studio LightSwitch build output 309 | **/*.HTMLClient/GeneratedArtifacts 310 | **/*.DesktopClient/GeneratedArtifacts 311 | **/*.DesktopClient/ModelManifest.xml 312 | **/*.Server/GeneratedArtifacts 313 | **/*.Server/ModelManifest.xml 314 | _Pvt_Extensions 315 | 316 | # Paket dependency manager 317 | .paket/paket.exe 318 | paket-files/ 319 | 320 | # FAKE - F# Make 321 | .fake/ 322 | 323 | # CodeRush personal settings 324 | .cr/personal 325 | 326 | # Python Tools for Visual Studio (PTVS) 327 | __pycache__/ 328 | *.pyc 329 | 330 | # Cake - Uncomment if you are using it 331 | # tools/** 332 | # !tools/packages.config 333 | 334 | # Tabs Studio 335 | *.tss 336 | 337 | # Telerik's JustMock configuration file 338 | *.jmconfig 339 | 340 | # BizTalk build output 341 | *.btp.cs 342 | *.btm.cs 343 | *.odx.cs 344 | *.xsd.cs 345 | 346 | # OpenCover UI analysis results 347 | OpenCover/ 348 | 349 | # Azure Stream Analytics local run output 350 | ASALocalRun/ 351 | 352 | # MSBuild Binary and Structured Log 353 | *.binlog 354 | 355 | # NVidia Nsight GPU debugger configuration file 356 | *.nvuser 357 | 358 | # MFractors (Xamarin productivity tool) working folder 359 | .mfractor/ 360 | 361 | # Local History for Visual Studio 362 | .localhistory/ 363 | 364 | # Visual Studio History (VSHistory) files 365 | .vshistory/ 366 | 367 | # BeatPulse healthcheck temp database 368 | healthchecksdb 369 | 370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 371 | MigrationBackup/ 372 | 373 | # Ionide (cross platform F# VS Code tools) working folder 374 | .ionide/ 375 | 376 | # Fody - auto-generated XML schema 377 | FodyWeavers.xsd 378 | 379 | # VS Code files for those working on multiple tools 380 | .vscode/* 381 | !.vscode/settings.json 382 | !.vscode/tasks.json 383 | !.vscode/launch.json 384 | !.vscode/extensions.json 385 | *.code-workspace 386 | 387 | # Local History for Visual Studio Code 388 | .history/ 389 | 390 | # Windows Installer files from build outputs 391 | *.cab 392 | *.msi 393 | *.msix 394 | *.msm 395 | *.msp 396 | 397 | # JetBrains Rider 398 | *.sln.iml 399 | -------------------------------------------------------------------------------- /Sources/Week6/Demo/Recs_WinForm_Demo/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Recs_WinForm_Demo 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | btnRefresh = new Button(); 32 | dgvRecs = new DataGridView(); 33 | btnGridRemove = new Button(); 34 | btnDataRemove = new Button(); 35 | btnRemoveBoth = new Button(); 36 | groupBox1 = new GroupBox(); 37 | txtArea = new TextBox(); 38 | label4 = new Label(); 39 | txtLength = new TextBox(); 40 | label3 = new Label(); 41 | txtWidth = new TextBox(); 42 | label2 = new Label(); 43 | txtNo = new TextBox(); 44 | label1 = new Label(); 45 | ((System.ComponentModel.ISupportInitialize)dgvRecs).BeginInit(); 46 | groupBox1.SuspendLayout(); 47 | SuspendLayout(); 48 | // 49 | // btnRefresh 50 | // 51 | btnRefresh.Location = new Point(12, 12); 52 | btnRefresh.Name = "btnRefresh"; 53 | btnRefresh.Size = new Size(94, 30); 54 | btnRefresh.TabIndex = 0; 55 | btnRefresh.Text = "Refresh"; 56 | btnRefresh.UseVisualStyleBackColor = true; 57 | // 58 | // dgvRecs 59 | // 60 | dgvRecs.AllowUserToAddRows = false; 61 | dgvRecs.AllowUserToDeleteRows = false; 62 | dgvRecs.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; 63 | dgvRecs.Location = new Point(15, 52); 64 | dgvRecs.Name = "dgvRecs"; 65 | dgvRecs.ReadOnly = true; 66 | dgvRecs.RowHeadersWidth = 51; 67 | dgvRecs.RowTemplate.Height = 29; 68 | dgvRecs.Size = new Size(420, 253); 69 | dgvRecs.TabIndex = 1; 70 | // 71 | // btnGridRemove 72 | // 73 | btnGridRemove.Location = new Point(454, 52); 74 | btnGridRemove.Name = "btnGridRemove"; 75 | btnGridRemove.Size = new Size(130, 72); 76 | btnGridRemove.TabIndex = 2; 77 | btnGridRemove.Text = "Remove From Gridview"; 78 | btnGridRemove.UseVisualStyleBackColor = true; 79 | // 80 | // btnDataRemove 81 | // 82 | btnDataRemove.Location = new Point(454, 143); 83 | btnDataRemove.Name = "btnDataRemove"; 84 | btnDataRemove.Size = new Size(130, 72); 85 | btnDataRemove.TabIndex = 3; 86 | btnDataRemove.Text = "Remove From Data"; 87 | btnDataRemove.UseVisualStyleBackColor = true; 88 | // 89 | // btnRemoveBoth 90 | // 91 | btnRemoveBoth.Location = new Point(454, 230); 92 | btnRemoveBoth.Name = "btnRemoveBoth"; 93 | btnRemoveBoth.Size = new Size(130, 72); 94 | btnRemoveBoth.TabIndex = 4; 95 | btnRemoveBoth.Text = "Remove Both"; 96 | btnRemoveBoth.UseVisualStyleBackColor = true; 97 | // 98 | // groupBox1 99 | // 100 | groupBox1.Controls.Add(txtArea); 101 | groupBox1.Controls.Add(label4); 102 | groupBox1.Controls.Add(txtLength); 103 | groupBox1.Controls.Add(label3); 104 | groupBox1.Controls.Add(txtWidth); 105 | groupBox1.Controls.Add(label2); 106 | groupBox1.Controls.Add(txtNo); 107 | groupBox1.Controls.Add(label1); 108 | groupBox1.Location = new Point(15, 311); 109 | groupBox1.Name = "groupBox1"; 110 | groupBox1.Size = new Size(420, 93); 111 | groupBox1.TabIndex = 5; 112 | groupBox1.TabStop = false; 113 | groupBox1.Text = "Current Rectangle"; 114 | // 115 | // txtArea 116 | // 117 | txtArea.Location = new Point(322, 48); 118 | txtArea.Name = "txtArea"; 119 | txtArea.ReadOnly = true; 120 | txtArea.Size = new Size(88, 27); 121 | txtArea.TabIndex = 7; 122 | txtArea.TextAlign = HorizontalAlignment.Right; 123 | // 124 | // label4 125 | // 126 | label4.AutoSize = true; 127 | label4.Location = new Point(322, 24); 128 | label4.Name = "label4"; 129 | label4.Size = new Size(40, 20); 130 | label4.TabIndex = 6; 131 | label4.Text = "Area"; 132 | // 133 | // txtLength 134 | // 135 | txtLength.Location = new Point(217, 48); 136 | txtLength.Name = "txtLength"; 137 | txtLength.Size = new Size(88, 27); 138 | txtLength.TabIndex = 5; 139 | txtLength.TextAlign = HorizontalAlignment.Right; 140 | // 141 | // label3 142 | // 143 | label3.AutoSize = true; 144 | label3.Location = new Point(217, 24); 145 | label3.Name = "label3"; 146 | label3.Size = new Size(54, 20); 147 | label3.TabIndex = 4; 148 | label3.Text = "Length"; 149 | // 150 | // txtWidth 151 | // 152 | txtWidth.Location = new Point(110, 48); 153 | txtWidth.Name = "txtWidth"; 154 | txtWidth.Size = new Size(88, 27); 155 | txtWidth.TabIndex = 3; 156 | txtWidth.TextAlign = HorizontalAlignment.Right; 157 | // 158 | // label2 159 | // 160 | label2.AutoSize = true; 161 | label2.Location = new Point(110, 24); 162 | label2.Name = "label2"; 163 | label2.Size = new Size(49, 20); 164 | label2.TabIndex = 2; 165 | label2.Text = "Width"; 166 | // 167 | // txtNo 168 | // 169 | txtNo.Location = new Point(12, 47); 170 | txtNo.Name = "txtNo"; 171 | txtNo.ReadOnly = true; 172 | txtNo.Size = new Size(88, 27); 173 | txtNo.TabIndex = 1; 174 | txtNo.TextAlign = HorizontalAlignment.Right; 175 | // 176 | // label1 177 | // 178 | label1.AutoSize = true; 179 | label1.Location = new Point(8, 24); 180 | label1.Name = "label1"; 181 | label1.Size = new Size(29, 20); 182 | label1.TabIndex = 0; 183 | label1.Text = "No"; 184 | // 185 | // Form1 186 | // 187 | AutoScaleDimensions = new SizeF(8F, 20F); 188 | AutoScaleMode = AutoScaleMode.Font; 189 | ClientSize = new Size(597, 418); 190 | Controls.Add(groupBox1); 191 | Controls.Add(btnRemoveBoth); 192 | Controls.Add(btnDataRemove); 193 | Controls.Add(btnGridRemove); 194 | Controls.Add(dgvRecs); 195 | Controls.Add(btnRefresh); 196 | MaximizeBox = false; 197 | MinimizeBox = false; 198 | Name = "Form1"; 199 | Text = "Rectangles"; 200 | ((System.ComponentModel.ISupportInitialize)dgvRecs).EndInit(); 201 | groupBox1.ResumeLayout(false); 202 | groupBox1.PerformLayout(); 203 | ResumeLayout(false); 204 | } 205 | 206 | #endregion 207 | 208 | private Button btnRefresh; 209 | private DataGridView dgvRecs; 210 | private Button btnGridRemove; 211 | private Button btnDataRemove; 212 | private Button btnRemoveBoth; 213 | private GroupBox groupBox1; 214 | private TextBox txtArea; 215 | private Label label4; 216 | private TextBox txtLength; 217 | private Label label3; 218 | private TextBox txtWidth; 219 | private Label label2; 220 | private TextBox txtNo; 221 | private Label label1; 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /Codes.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StandardInputOutput", "Sources\Week1\Demo\StandardInputOutput\StandardInputOutput.csproj", "{07877B46-6459-4C7A-BB1F-9387CB551D37}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FileInputOutput", "Sources\Week1\Demo\FileInputOutput\FileInputOutput.csproj", "{A493370D-6385-43E0-8A67-A036BA7D8DDF}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "W1-InputOutput", "W1-InputOutput", "{2D7C2C2B-C0CE-44C4-AE8F-3F5C36A403C7}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{FDFC3F19-16AD-4041-8ACA-D9104A5AF337}" 13 | EndProject 14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lab", "Lab", "{B61AB9DA-80D9-4A2F-99B8-5D782A5B4836}" 15 | EndProject 16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RecsInput", "Sources\Week1\Lab\RecsInput\RecsInput.csproj", "{6D7CBBAE-225E-4260-9719-67E1C4568756}" 17 | EndProject 18 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RecObjectsDemo", "Sources\Week2\Demo\RecObjectsDemo\RecObjectsDemo.csproj", "{273B687E-0542-4C02-B262-B0A2C571485B}" 19 | EndProject 20 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "W2-ClassObjects", "W2-ClassObjects", "{E0796DB8-FC9F-4B05-88B8-F89329D23BC1}" 21 | EndProject 22 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{3BAD15D6-C22F-4557-B7FA-45E8A6032028}" 23 | EndProject 24 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lab", "Lab", "{4DEE3253-6921-4FB9-A21D-9F44787743A5}" 25 | EndProject 26 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "People_OOP", "Sources\Week2\Lab\People_OOP\People_OOP.csproj", "{11F29CDE-DD0D-4521-B392-61CFD5431CFD}" 27 | EndProject 28 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "W3-ClassObjects(List)", "W3-ClassObjects(List)", "{75C33BA1-63D9-40CF-BE62-B7511E8C7257}" 29 | EndProject 30 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{1615390E-77D9-4FFA-8159-B0794B400892}" 31 | EndProject 32 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RecObjectsDemo(List)", "Sources\Week3\Demo\RecObjectsDemo(List)\RecObjectsDemo(List).csproj", "{FBC9E393-6746-4B03-AD48-6858FB604D2F}" 33 | EndProject 34 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lab", "Lab", "{A99D423F-C325-4BD6-BA7C-47E578D461D0}" 35 | EndProject 36 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "People_List", "Sources\Week3\Lab\People_List\People_List.csproj", "{BB06B10E-81B2-4208-982A-EC4825A951BE}" 37 | EndProject 38 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "W4-Delegates", "W4-Delegates", "{50B59049-97B0-42FC-91CD-B78C4734080A}" 39 | EndProject 40 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{33A855C0-4C4F-4058-98D4-E1356F8FB6E2}" 41 | EndProject 42 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DelegateDemo", "Sources\Week4\Demo\DelegateDemo\DelegateDemo.csproj", "{11FC4E55-8EF1-4BCD-BD0D-AEA5D9AF6FA0}" 43 | EndProject 44 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Action_Func_Demo", "Sources\Week4\Demo\Action_Func_Demo\Action_Func_Demo.csproj", "{73ACC03E-6A3A-4C65-9AB8-9E6591D9E82C}" 45 | EndProject 46 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "W5-PropEvents", "W5-PropEvents", "{D0F29ED3-DD51-418E-B99E-E900EABA207F}" 47 | EndProject 48 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{B33691D2-42B4-4CC8-8DE2-69B282FBB8BA}" 49 | EndProject 50 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Prop_Event_Demo", "Sources\Week5\Demo\Prop_Event_Demo\Prop_Event_Demo.csproj", "{4BA983D6-558E-4126-A19C-B3C7234E5201}" 51 | EndProject 52 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "W6-WinForm", "W6-WinForm", "{4B51E9AC-3B8B-4B2C-80D6-8AAD01A44ED1}" 53 | EndProject 54 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{6C2EC80F-1154-4F4F-8956-33EF08F29CE2}" 55 | EndProject 56 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Recs_WinForm_Demo", "Sources\Week6\Demo\Recs_WinForm_Demo\Recs_WinForm_Demo.csproj", "{D0CB568D-0C96-460F-A38A-5388546BB6D6}" 57 | EndProject 58 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "W7-WinForms", "W7-WinForms", "{15F290EA-5D0B-4A2C-A148-6B23F4F88787}" 59 | EndProject 60 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{A0715E31-0D59-42CC-8309-84EB51049864}" 61 | EndProject 62 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MultiForms", "Sources\Week7\Demo\MultiForms\MultiForms.csproj", "{E8D42E35-199C-4179-B472-5049F7E3ABB4}" 63 | EndProject 64 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lab", "Lab", "{5DA9928C-972F-4FFA-84C7-211789288866}" 65 | EndProject 66 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Person_EventHandling", "Sources\Week5\Lab\Person_EventHandling\Person_EventHandling.csproj", "{C7577AF7-4F7F-4623-AEFA-86B441BE0CED}" 67 | EndProject 68 | Global 69 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 70 | Debug|Any CPU = Debug|Any CPU 71 | Release|Any CPU = Release|Any CPU 72 | EndGlobalSection 73 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 74 | {07877B46-6459-4C7A-BB1F-9387CB551D37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 75 | {07877B46-6459-4C7A-BB1F-9387CB551D37}.Debug|Any CPU.Build.0 = Debug|Any CPU 76 | {07877B46-6459-4C7A-BB1F-9387CB551D37}.Release|Any CPU.ActiveCfg = Release|Any CPU 77 | {07877B46-6459-4C7A-BB1F-9387CB551D37}.Release|Any CPU.Build.0 = Release|Any CPU 78 | {A493370D-6385-43E0-8A67-A036BA7D8DDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 79 | {A493370D-6385-43E0-8A67-A036BA7D8DDF}.Debug|Any CPU.Build.0 = Debug|Any CPU 80 | {A493370D-6385-43E0-8A67-A036BA7D8DDF}.Release|Any CPU.ActiveCfg = Release|Any CPU 81 | {A493370D-6385-43E0-8A67-A036BA7D8DDF}.Release|Any CPU.Build.0 = Release|Any CPU 82 | {6D7CBBAE-225E-4260-9719-67E1C4568756}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 83 | {6D7CBBAE-225E-4260-9719-67E1C4568756}.Debug|Any CPU.Build.0 = Debug|Any CPU 84 | {6D7CBBAE-225E-4260-9719-67E1C4568756}.Release|Any CPU.ActiveCfg = Release|Any CPU 85 | {6D7CBBAE-225E-4260-9719-67E1C4568756}.Release|Any CPU.Build.0 = Release|Any CPU 86 | {273B687E-0542-4C02-B262-B0A2C571485B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 87 | {273B687E-0542-4C02-B262-B0A2C571485B}.Debug|Any CPU.Build.0 = Debug|Any CPU 88 | {273B687E-0542-4C02-B262-B0A2C571485B}.Release|Any CPU.ActiveCfg = Release|Any CPU 89 | {273B687E-0542-4C02-B262-B0A2C571485B}.Release|Any CPU.Build.0 = Release|Any CPU 90 | {11F29CDE-DD0D-4521-B392-61CFD5431CFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 91 | {11F29CDE-DD0D-4521-B392-61CFD5431CFD}.Debug|Any CPU.Build.0 = Debug|Any CPU 92 | {11F29CDE-DD0D-4521-B392-61CFD5431CFD}.Release|Any CPU.ActiveCfg = Release|Any CPU 93 | {11F29CDE-DD0D-4521-B392-61CFD5431CFD}.Release|Any CPU.Build.0 = Release|Any CPU 94 | {FBC9E393-6746-4B03-AD48-6858FB604D2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 95 | {FBC9E393-6746-4B03-AD48-6858FB604D2F}.Debug|Any CPU.Build.0 = Debug|Any CPU 96 | {FBC9E393-6746-4B03-AD48-6858FB604D2F}.Release|Any CPU.ActiveCfg = Release|Any CPU 97 | {FBC9E393-6746-4B03-AD48-6858FB604D2F}.Release|Any CPU.Build.0 = Release|Any CPU 98 | {BB06B10E-81B2-4208-982A-EC4825A951BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 99 | {BB06B10E-81B2-4208-982A-EC4825A951BE}.Debug|Any CPU.Build.0 = Debug|Any CPU 100 | {BB06B10E-81B2-4208-982A-EC4825A951BE}.Release|Any CPU.ActiveCfg = Release|Any CPU 101 | {BB06B10E-81B2-4208-982A-EC4825A951BE}.Release|Any CPU.Build.0 = Release|Any CPU 102 | {11FC4E55-8EF1-4BCD-BD0D-AEA5D9AF6FA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 103 | {11FC4E55-8EF1-4BCD-BD0D-AEA5D9AF6FA0}.Debug|Any CPU.Build.0 = Debug|Any CPU 104 | {11FC4E55-8EF1-4BCD-BD0D-AEA5D9AF6FA0}.Release|Any CPU.ActiveCfg = Release|Any CPU 105 | {11FC4E55-8EF1-4BCD-BD0D-AEA5D9AF6FA0}.Release|Any CPU.Build.0 = Release|Any CPU 106 | {73ACC03E-6A3A-4C65-9AB8-9E6591D9E82C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 107 | {73ACC03E-6A3A-4C65-9AB8-9E6591D9E82C}.Debug|Any CPU.Build.0 = Debug|Any CPU 108 | {73ACC03E-6A3A-4C65-9AB8-9E6591D9E82C}.Release|Any CPU.ActiveCfg = Release|Any CPU 109 | {73ACC03E-6A3A-4C65-9AB8-9E6591D9E82C}.Release|Any CPU.Build.0 = Release|Any CPU 110 | {4BA983D6-558E-4126-A19C-B3C7234E5201}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 111 | {4BA983D6-558E-4126-A19C-B3C7234E5201}.Debug|Any CPU.Build.0 = Debug|Any CPU 112 | {4BA983D6-558E-4126-A19C-B3C7234E5201}.Release|Any CPU.ActiveCfg = Release|Any CPU 113 | {4BA983D6-558E-4126-A19C-B3C7234E5201}.Release|Any CPU.Build.0 = Release|Any CPU 114 | {D0CB568D-0C96-460F-A38A-5388546BB6D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 115 | {D0CB568D-0C96-460F-A38A-5388546BB6D6}.Debug|Any CPU.Build.0 = Debug|Any CPU 116 | {D0CB568D-0C96-460F-A38A-5388546BB6D6}.Release|Any CPU.ActiveCfg = Release|Any CPU 117 | {D0CB568D-0C96-460F-A38A-5388546BB6D6}.Release|Any CPU.Build.0 = Release|Any CPU 118 | {E8D42E35-199C-4179-B472-5049F7E3ABB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 119 | {E8D42E35-199C-4179-B472-5049F7E3ABB4}.Debug|Any CPU.Build.0 = Debug|Any CPU 120 | {E8D42E35-199C-4179-B472-5049F7E3ABB4}.Release|Any CPU.ActiveCfg = Release|Any CPU 121 | {E8D42E35-199C-4179-B472-5049F7E3ABB4}.Release|Any CPU.Build.0 = Release|Any CPU 122 | {C7577AF7-4F7F-4623-AEFA-86B441BE0CED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 123 | {C7577AF7-4F7F-4623-AEFA-86B441BE0CED}.Debug|Any CPU.Build.0 = Debug|Any CPU 124 | {C7577AF7-4F7F-4623-AEFA-86B441BE0CED}.Release|Any CPU.ActiveCfg = Release|Any CPU 125 | {C7577AF7-4F7F-4623-AEFA-86B441BE0CED}.Release|Any CPU.Build.0 = Release|Any CPU 126 | EndGlobalSection 127 | GlobalSection(SolutionProperties) = preSolution 128 | HideSolutionNode = FALSE 129 | EndGlobalSection 130 | GlobalSection(NestedProjects) = preSolution 131 | {07877B46-6459-4C7A-BB1F-9387CB551D37} = {FDFC3F19-16AD-4041-8ACA-D9104A5AF337} 132 | {A493370D-6385-43E0-8A67-A036BA7D8DDF} = {FDFC3F19-16AD-4041-8ACA-D9104A5AF337} 133 | {FDFC3F19-16AD-4041-8ACA-D9104A5AF337} = {2D7C2C2B-C0CE-44C4-AE8F-3F5C36A403C7} 134 | {B61AB9DA-80D9-4A2F-99B8-5D782A5B4836} = {2D7C2C2B-C0CE-44C4-AE8F-3F5C36A403C7} 135 | {6D7CBBAE-225E-4260-9719-67E1C4568756} = {B61AB9DA-80D9-4A2F-99B8-5D782A5B4836} 136 | {273B687E-0542-4C02-B262-B0A2C571485B} = {3BAD15D6-C22F-4557-B7FA-45E8A6032028} 137 | {3BAD15D6-C22F-4557-B7FA-45E8A6032028} = {E0796DB8-FC9F-4B05-88B8-F89329D23BC1} 138 | {4DEE3253-6921-4FB9-A21D-9F44787743A5} = {E0796DB8-FC9F-4B05-88B8-F89329D23BC1} 139 | {11F29CDE-DD0D-4521-B392-61CFD5431CFD} = {4DEE3253-6921-4FB9-A21D-9F44787743A5} 140 | {1615390E-77D9-4FFA-8159-B0794B400892} = {75C33BA1-63D9-40CF-BE62-B7511E8C7257} 141 | {FBC9E393-6746-4B03-AD48-6858FB604D2F} = {1615390E-77D9-4FFA-8159-B0794B400892} 142 | {A99D423F-C325-4BD6-BA7C-47E578D461D0} = {75C33BA1-63D9-40CF-BE62-B7511E8C7257} 143 | {BB06B10E-81B2-4208-982A-EC4825A951BE} = {A99D423F-C325-4BD6-BA7C-47E578D461D0} 144 | {33A855C0-4C4F-4058-98D4-E1356F8FB6E2} = {50B59049-97B0-42FC-91CD-B78C4734080A} 145 | {11FC4E55-8EF1-4BCD-BD0D-AEA5D9AF6FA0} = {33A855C0-4C4F-4058-98D4-E1356F8FB6E2} 146 | {73ACC03E-6A3A-4C65-9AB8-9E6591D9E82C} = {33A855C0-4C4F-4058-98D4-E1356F8FB6E2} 147 | {B33691D2-42B4-4CC8-8DE2-69B282FBB8BA} = {D0F29ED3-DD51-418E-B99E-E900EABA207F} 148 | {4BA983D6-558E-4126-A19C-B3C7234E5201} = {B33691D2-42B4-4CC8-8DE2-69B282FBB8BA} 149 | {6C2EC80F-1154-4F4F-8956-33EF08F29CE2} = {4B51E9AC-3B8B-4B2C-80D6-8AAD01A44ED1} 150 | {D0CB568D-0C96-460F-A38A-5388546BB6D6} = {6C2EC80F-1154-4F4F-8956-33EF08F29CE2} 151 | {A0715E31-0D59-42CC-8309-84EB51049864} = {15F290EA-5D0B-4A2C-A148-6B23F4F88787} 152 | {E8D42E35-199C-4179-B472-5049F7E3ABB4} = {A0715E31-0D59-42CC-8309-84EB51049864} 153 | {5DA9928C-972F-4FFA-84C7-211789288866} = {D0F29ED3-DD51-418E-B99E-E900EABA207F} 154 | {C7577AF7-4F7F-4623-AEFA-86B441BE0CED} = {5DA9928C-972F-4FFA-84C7-211789288866} 155 | EndGlobalSection 156 | GlobalSection(ExtensibilityGlobals) = postSolution 157 | SolutionGuid = {0C241B7F-CFD2-44DF-957C-40EB1847F368} 158 | EndGlobalSection 159 | EndGlobal 160 | --------------------------------------------------------------------------------