コード例 #1
0
        void GoButton_Click(object sender, RoutedEventArgs _e)
        {
            var destination = (CelestialObject)DestinationBox.SelectedItem;

            if (destination == null)
            {
                MessageBox.Show("No destination selected");
                return;
            }
            var service = new PlanetWarsServiceClient();

            service.OrderFleetCompleted += (s, e) =>
            {
                transit.Fleets = e.Result;
                MessageBox.Show("Set sail!");
            };
            service.OrderFleetAsync(App.UserName, App.Password, transit.Fleets.FleetID, destination.CelestialObjectID, 0); // todo offset future?
        }
コード例 #2
0
        void mapTab_MouseLeftButtonDown(object sender, MouseButtonEventArgs _)
        {
            mapTab.MapCanvas.MouseLeftButtonDown     -= mapTab_MouseLeftButtonDown;
            Application.Current.RootVisual.MouseMove -= mapTab_MouseMove;
            cursorPosition = null;
            if (cursorPlanet == null)
            {
                return;
            }
            var destination = cursorPlanet;

            cursorPlanet = null;
            var service = new PlanetWarsServiceClient();

            service.OrderFleetCompleted += (s, e) =>
            {
                transit.Fleets = e.Result;
                MessageBox.Show(cursorPlanet.Name + " called, they want their transit back!");
            };
            service.OrderFleetAsync(App.UserName, App.Password, transit.Fleets.FleetID, destination.Body.CelestialObjectID, 0);
        }
コード例 #3
0
 void mapTab_MouseLeftButtonDown(object sender, MouseButtonEventArgs _)
 {
     mapTab.MapCanvas.MouseLeftButtonDown -= mapTab_MouseLeftButtonDown;
     Application.Current.RootVisual.MouseMove -= mapTab_MouseMove;
     cursorPosition = null;
     if (cursorPlanet == null) return;
     var destination = cursorPlanet;
     cursorPlanet = null;
     var service = new PlanetWarsServiceClient();
     service.OrderFleetCompleted += (s, e) =>
         {
             transit.Fleets = e.Result;
             MessageBox.Show(cursorPlanet.Name + " called, they want their transit back!");
         };
     service.OrderFleetAsync(App.UserName, App.Password, transit.Fleets.FleetID, destination.Body.CelestialObjectID, 0);
 }
コード例 #4
0
 void GoButton_Click(object sender, RoutedEventArgs _e)
 {
     var destination = (CelestialObject)DestinationBox.SelectedItem;
     if (destination == null)
     {
         MessageBox.Show("No destination selected");
         return;
     }
     var service = new PlanetWarsServiceClient();
     service.OrderFleetCompleted += (s, e) =>
         {
             transit.Fleets = e.Result;
             MessageBox.Show("Set sail!");
         };
     service.OrderFleetAsync(App.UserName, App.Password, transit.Fleets.FleetID, destination.CelestialObjectID, 0); // todo offset future?
 }