protected override async void OnLaunched(LaunchActivatedEventArgs args) { if (!args.PrelaunchActivated) { await ActivationService.ActivateAsync(args); } await Container.Resolve <IChecklists>().Initialize(); _sockets = Container.Resolve <ISockets>(); _storage = Container.Resolve <IStorage>(); if (_storage.Setting.GetSetting <bool>("LanBroadcastIsOn")) { await _sockets.Datagram.StartListener(); _sockets.Datagram.IncomingMessageReceived += (s, e) => { if (int.TryParse(e, out int parsedDefconStatus) && parsedDefconStatus > 0 && parsedDefconStatus < 6) { _storage.Setting.SetSetting("defconStatus", parsedDefconStatus.ToString(), StorageStrategies.Roaming); } }; } if (_storage.Setting.GetSetting <bool>("LanMulticastIsOn")) { await _sockets.Stream.StartListener(); } }
public DashboardViewModel(IWebSevices web, IRepository repo, IUserSettings user, IConnection connect, ILocation loc, ISockets sock, IFileSystem file) : base(loc, repo, sock) { webServices = web; repoService = repo; userService = user; connectService = connect; fileService = file; CurrentSearch = RefineSearch.CalendarMonth; }
public JourneysViewModel(IWebSevices web, IConnection connect, IRepository repo, IUserSettings user, ICultureInfo cult, ILocation loc, ISockets sock) : base(loc, repo, sock) { connectService = connect; webService = web; repoService = repo; userService = user; cultureInfo = cult; JourneyType = JourneyTypes.All; SortedJourneys = new ObservableCollection <JourneyDetails>(); Journeys = repoService.GetList <DBJourneyModel>(); }
public ExpensesViewModel(IConnection con, IUserSettings user, IWebSevices web, IExpenses exp, IRepository repo, ICultureInfo cult, ILocation loc, ISockets sock) : base(loc, repo, sock) { webService = web; settingsService = user; connectService = con; expenseService = exp; repoService = repo; cultureService = cult; ExportType = ExpenseTypes.SelectedPeriod; Journeys = repoService.GetList <DBJourneyModel>(); }
public BaseLocationViewModel(ILocation loc, IRepository repo, ISockets sock) { locService = loc; repoService = repo; Messenger.Default.Register <NotificationMessage <LocationServiceData> >(this, (message) => { // Gets the message object. var data = message.Content; // Checks the associated action. switch (message.Notification) { case "NewLocation": GetAndProcessNewLocation(); break; case "StartLocation": GetAndProcessLocation(true); break; case "EndLocation": GetAndProcessLocation(); break; default: break; } }); Messenger.Default.Register <NotificationMessage <IJourneyService> >(this, (message) => { var data = message.Content; switch (message.Notification) { case "JourneyEndedOK": break; case "JourneyEndedNR": break; case "JourneyEndedUK": break; } }); }
public SettingsPivotViewModel(ISockets sockets, ILiveTile liveTile, IStorage storage) { _sockets = sockets; _liveTile = liveTile; _storage = storage; Intervall = new List <string> { "15min", "30min", "1hour", "3hours", "6hours", "12hours", "daily" }; UseTransparentTile = _storage.Setting.GetSetting <bool>("UseTransparentTile"); ShowUncheckedItems = _storage.Setting.GetSetting <bool>("ShowUncheckedItems"); BackgroundTask = _storage.Setting.GetSetting <bool>("BackgroundTask"); LanBroadcastIsOn = _storage.Setting.GetSetting <bool>("LanBroadcastIsOn"); LanMulticastIsOn = _storage.Setting.GetSetting <bool>("LanMulticastIsOn"); BackgroundTask = _storage.Setting.GetSetting <bool>("BackgroundTask"); SelectedTimeIntervallIndex = _storage.Setting.GetSetting <int>("SelectedTimeIntervallIndex"); IotVisibility = AnalyticsInfo.VersionInfo.DeviceFamily.Equals("Windows.IoT") ? Visibility.Visible : Visibility.Collapsed; _defconStatus = int.Parse(_storage.Setting.GetSetting("defconStatus", "5", StorageStrategies.Roaming)); PropertyChanged += SettingsPivotViewModel_PropertyChanged; }
public MapsViewModel(ILocation loc, IRepository repo, ISockets sock, IWebSevices web, IUserSettings user) : base(loc, repo, sock) { webService = web; userService = user; repoService = repo; }
public NotificationsMapViewModel(ILocation loc, IRepository repo, ISockets sock) : base(loc, repo, sock) { }
public CommonJourneys(ILocation loc, IRepository repo, ISockets sock) : base(loc, repo, sock) { repoService = repo; }
static NetworkHandler() { socketService = DependencyService.Get <ISockets>(); audioHandler = DependencyService.Get <IAudioHandler>(); //new Audio.AudioHandler(); }
public ScoreHistoryViewModel(IConnection connect, IWebSevices web, IRepository repo, ILocation loc, ISockets sock) : base(loc, repo, sock) { webService = web; connectService = connect; repoService = repo; }