Пример #1
0
		protected override void OnStartup(StartupEventArgs e)
		{
			base.OnStartup(e);
			AppearanceManager.Current.FontSize = FontSize.Small;
			//AppearanceManager.Current.ThemeSource = New Uri("/IstarRealEstateWindows;component/Assets/ModernUI.Love.xaml", UriKind.Relative)
#if DEBUG
			Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
			GetSplash();
			Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
#else
			Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
			var context = new IstarContext();
			NewWindow = new NewWindow() { Title = "Авторизация", Topmost = true };
			NewWindow.Buttons = new[] { NewWindow.OkButton, NewWindow.CancelButton };
			NewWindow.OkButton.Content = "подтвердить";
			NewWindow.OkButton.Command = LoginViewModel.LoginCommand;
			NewWindow.Content = new LoginView();
			NewWindow.ShowDialog();
			if (NewWindow.DialogResult == false)
			{
				Process.GetCurrentProcess().Kill();
			}
			NewWindow.Close();
			GetSplash();
			context.Dispose();
			Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
#endif
		}
Пример #2
0
 public void F_DataBaseDeletingTest()
 {
     using (var dbcontext = new IstarContext())
     {
         if (dbcontext.Database.Exists())
 {
             dbcontext.Database.Delete();
         }
         Assert.IsTrue(!dbcontext.Database.Exists(), "Тест на удаление базы данных пройден.");
         dbcontext.Dispose();
     }
 }