public RuntimeDbChooserWindowsFormsApplication() { InitializeComponent(); ((SecurityStrategyComplex)Security).Authentication = new AuthenticationStandard <SecuritySystemUser, CustomLogonParametersForStandardAuthentication>(); //((SecurityStrategyComplex)Security).Authentication = new ChangeDatabaseActiveDirectoryAuthentication(); SplashScreen = new DXSplashScreen(typeof(XafSplashScreen), new DefaultOverlayFormOptions()); }
void OnShellLoaded(object sender, RoutedEventArgs e) { DXSplashScreen.Close(); Activate(); OpenClosedPanels(); }
public static void Show(CultureInfo culture) { if (_splashScreen != null) { throw new DeveloperException("Пердыдущий SplashScreen не был закрыт."); } _splashScreen = null; DXSplashScreen.Show(cu => { _splashScreen = new SplashScreenView((CultureInfo)cu); try { SplashScreenHandle = _splashScreen == null ? (IntPtr?)null : new WindowInteropHelper(_splashScreen).EnsureHandle(); } catch { SplashScreenHandle = null; } return(_splashScreen); }, null, culture, null); }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } }
protected override void OnStartup(StartupEventArgs e) { LogTo.Information("Starting the application..."); DXSplashScreen.Show(o => AboutView.AsSplashScreen(), null, null, null); base.OnStartup(e); LogTo.Information("Application startup finished."); }
public void ShowUserControlAndCheckWindowProperties_Test() { DXSplashScreen.Show <SplashScreenTestUserControl>(); SplashScreenTestUserControl.DoEvents(); Window wnd = SplashScreenTestUserControl.Window; AutoResetEvent SyncEvent = new AutoResetEvent(false); bool hasError = true; wnd.Dispatcher.BeginInvoke(new Action(() => { hasError = false; hasError = hasError | !(WindowStartupLocation.CenterScreen == wnd.WindowStartupLocation); hasError = hasError | !(true == WindowFadeAnimationBehavior.GetEnableAnimation(wnd)); hasError = hasError | !(null == wnd.Style); hasError = hasError | !(WindowStyle.None == wnd.WindowStyle); hasError = hasError | !(ResizeMode.NoResize == wnd.ResizeMode); hasError = hasError | !(true == wnd.AllowsTransparency); hasError = hasError | !(Colors.Transparent == ((SolidColorBrush)wnd.Background).Color); hasError = hasError | !(false == wnd.ShowInTaskbar); hasError = hasError | !(true == wnd.Topmost); hasError = hasError | !(SizeToContent.WidthAndHeight == wnd.SizeToContent); SyncEvent.Set(); })); SyncEvent.WaitOne(TimeSpan.FromSeconds(2)); Assert.IsFalse(hasError); CloseDXSplashScreen(); }
public void ShowSplashScreen() { if (!DXSplashScreen.IsActive) { DXSplashScreen.Show <SplashWindow>(); } }
private void InitializeDefaults() { LinkNewObjectToParentImmediately = false; OptimizedControllersCreation = true; UseLightStyle = true; SplashScreen = new DXSplashScreen(typeof(XafSplashScreen), new DefaultOverlayFormOptions()); ExecuteStartupLogicBeforeClosingLogonWindow = true; //TOUCH int maxLogonAttemptCount = 3; try { string queryString = "SELECT TOP 1 MaxLogonAttemptCount FROM SecurityConfig"; using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString)) { connection.Open(); SqlCommand command = new SqlCommand(queryString, connection); using (SqlDataReader reader = command.ExecuteReader()) { if (reader.Read()) { maxLogonAttemptCount = reader.GetInt32(0); } } } }catch (Exception ignoreException) {} MaxLogonAttemptCount = maxLogonAttemptCount; }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { var mainWindow = sender as MainWindow; mainWindow.TableViewROIDocuments.RowDoubleClick += TableViewROIDocuments_RowDoubleClick; if (!(mainWindow.DataContext is MainWindowViewModel mainWindowViewModel)) { return; } var gridpath = Path.Combine(mainWindowViewModel.DataDirectory, "AppSettings", "MainGrid.xml"); if (File.Exists(gridpath)) { mainWindow.GridControlROIDocuments.RestoreLayoutFromXml(gridpath); } else { mainWindow.TableViewROIDocuments.BestFitColumns(); } if (mainWindowViewModel.RoiDocViewModelList.Count > 0) { mainWindow.GridControlROIDocuments.SelectItem(0); mainWindow.TableViewROIDocuments.FocusedRowHandle = 0; } DXSplashScreen.Close(); }
private void CheckVersion() { Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; if (this.ShowCheckVersionWindow()) { Process process = new Process(); string fullFileName = this._versionVM.CheckVersionResponse.InstallerLocation; ProcessStartInfo psi = new ProcessStartInfo { FileName = "msiexec", Arguments = string.Format(" /i \"{0}\"", fullFileName), UseShellExecute = false, }; process.StartInfo = psi; process.Start(); Current.ShutdownMode = ShutdownMode.OnMainWindowClose; Current.Shutdown(0); //this.Shutdown(); } else { if (!DXSplashScreen.IsActive) { DXSplashScreen.Show <ManufacturingInventory.ManufacturingApplication.SETSplashScreen>(); } Current.ShutdownMode = ShutdownMode.OnMainWindowClose; } }
protected override void OnStartup(StartupEventArgs e) { //Configure theme manager DXSplashScreen.Show <SETSplashScreen>(); ApplicationThemeHelper.UpdateApplicationThemeName(); ThemeManager.ApplicationThemeChanged += this.ThemeManager_ApplicationThemeChanged; GridControl.AllowInfiniteGridSize = true; //DomainManager domainManager = new DomainManager(); //UserServiceProvider userServiceProvider = new UserServiceProvider(new InventoryContext(), domainManager); //LogInService logInService = new LogInService(domainManager, userServiceProvider); //var responce = logInService.LogInWithPassword("AElmendo", "Drizzle123!", false, InventorySoftwareType.PRODUCTS_SALES); //this.userService = responce.Service; Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; if (this.ShowLogin()) { Current.ShutdownMode = ShutdownMode.OnMainWindowClose; } else { Current.ShutdownMode = ShutdownMode.OnMainWindowClose; this.Shutdown(); } base.OnStartup(e); }
/// <summary> /// Called when the applications starts. Makes a distinction between debug and release mode /// </summary> /// <param name="e"> /// the event argument /// </param> protected override void OnStartup(StartupEventArgs e) { // Set the Theme of the application ThemeManager.ApplicationThemeName = Theme.SevenName; AppliedTheme.ThemeName = Theme.SevenName; base.OnStartup(e); this.ShutdownMode = ShutdownMode.OnExplicitShutdown; if (UpdateInstaller.CheckInstallAndVerifyIfTheImeShallShutdown()) { Current.Shutdown(); return; } DXSplashScreen.Show <Views.SplashScreenView>(); DXSplashScreen.SetState("Starting COMET"); #if (DEBUG) RunInDebugMode(); #else RunInReleaseMode(); #endif this.ShutdownMode = ShutdownMode.OnMainWindowClose; DXSplashScreen.SetState("Preparing Main Window"); Current.MainWindow.Show(); DXSplashScreen.Close(); }
static void Main(string[] args) { try { PresentationTraceSources.Refresh(); PresentationTraceSources.DataBindingSource.Listeners.Add(new DefaultTraceListener()); PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Warning | SourceLevels.Error; ThemeManager.ApplicationThemeName = Theme.VS2010Name; // bool bdownload = DataUtils.ActivityUtils.DownLoadActivity(Loadprocess); DXSplashScreen.Show <SplashScreen_AMTS>(); //DXSplashScreen.Progress(10); DXSplashScreen.SetState("Start Loding..."); DataUtils.StaticInfo.ExecutePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); DataUtils.StaticInfo.LoginUser = "******"; DataUtils.StaticInfo.LocalModel = ConfigurationManager.AppSettings["LocalModel"] == null ? "" : ConfigurationManager.AppSettings["LocalModel"].ToUpper(); DataUtils.StaticInfo.AutoConnect = ConfigurationManager.AppSettings["AutoConnect"] == null ? "" : ConfigurationManager.AppSettings["AutoConnect"].ToUpper(); DataUtils.StaticInfo.ProcessName = ConfigurationManager.AppSettings["ProcessName"] == null ? "" : ConfigurationManager.AppSettings["ProcessName"].ToUpper(); DataUtils.StaticInfo.AutoLoadStateBySN = ConfigurationManager.AppSettings["AutoLoadStateBySN"] == null ? "" : ConfigurationManager.AppSettings["AutoLoadStateBySN"].ToUpper(); DataUtils.StaticInfo.AutoLoadStateFile = ConfigurationManager.AppSettings["AutoLoadStateFile"] == null ? "" : ConfigurationManager.AppSettings["AutoLoadStateFile"].ToUpper(); DataUtils.StaticInfo.ATEKind = ConfigurationManager.AppSettings["ATEKind"] == null ? "" : ConfigurationManager.AppSettings["ATEKind"].ToUpper(); DataUtils.StaticInfo.ATEStatusFile = ConfigurationManager.AppSettings["ATEStatusFile"] == null ? "" : ConfigurationManager.AppSettings["ATEStatusFile"].ToUpper(); DataUtils.StaticInfo.MesMode = ConfigurationManager.AppSettings["MesMode"] == null ? "" : ConfigurationManager.AppSettings["MesMode"].ToUpper(); DataUtils.StaticInfo.ResultString = ConfigurationManager.AppSettings["ResultListerner"] == null ? "" : ConfigurationManager.AppSettings["ResultListerner"].ToUpper().Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "").Trim(); AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ApplicationUtils.CurrentDomain_AssemblyResolve); DXSplashScreen.SetState("Loading The ApplicationTheme"); DXSplashScreen.SetState("Check File Revisions..."); DXSplashScreen.Progress(Loadprocess = 5); DXSplashScreen.SetState("Loading Application Instance"); //string url = System.Reflection.Assembly.GetExecutingAssembly().Location + ";component/App.xaml"; //string uri = ""; //string param = ""; //if (GetAssemblyInstanse(url, ref uri, ref param) == null) { throw new Exception("GetAssemblyInstanse is NULL!"); }; //(System.Windows.Application)System.Windows.Application.LoadComponent(new System.Uri(uri, System.UriKind.Relative)); System.Windows.Application app = new System.Windows.Application(); app.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(app_DispatcherUnhandledException); DXSplashScreen.SetState("Loading Main FrameWork"); DXSplashScreen.Progress(Loadprocess = 70); System.Windows.Window MainWindow = new MainWindow(); DXSplashScreen.SetState("Run MainWindow"); DXSplashScreen.Progress(Loadprocess = 90); app.Run(MainWindow); } catch (Exception ex) { LOG.WriteLog(ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source); if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } ApplicationUtils.SaveException(ex); System.Windows.MessageBox.Show(ex.Message); if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } } }
private void CvtGenerationExecute() { if (CurrentExternalContour.Count == 0) { DXMessageBox.Show("Please, load a structure, and generate a contour, first!"); return; } var voronoiSettings = SettingsDataService.VoronoiSettings; DXSplashScreen.Show <SplashScreenView1>(); DXSplashScreen.SetState("Calculating centroidal voronoi tessellations..."); var cvtSettings = new CvtSettings { NumberOfGenerators = voronoiSettings.NumberOfGenerators, NumberOfSamplingPoints = voronoiSettings.NumberOfSamplingPoints, SelectedSamplingMethod = voronoiSettings.SelectedSamplingMethod, MaxNumberOfIterations = 90, }; Cvt cvt = new Cvt(CurrentExternalContour, cvtSettings); var generators = cvt.GetGenerators(); EventAggregator.GetEvent <GeneratorsUpdatedEvent>().Publish(new GeneratorsUpdatedEventArg(generators)); Trace.WriteLine(generators); DXSplashScreen.Close(); }
protected override void OnStartup(StartupEventArgs e) { DXSplashScreen.Show <SplashScreen>(); CheckIsAdmin(); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; this.DispatcherUnhandledException += Current_DispatcherUnhandledException; TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN"); base.OnStartup(e); this.Exit += App_Exit; _pluginManager = new PluginManager(); _pluginManager.Init(); var main = new MainWindow(); Set(main, "Width"); Set(main, "Height"); Set(main, "Top"); Set(main, "Left"); main.Topmost = true; main.Show(); DXSplashScreen.Close(); }
private void LoadedHandler() { if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } }
private void NewStructureSelected(StructureSelectedEventArg structureSelectedEventArg) { var structure = structureSelectedEventArg.Structure; if (structure == null) { return; } try { DXSplashScreen.Show <SplashScreenView1>(); DXSplashScreen.SetState("Calculating the maximun external contour..."); //1. Get the maximum external contour of the structure, available from all contours. //2. Plot the points on 2D. var contours = structure.Contours; var maxExternalContour = GeometryHelper.GetOuterContour(contours, 1000); this.CurrentExternalContour = maxExternalContour; EventAggregator.GetEvent <ExternalContourUpdatedEvent>() .Publish(new ExternalContourUpdatedEventArg(maxExternalContour)); } catch (Exception e) { Trace.WriteLine(e); throw; } finally { DXSplashScreen.Close(); } }
private bool ShowLogin() { //Startup Login LoginWindow loginWindow = new LoginWindow(); DomainManager domainManager = new DomainManager(); ManufacturingContext context = new ManufacturingContext(this.optionsBuilder.Options); IUserSettingsService userSettingsService = new UserSettingsService(this._logger, context); IAuthenticationUseCase auth = new AuthenticationService(context, domainManager, this._logger, userSettingsService); var loginVM = new LoginViewModel(auth, userSettingsService); loginVM.LoginCompleted += (sender, args) => { if (loginVM.LoginResponce.Success) { this.userService = loginVM.LoginResponce.Service; DXSplashScreen.Show <SETSplashScreen>(); } loginWindow.Close(); }; loginWindow.DataContext = loginVM; if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } loginWindow.ShowDialog(); return(this.userService.IsValid()); }
private bool ShowCheckVersionWindow() { CheckVersion versionChecker = new CheckVersion(); var response = versionChecker.Check(); if (response.NewVersionAvailable) { CheckVersionWindow versionWindow = new CheckVersionWindow(); this._versionVM = new CheckVersionViewModel(response); this._versionVM.CheckCompleted += (sender, args) => { versionWindow.Close(); }; versionWindow.DataContext = this._versionVM; if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } versionWindow.ShowDialog(); return(this._versionVM.Update); } else { return(false); } }
private bool ShowLogin() { //Startup Login LoginWindow loginWindow = new LoginWindow(); DomainManager domainManager = new DomainManager(); UserServiceProvider userServiceProvider = new UserServiceProvider(new InventoryContext(), domainManager); LogInService logInService = new LogInService(domainManager, userServiceProvider); var loginVM = new LoginViewModel(logInService); loginVM.LoginCompleted += (sender, args) => { if (loginVM.LoginResponce.Success) { this.userService = loginVM.LoginResponce.Service; DXSplashScreen.Show <SETSplashScreen>(); } loginWindow.Close(); }; loginWindow.DataContext = loginVM; if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } loginWindow.ShowDialog(); return(this.userService.IsValid()); }
private void CalIMD() { DXSplashScreen.Show <Cal_DXSplashScreen>(); DXSplashScreen.Progress(0); TestPlanVM vm = (new ViewModelLocator()).CurrentTestPlanVm; if (!GeneTestSetup.Instance.IsSimulated) { foreach (var conn in ManualConnList) { //foreach (var step in conn.TestStepList) //{ // if (step.IsTest) // { // (step.TestStep as IMDTestStep).CalIMDPower(); // } //} } Interface.SaveAllLocalSettings(vm); } DXSplashScreen.Progress(1); if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } }
public void ShowWindowISplashScreen() { ISplashScreenService service = new DXSplashScreenService() { SplashScreenType = typeof(SplashScreenTestWindow), }; service.ShowSplashScreen(); SplashScreenTestWindow.DoEvents(); Assert.IsTrue(SplashScreenTestWindow.Instance.IsIndeterminate); Assert.AreEqual(double.NaN, SplashScreenTestWindow.Instance.Progress); service.SetSplashScreenProgress(100, 100); SplashScreenTestWindow.DoEvents(); Assert.IsFalse(SplashScreenTestWindow.Instance.IsIndeterminate); Assert.AreEqual(100, SplashScreenTestWindow.Instance.Progress); service.SetSplashScreenProgress(100, 200); SplashScreenTestWindow.DoEvents(); Assert.IsFalse(SplashScreenTestWindow.Instance.IsIndeterminate); Assert.AreEqual(100, SplashScreenTestWindow.Instance.Progress); DXSplashScreen.CallSplashScreenMethod <SplashScreenTestWindow>(x => x.Text("test")); SplashScreenTestWindow.DoEvents(); Assert.IsFalse(SplashScreenTestWindow.Instance.IsIndeterminate); Assert.AreEqual(100, SplashScreenTestWindow.Instance.Progress); Assert.AreEqual("test", ((SplashScreenTestWindow)SplashScreenTestWindow.Instance).TextProp); DXSplashScreen.SetState("test"); service.SetSplashScreenState("test"); SplashScreenTestWindow.DoEvents(); service.HideSplashScreen(); }
public void HideSplashScreen() { if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } }
public void ShowUserControl_Test() { DXSplashScreen.Show <SplashScreenTestUserControl>(); SplashScreenTestUserControl.DoEvents(); Assert.AreEqual(0, SplashScreenTestUserControl.ViewModel.Progress); Assert.AreEqual(100, SplashScreenTestUserControl.ViewModel.MaxProgress); Assert.AreEqual("Loading...", SplashScreenTestUserControl.ViewModel.State); Assert.AreEqual(true, SplashScreenTestUserControl.ViewModel.IsIndeterminate); DXSplashScreen.Progress(50); SplashScreenTestUserControl.DoEvents(); Assert.AreEqual(50, SplashScreenTestUserControl.ViewModel.Progress); Assert.AreEqual(100, SplashScreenTestUserControl.ViewModel.MaxProgress); Assert.AreEqual("Loading...", SplashScreenTestUserControl.ViewModel.State); Assert.AreEqual(false, SplashScreenTestUserControl.ViewModel.IsIndeterminate); DXSplashScreen.Progress(100, 200); SplashScreenTestUserControl.DoEvents(); Assert.AreEqual(100, SplashScreenTestUserControl.ViewModel.Progress); Assert.AreEqual(200, SplashScreenTestUserControl.ViewModel.MaxProgress); Assert.AreEqual("Loading...", SplashScreenTestUserControl.ViewModel.State); Assert.AreEqual(false, SplashScreenTestUserControl.ViewModel.IsIndeterminate); DXSplashScreen.SetState("Test"); SplashScreenTestUserControl.DoEvents(); Assert.AreEqual(100, SplashScreenTestUserControl.ViewModel.Progress); Assert.AreEqual(200, SplashScreenTestUserControl.ViewModel.MaxProgress); Assert.AreEqual("Test", SplashScreenTestUserControl.ViewModel.State); Assert.AreEqual(false, SplashScreenTestUserControl.ViewModel.IsIndeterminate); }
private void Navigate(string navigatePath) { if (navigatePath != null) { DXSplashScreen.Show(typeof(NavigateSplashScreen)); _regionManager.RequestNavigate("ContentRegion", navigatePath, NavigationComplete); } }
protected void ExportProgress(ProgressChangedEventArgs ea) { if (!DXSplashScreen.IsActive) { return; } DXSplashScreen.Progress(ea.ProgressPercentage); }
public void IsActive_Test() { Assert.IsFalse(DXSplashScreen.IsActive); DXSplashScreen.Show <SplashScreenTestWindow>(); Assert.IsTrue(DXSplashScreen.IsActive); CloseDXSplashScreen(); Assert.IsFalse(DXSplashScreen.IsActive); }
private void InitializeDefaults() { LinkNewObjectToParentImmediately = false; OptimizedControllersCreation = true; UseLightStyle = true; SplashScreen = new DXSplashScreen(typeof(XafSplashScreen), new DefaultOverlayFormOptions()); ExecuteStartupLogicBeforeClosingLogonWindow = true; }
protected override void OnStartup(StartupEventArgs e) { CPublicVariables.Configuration = new CConfiguration(); base.OnStartup(e); DXSplashScreen.Show <SplashScreenView1>(); }
public static void Show(CultureInfo culture) { _splashScreen = null; DXSplashScreen.Show(cu => { _splashScreen = new SplashScreenView((CultureInfo)cu); return(_splashScreen); }, null, culture, null); }
static void JoinThread(DXSplashScreen.SplashScreenContainer.SplashScreenInfo info) { if(info == null) return; var t = info.InternalThread; if(t != null && t.IsAlive) t.Join(); }