static void Main(string[] args) { var viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); var mv = new MiniVan(); mv.TurboBoost(); Console.WriteLine("Done. Press Enter to terminate"); Console.ReadLine(); }
static void Main(string[] args) { // Make a sports car. SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); // Make a minivan. MiniVan mv = new MiniVan(); mv.TurboBoost(); Console.ReadLine(); }
private static void Main() { Console.Title = "Пример консольного клиента для сторонней библиотеки"; Console.ForegroundColor = ConsoleColor.Cyan; var sportCar = new SportCar("Audi", 210, 270); sportCar.TurboBoost(); var miniVan = new MiniVan(); miniVan.TurboBoost(); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("**** C# CarLibrary Client App****"); SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); MiniVan mv = new MiniVan(); mv.TurboBoost(); Console.WriteLine("Done. Press any key to terminate"); Console.Read(); }
static void Main(string[] args) { Console.WriteLine("***** c# CarLibrary Client App *****"); // Создать объект спортивного автомобиля. SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); // Создать объект минивэна. MiniVan mv = new MiniVan(); mv.TurboBoost(); Console.WriteLine("Done. Press any key to terminate"); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("**** C# CarLibrary Client App ****"); SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); MiniVan van = new MiniVan("Transporter", 150, 50); van.TurboBoost(); Console.WriteLine("Done. To terminate press any key"); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("***** C# CarLibrary Client App *****"); // Создание объекта спортивной машины. SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); // Создание объекта минивена. MiniVan mv = new MiniVan(); mv.TurboBoost(); Console.WriteLine("Done. Press any key to terminate"); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("***** C# CarLibrary Client App *****"); // Make a sports car. SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); // Make a minivan. MiniVan mv = new MiniVan(); mv.TurboBoost(); Console.ReadLine(); }
static void UseClass() { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("=> use custom class"); SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); MiniVan van = new MiniVan(); van.TurboBoost(); Console.WriteLine("Done"); }
static void Main(string[] args) { Console.WriteLine("***** Car Client *****"); // Make a sports car. SportsCar sport = new SportsCar("Viper", 240, 40); sport.TurboBoost(); // Make a minivan. MiniVan mini = new MiniVan(); mini.TurboBoost(); Console.WriteLine("Done. Press any key to terminate"); Console.ReadLine(); }
public static int Main(string[] args) { // Make a sports car. SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); // Make a minivan. MiniVan mv = new MiniVan(); mv.TurboBoost(); mv.TurnOnRadio(true, MusicMedia.musicCD); return(0); }
static void Main(string[] args) { SportsCar sc1 = new SportsCar("ZL", 100, 20); MiniVan mv1 = new MiniVan { PetName = "XY", MaxSpeed = 100, CurrentSpeed = 10 }; Console.WriteLine(sc1.ToString()); Console.WriteLine(mv1.ToString()); sc1.TurboBoost(); mv1.TurboBoost(); Console.ReadLine(); }
static void Main() { Console.WriteLine("***** C# Car Library Client App"); // Make a sports car. SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); // Make a minivan. MiniVan mv = new MiniVan(); mv.TurboBoost(); Console.WriteLine("Done. Press any key to terminate"); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("**** Car Client Using ClassLibrary ****"); // Make a sports car. SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); // Make a minivan MiniVan mv = new MiniVan(); mv.TurboBoost(); Console.WriteLine("Done. Press any key to terminate"); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("***** C# CarLibrary Client App *****"); // Make a sports car. SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); // Make a minivan. MiniVan mv = new MiniVan(); mv.TurboBoost(); Console.WriteLine("Done. Press any key to terminate"); Console.ReadLine(); var internalClassInstance = new MyInternalClass(); }
static void Main(string[] args) { Console.WriteLine("***** Fun with C# *****"); // Make a sports car. SportsCar viper = new SportsCar("Viper", 240, 40); viper.TurboBoost(); // Make a mini van. MiniVan mv = new MiniVan(); mv.TurboBoost(); // Make a performance car. PerformanceCar dreamCar = new PerformanceCar(); // Inherited property. dreamCar.PetName = "Hank"; dreamCar.TurboBoost(); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("**** * C# CarLibrary Client App *****"); // Создать объект SportsCar. SportCar viper = new SportCar("Viper", 240, 40); //Type type = viper.GetType(); //Type type = typeof(SportCar); Type type = Type.GetType("CarLibrary.SportCar, CarLibrary", false, true); Console.WriteLine(type); Console.ReadLine(); viper.TurboBoost(); // Создать объект MiniVan. MiniVan miniVan = new MiniVan(); miniVan.TurboBoost(); Console.WriteLine("Done . Press any key to terminate"); Console.ReadKey(); }
static int Main(string[] args) { // build and consume Custom Class Library, P573 { SportsCar sc1 = new SportsCar { PetName = "ZL", MaxSpeed = 200, CurrentSpeed = 10 }; MiniVan mv1 = new MiniVan { PetName = "XY", MaxSpeed = 100, CurrentSpeed = 20 }; sc1.TurboBoost(); mv1.TurboBoost(); System.Console.WriteLine(sc1.ToString()); System.Console.WriteLine(mv1.ToString()); Console.ReadLine(); // see Project folder "custom_namespace01" // see project folder "custom_namespace02" } // configure private assemblies, P586 { /* * + note in "*.config" file + - <probing> element simply instructs the CLR to investigate all specified subdirectories for the requested assembly until the first match is encountered; + - <probing privatePath="subdir_libraries_folder_name"> attribute can NOT be used to specify an absolute or relative path! + - using <codeBase> element to do it instead; + + note about the name of "*.config" files + - file names MUST be prefixed with the same name as the related client application; + + ```c# + + <probing privatePath="MyLibraries;MyLibraries\Tests"/> + + ``` + */ // see Project folder "MyCSharpCarApp" // see Project folder "MyVBCarApp" // see Project folder "MyApp" } // configure shared assemblies, P589 { /* * + when to use + - building libraries to be widely used over lots of projects + + how to configure + - assign SNK to your assembly(*.dll); + >> command-line named "developer command prompt" + >> using VS + - add your libraries(*.dll) to GAC(folder name: assembly); + >> using command-line tool named "gacutil.exe" to install */ } { } return(0); }