static void Main(string[] args)
        {
            _log = LogManager.GetLogger(typeof(Program));
            AppDomain.CurrentDomain.UnhandledException += LogUnhandledException;
            var deployStatusService      = new DeployStatusService();
            var emailNotificationService = new EmailNotificationService();

            if (args.Length > 0 && args[0] == "/c")
            {
                deployStatusService.Start();
                emailNotificationService.Start();
                Console.WriteLine("Service started, press any key to stop.");
                Console.ReadKey();
                deployStatusService.Stop();
                emailNotificationService.Stop();
            }
            else
            {
                ServiceBase.Run(new ServiceRunner(deployStatusService, emailNotificationService));
            }
        }
Exemple #2
0
        public override async void OnStart(StartKind startKind, IActivatedEventArgs args)
        {
            NavigationService.Frame.ContentTransitions = new TransitionCollection()
            {
                new NavigationThemeTransition()
                {
                    DefaultNavigationTransitionInfo = new DrillInNavigationTransitionInfo()
                }
            };


            //Копирование БД
            string        dbName         = "TestStand.sqlite";
            StorageFolder localAppFolder = ApplicationData.Current.LocalFolder;

            if (await ApplicationData.Current.LocalFolder.TryGetItemAsync(dbName) == null)
            {
                StorageFile dbFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(dbName);

                StorageFile copiedFile = await dbFile.CopyAsync(localAppFolder);
            }

            if (string.IsNullOrEmpty(Settings.Token))
            {
                await LoginAsync();

                if (string.IsNullOrEmpty(Settings.Token))
                {
                    Exit();
                    return;
                }
            }

            EmailNotificationService.Start();

            NavigationService.Navigate(typeof(MainView));
        }