Пример #1
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            if (!e.PrelaunchActivated)
            {
                await ActivationService.ActivateAsync(e);
            }
            string DataPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path;

            ApplicationLogging.LoggerFactory.AddCgmLog(DataPath);

            ApplicationLogging.LoggerFactory.AddEventAggregatorLog();

            using (CgmUnitOfWork uow = new CgmUnitOfWork())
            {
                uow.CheckDatabaseVersion(DataPath);
                uow.Setting.CheckSettings();
            }
            //check for nightscout settings
        }
Пример #2
0
        private async Task GetSession()
        {
            //with this, the log is coming in the output window when we debug.
            Log.ApplicationLogging.LoggerFactory.AddOutputLogger();

            //find the device
            var device = BayerUsbDevice.FindMeter();

            //getting a cancellation token for the tasks
            var _tokenSource = new CancellationTokenSource();
            var _token       = _tokenSource.Token;

            //unit of work to get information
            using (CgmUnitOfWork uow = new CgmUnitOfWork())
            {
                //Check sqlite database version, should be done at the begin of every run to make sure database is aval and correct version.
                uow.CheckDatabaseVersion(AppContext.BaseDirectory);

                //Getting info from pump. The session class contain all info necessary for communicating with the pump and all the results.
                Common.Serialize.SerializerSession session = await uow.Pump.GetPumpSessionAsync(device, _token);
            }
        }