public static async Task <AtomData> DeployFormationFromTree(IHubProxy HubProxy, DeployedFormation formation) { try { AtomData atom = await HubProxy.Invoke <AtomData>("DeployFormationFromTree", formation); return(atom); } catch (Exception ex) { } return(null); }
private async void cmdExit_Click(object sender, RoutedEventArgs e) { bool isCheckOk = await CheckOk(); if (isCheckOk == false) return; DrawPolygonEventArgs arg = new DrawPolygonEventArgs(); arg.isCancel = false; arg.isNew = true; arg.PolygonName = txtRouteName.Text.Trim(); arg.PolygonPnts = m_PolygonPnts.ToArray<DPoint>(); // isOK = true; if (EndDrawPolygonEvent != null) { EndDrawPolygonEvent(this, arg); } GeneralActivityDTO ActivityDTO = new GeneralActivityDTO(); ActivityDTO.ActivityType = enumActivity.MovementActivity; AtomData atomdata = new AtomData(); atomdata.UnitName = txPlatformName.Text; atomdata.Location = m_PolygonPnts[0]; ActivityDTO.StartActivityOffset = (TimeSpan)startActivity.Value; ActivityDTO.DurationActivity = (TimeSpan)durationActivity.Value; ActivityDTO.Speed = (int)speedUpDown.Value; Route route = new Route(); route.RouteName = txtRouteName.Text; route.Points = m_PolygonPnts; ActivityDTO.RouteActivity = route; if (refActivityDTO!=null) { atomdata.UnitGuid = refActivityDTO.Atom.UnitGuid; ActivityDTO.ActivityId = refActivityDTO.ActivityId; if (ActivityDTO.RouteActivity!=null) { ActivityDTO.RouteActivity.RouteGuid = refActivityDTO.RouteActivity.RouteGuid; } } ActivityDTO.Atom = atomdata; await SAGSignalR.SaveActivity(VMMainViewModel.Instance.SimulationHubProxy, ActivityDTO); this.Close(); }