Ejemplo n.º 1
0
        public async void SetNewVenturiData(DateTime birthday, ValueClass value)
        {
            CalculateEvent?.Invoke(this, new NewVentEventArgs($"Аппарат расcчитан"));
            CurrentVenturi.BirthayDate = birthday;
            CurrentVenturi.Value       = value;
            ModelSolid model = new ModelSolid(CurrentVenturi);

            model.CreatePart();
            await Task.Run(() => Save());
        }
Ejemplo n.º 2
0
 protected virtual void TrackCalcDoneEvent(TracksEventArgs e)
 {
     CalculateEvent?.Invoke(this, e);
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            //Array copy
            //copyArraySample();

            //Jagged array
            //jaggedArraySample();

            //ArrayList
            //arrayListSample();

            //HashTable
            //hashTableSample();

            //Generic
            //genericCollectionSample();

            //Function with dynamic parameters
            //int sum = dynamicParamsSample(10,20,30);
            //Console.WriteLine($"Sum={sum}");


            //Decimal formatting
            //decimalFormatSample();

            //Struct
            //BookStruct book1;
            //book1.Name = "C# is amazing!!";
            //book1.Price = 100;
            //BookStruct book2 = book1;
            //book1.Name = "Angular is amazing!!";
            //book1.Price = 200;

            //Console.WriteLine($"{book1.Name} : {book1.Price}");
            //Console.WriteLine($"{book2.Name} : {book2.Price}");

            //Static property
            //StaticBook js = new StaticBook() { Name = "JS" };
            //Console.WriteLine($"{js.ToString()}");
            //StaticBook cSharp = new StaticBook() { Name = "C#" };
            //Console.WriteLine($"{cSharp.ToString()}");
            //StaticBook angular = new StaticBook() { Name = "Angular" };
            //Console.WriteLine($"{angular.ToString()}");

            //Delegate
            //CalculateDelegate calculate = Calculator.Add;
            //calculate += Calculator.Minus;
            //calculate += Calculator.Divide;
            //calculate += Calculator.Multiplicate;

            //var result = calculate(5, 6);
            //Console.WriteLine($"{result}");


            //Event
            CalculateEvent += Calculator.Add;
            //calculate += Calculator.Minus;
            //calculate += Calculator.Divide;
            //calculate += Calculator.Multiplicate;

            var result = CalculateEvent?.Invoke(5, 6);

            Console.WriteLine($"{result}");



            //C# 7.0 : Nested function
            //Console.WriteLine(getTitle("JB", "Lin"));
            //string getTitle(string firstName, string lastName) => $"{lastName} {firstName}";

            //C# 7.0 : Out variable
            //getTitleByOut(out string myTitle);
            //Console.WriteLine($"Title = {myTitle}");

            //C# 7.0 : Ref returns
            //string[] names = new string[] { "JB", "Lin", string.Empty };
            //string msg = "Hello! ";
            //ref string data = ref new Program().getNameByRef(names, msg);
            //Console.WriteLine($"{msg}, {names[2]}");
            //Console.WriteLine($"{data}");



            Console.ReadKey();
        }