본문 바로가기

C#39

08# Adapter 패턴 Structural Patterns static void Main(string[] args) { //BuilderExample(); //FactoryExample(); //FactoryMethodExample(); //FactoryMethodExample2(); //ProtoTypeExample(); //SingletonExample(); AdapterExample(); //Console.WriteLine("Hello World!"); Console.ReadKey(); } static void AdapterExample() { Compound unknown = new Compound(Compound.CompoundTypes.NONE); Compound water = new RichCompound(Compound.CompoundTypes.W.. 2019. 5. 29.
07# Singleton 패턴(thread safe) Creational Patterns static void Main(string[] args) { //BuilderExample(); //FactoryExample(); //FactoryMethodExample(); //FactoryMethodExample2(); //ProtoTypeExample(); SingletonExample(); //Console.WriteLine("Hello World!"); Console.ReadKey(); } static void SingletonExample() { LazySingleton.IsValueCreated(); Console.WriteLine("Name : {0} Age : {1}", LazySingleton.Instance.Name, LazySingleton.Instance.Age); LazySi.. 2019. 5. 24.
06# Prototype 패턴 Creational Patterns static void Main(string[] args) { //BuilderExample(); //FactoryExample(); //FactoryMethodExample(); //FactoryMethodExample2(); ProtoTypeExample(); //Console.WriteLine("Hello World!"); Console.ReadKey(); } static void ProtoTypeExample() { ColorManager colorManager = new ColorManager(); colorManager["red"] = new Color(255, 0, 0); colorManager["green"] = new Color(0, 255, 0); colorManager["blue"] =.. 2019. 5. 23.
21# C# Mysql Connection 라이브러리 using System; using System.Collections.Generic; using System.Data; using System.Reflection; using MySql.Data.MySqlClient; using System.Runtime.CompilerServices; namespace Project.MySql { /// /// MySqlManager의 요약 설명입니다. /// public static class MySqlManager { public static Int32 ExecuteScalar(string connectionString, string procedureName, Dictionary paramsList) { Int32 resultCode = (Int32)ErrorNum.. 2019. 5. 23.