Esempio n. 1
0
 public void Initialize(Takeoff takeoff)
 {
     _takeoff             = takeoff;
     _quotesView          = new QuotesView(ref takeoff);
     _quotesView.Closing += _quotesView_Closing;
     _quotesView.Closed  += _quotesView_Closed;
 }
Esempio n. 2
0
        public void Initialize(_Worksheet worksheet)
        {
            var s = new Animation();

            s.Start(close =>
            {
                Task.Factory.StartNew(() =>
                {
                    try
                    {
                        _takeoff = new Takeoff();
                        _takeoff.Initialize(worksheet);
                        if (Application.Current == null)
                        {
                            new Application();
                        }
                        Application.Current.Dispatcher.Invoke(() =>
                        {
                            _productsView = new ProductsView(ref _takeoff);
                        });


                        close();
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(e.Message);
                    }
                });
            });

            _productsView.Closing += _productsView_Closing;
        }
 public static Menu <Takeoff, Takeoff> SelectTakeoffByIdMenu(Takeoff takeoff) => new SelectTakeoffByIdMenu(takeoff);
Esempio n. 4
0
 public ProductsViewModel(Takeoff takeoff)
 {
     Takeoff = takeoff;
     Initialize();
 }
Esempio n. 5
0
 public void Initialize(Takeoff takeoff)
 {
     _takeoff               = takeoff;
     _productsView          = new ProductsView(ref takeoff);
     _productsView.Closing += _productsView_Closing;
 }
Esempio n. 6
0
 // Метод, запускающий событие ВЗЛЕТ
 public void OnTakeoff(TakeoffEventArgs arg)
 {
     Console.WriteLine($"\n*********************Самолет\0{this.ModelAir}\0взлетает!!");
     Takeoff?.Invoke(this, arg);
 }
        // Determine the type of message and return an appropriate object
        // base on a variety of metrics
        public static Message createMessage(string text)
        {
            Message message = null;

            string commandType = getCommandType(text);

            if (text.StartsWith(Command.getKeyword()))
            {
                message = new Command(text);
            }
            else if (text.StartsWith(Status.getKeyword()))
            {
                message = new Status(text);
            }
            else if (text.StartsWith(Ok.getKeyword()))
            {
                message = new Ok(text);
            }
            else if (text.StartsWith(Error.getKeyword()))
            {
                message = new Error(text);
            }
            else if (text.StartsWith(BatteryQuery.getKeyword()))
            {
                message = new BatteryQuery(text);
            }
            else if (text.StartsWith(SpeedQuery.getKeyword()))
            {
                message = new SpeedQuery(text);
            }
            else if (text.StartsWith(TimeQuery.getKeyword()))
            {
                message = new TimeQuery(text);
            }
            else if (text.StartsWith(Curve.getKeyword()))
            {
                message = new Curve(text);
            }
            else if (text.StartsWith(Flip.getKeyword()))
            {
                message = new Flip(text);
            }
            else if (text.StartsWith(Go.getKeyword()))
            {
                message = new Go(text);
            }
            else if (text.StartsWith(Jump.getKeyword()))
            {
                message = new Jump(text);
            }
            else if (text.StartsWith(Land.getKeyword()))
            {
                message = new Land(text);
            }
            else if (text.StartsWith(Takeoff.getKeyword()))
            {
                message = new Takeoff(text);
            }
            else if (Rotate.getKeywords().Any(keyword => text.StartsWith(keyword)))
            {
                message = new Rotate(text);
            }
            else if (DirectionalMove.getKeywords().Any(keyword => text.StartsWith(keyword)))
            {
                message = new DirectionalMove(text);
            }
            else
            {
                message = new DataResponse(text);
            }

            return(message);
        }
Esempio n. 8
0
 public TakeoffDTO(Takeoff takeoff)
 {
     PlaneId         = takeoff.Plane.Id;
     Time            = takeoff.Time;
     RunwayStationId = takeoff.RunwayStation.Id;
 }
Esempio n. 9
0
 public QuotesView(ref Takeoff takeoff)
 {
     DataContext = new QuotesViewModel(takeoff);
     InitializeComponent();
 }
Esempio n. 10
0
 public ProductsView(ref Takeoff takeoff)
 {
     DataContext = new ProductsViewModel(takeoff);
     InitializeComponent();
 }
Esempio n. 11
0
 public QuotesViewModel(Takeoff takeoff)
 {
     this.takeoff = takeoff;
     GetAllQuotes();
 }