Beispiel #1
0
        private static void Splasher()
        {
            var splash = new SplashScreen("SplashScreen.png");

            splash.Show(false, true);
            splash.Close(TimeSpan.FromMilliseconds(100));
        }
Beispiel #2
0
        public void Initialize()
        {
            _splashScreen.Close(TimeSpan.FromSeconds(1));

            Login();
            Show();
        }
Beispiel #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

#if !DEBUG
            var splashScreen = new SplashScreen("Resources/Intro.png");
            splashScreen.Show(false);
            //var intro = new IntroWindow();
            ////ElementHost.EnableModelessKeyboardInterop(intro);
            //intro.Show();
            Thread.Sleep(500);
#endif

            var startupPath = Application.StartupPath;
            var errorsPath  = startupPath + "\\errors.txt";
            var errorStatus = startupPath + "\\error_status.txt";
            ECUErrorFactory.Init(errorsPath, errorStatus);
            var appHost = new MainForm();
            PluginManager.Load(startupPath, appHost);

#if !DEBUG
            splashScreen.Close(TimeSpan.FromSeconds(1));
#endif

            Application.Run(appHost);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public MainWindow()
        {
            SplashScreen splashScreen = new SplashScreen(splahImage);

            splashScreen.Show(true);
            Thread.Sleep(2500);
            splashScreen.Close(TimeSpan.FromSeconds(5));

            InitializeComponent();

            #region Image Events

            ImageHandlerScroolViewer.ScrollChanged              += OnImageHandlerScroolViewerScrollChanged;
            ImageHandlerScroolViewer.MouseLeftButtonUp          += OnMouseLeftButtonUp;
            ImageHandlerScroolViewer.PreviewMouseLeftButtonUp   += OnMouseLeftButtonUp;
            ImageHandlerScroolViewer.PreviewMouseWheel          += OnPreviewMouseWheel;
            ImageHandlerScroolViewer.PreviewMouseLeftButtonDown += OnMouseLeftButtonDown;
            ImageHandlerScroolViewer.MouseMove += OnMouseMove;
            ScrollViewerImage.ValueChanged     += OnSliderValueChanged;

            ZoomThePhotoButton.MouseLeftButtonDown        += ZoomThePhotoButton_Click;
            ZoomThePhotoButton.PreviewMouseLeftButtonDown += ZoomThePhotoButton_Click;

            #endregion

            RenderOptions.SetBitmapScalingMode(ImageHandler, BitmapScalingMode.HighQuality);
        }
Beispiel #5
0
        private async void App_OnStartup(object sender, StartupEventArgs e)
        {
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Information()
                         .Enrich.FromLogContext()
                         .WriteTo.Debug()
                         .WriteTo.File("log.txt",
                                       rollingInterval: RollingInterval.Day,
                                       fileSizeLimitBytes: 20000000,
                                       retainedFileCountLimit: 15)
                         .CreateLogger();
            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
            {
                Exception?ex = (e.ExceptionObject as Exception);
                Log.Warning("Unhandled Exception Thrown!!!: {message}\n{trace}", ex?.Message, ex?.StackTrace);
            };

            SplashScreen splash = new SplashScreen("/View/Resources/splash.png");

            splash.Show(false);

            MainWindow window = new MainWindow();
            await window.Configure();

            this.MainWindow = window;

            splash.Close(TimeSpan.FromSeconds(1));
            window.Show();
        }
Beispiel #6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            // Step 1 - Load the splash screen
            SplashScreen splash = new SplashScreen("Art/SplashImage_.png");

            splash.Show(false, true);

            // Step 2 - Start a stop watch
            Stopwatch timer = new Stopwatch();

            timer.Start();

            // Step 3 - Load your windows but don't show it yet
            base.OnStartup(e);
            MainWindow main = new MainWindow();

            // Step 4 - Make sure that the splash screen lasts at least two seconds
            timer.Stop();
            int remainingTimeToShowSplash = MINIMUM_SPLASH_TIME - (int)timer.ElapsedMilliseconds;

            if (remainingTimeToShowSplash > 0)
            {
                Thread.Sleep(remainingTimeToShowSplash);
            }

            // Step 5 - show the page
            splash.Close(TimeSpan.FromMilliseconds(SPLASH_FADE_TIME));
            main.Show();
        }
Beispiel #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            if (!SingleInstance.InitializeAsFirstInstance(SignalExternalCommandLineArgs))
            {
                Environment.Exit(0);
            }

            var appSplash = new SplashScreen("splash.png");

            appSplash.Show(false);
            {
                base.OnStartup(e);
                Config.ShowConsole = true;
                Context.Startup();
            }
            appSplash.Close(TimeSpan.FromMilliseconds(300));

            if (false)
            {
                ShutdownMode = ShutdownMode.OnExplicitShutdown;
                Context.ProcessingQueueEmpty += Shutdown;

                Context.Log += OnLog;
                Context.ProcessingProcessChanged  += OnProcessingProcessChanged;
                Context.ProcessingProgressChanged += OnProcessingProgressChanged;
            }
            else
            {
                ShowMainWindow();
            }

            HandleArgs(e.Args);
        }
Beispiel #8
0
        public LoginWindow()
        {
            InitializeComponent();
            SplashScreen splashScreen = new SplashScreen("Models/SplashScreen1.png");

            splashScreen.Close(new TimeSpan(2000));
        }
Beispiel #9
0
      public CredentialsManagerForm()
      {
         SplashScreen splashScreen = new SplashScreen(Resources.Splash);

         Thread.CurrentThread.Name = " Main UI Thread";
         m_DownloadCompletedEvent = new ManualResetEvent(false);

         InitializeComponent();
         m_ApplicationListView.SmallImageList = new ImageList();
         m_ApplicationListView.SmallImageList.Images.Add(Resources.Application);

         m_UsersListView.SmallImageList = new ImageList();
         m_UsersListView.SmallImageList.Images.Add(Resources.User);

         m_UsersToAssignListView.SmallImageList = new ImageList();
         m_UsersToAssignListView.SmallImageList.Images.Add(Resources.User);

         m_RolesListView.SmallImageList = new ImageList();
         m_RolesListView.SmallImageList.Images.Add(Resources.Role);

         m_UsersInRoleComboBox.SetImage(Resources.User);
         m_RolesForUserComboBox.SetImage(Resources.Role);

         ServiceAddress = Settings.Default.AspNetSqlProviderService;
         m_AddressTextbox.Text = ServiceAddress;
         RefreshServicePage();
         RefreshApplicationsPage();

         splashScreen.Close();
      }    
Beispiel #10
0
        private void ToGame(String filepath)
        {
            SplashScreen loading_screen = new SplashScreen("Resources/loading.gif");

            loading_screen.Show(false, true);
            try
            {
                Views.GameView          game   = new Views.GameView();
                ViewModel.GameViewModel gameVM = new ViewModel.GameViewModel(filepath);
                gameVM.ShowMessageEvent    += new EventHandler <string>(ShowMessage);
                gameVM.QuitEvent           += new EventHandler(Game_Quit);
                gameVM.LoadEvent           += new EventHandler(Menu_Load);
                gameVM.NewEvent            += new EventHandler(Menu_New);
                gameVM.BattleEvent         += new EventHandler(Game_Battle);
                gameVM.ShowStatsEvent      += new EventHandler(Game_Stats);
                gameVM.ShowInventoryEvent  += new EventHandler(Game_Inventory);
                gameVM.SelectSkillEvent    += new EventHandler(Battle_SelectSkill);
                gameVM.SelectTargetEvent   += new EventHandler(Battle_SelectTarget);
                gameVM.ViewEnemyEvent      += new EventHandler <Model.CharacterRelated.Character>(Battle_ViewEnemy);
                gameVM.SelectedTargetEvent += new EventHandler(Battle_SelectedTarget);

                game.DataContext = gameVM;

                ChangeView(game);
            }
            catch (ViewModel.Exceptions.LoadException ex)
            {
                ShowMessage(this, ex.Message);
                Game_Quit(this, EventArgs.Empty);
            }
            finally
            {
                loading_screen.Close(TimeSpan.FromSeconds(1));
            }
        }
Beispiel #11
0
        private const int SPLASH_FADE_TIME    = 500;  //milisecs



        protected override void OnStartup(StartupEventArgs e)
        {
            SplashScreen splash = new SplashScreen("ceibo_splash.png");


            splash.Show(false, true); //cargar splash screen

            Stopwatch timer = new Stopwatch();

            timer.Start(); //empezar stopwatch


            base.OnStartup(e);
            MainWindow main = new MainWindow(); //load/cargar ventana


            timer.Stop(); //timer para que dure 2 segundos en pantalla
            int remainingTimeToShowSplash = MINIMUM_SPLASH_TIME - (int)timer.ElapsedMilliseconds;

            if (remainingTimeToShowSplash > 0)
            {
                Thread.Sleep(remainingTimeToShowSplash);
            }


            splash.Close(TimeSpan.FromMilliseconds(SPLASH_FADE_TIME)); //show
            //main.Show();

            var newW = new windowUsuarios();

            newW.Show();
        }
Beispiel #12
0
        private void Cv_Startup(object sender, StartupEventArgs e)
        {
            SplashScreen CvSplash = new SplashScreen("Images/SplashScreen.png");

            CvSplash.Show(false);
            CvSplash.Close(TimeSpan.FromSeconds(0.9));
        }
Beispiel #13
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var s = new SplashScreen("Views/splashscreen.jpg");

            s.Show(false);

            SelectedProfilePath = $"{PROFILEFOLDER}/{selectedProfileName}";
            ShowVideos          = true;
            IsEditModeActive    = false;
            ShutdownMode        = ShutdownMode.OnMainWindowClose;

            if (outputDevice == null)
            {
                outputDevice = new WaveOutEvent();
                outputDevice.PlaybackStopped += OnPlaybackStopped;
            }

            mainViewModel = new MainViewModel();

            LoadPlugins();

            MainWindowView wnd = new MainWindowView(mainViewModel);

            MainWindow = wnd;
            wnd.Show();

            s.Close(TimeSpan.FromSeconds(1));
        }
        //=======================================================================================================
        //This method is called when the user hits the "View" button on frmMain. It then calls the proper
        //  DatabaseFunctions method that will load the list with all current modules entered in the table
        //  and also opens a new instance of frmView. Since this is the first time ViewCurrent is called, it
        //  needs to create the new instance of frmView
        //=======================================================================================================
        private async void btnView_Click(object sender, EventArgs e)
        {
            this.Hide();
            _FrmMainMen.Hide();
            SplashScreen _splash = new SplashScreen
            {
                StartPosition   = FormStartPosition.CenterScreen,
                FormBorderStyle = FormBorderStyle.None,
                WindowState     = FormWindowState.Normal,
                MaximumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight),
                MinimumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight)
            };
            await Task.Delay(200);

            _splash.Show();
            _splash.BringToFront();
            _splash.Focus();
            await Task.Delay(200);

            DatabaseFunctions.ViewCurrent();
            _FrmView = new frmView();
            await Task.Delay(200);

            _FrmView.Show();
            _splash.Close();
        }
 //=======================================================================================================
 //This method is called when the user clicks on the "Submit" button on frmMain. It then checks if all 
 //  text boxes arent empty, if they are they will prompt the user to enter info for all text boxes, if 
 //  all text boxes are filled out, it will call the proper DatabaseFunctions method to insert new entry
 //  in the weight table
 //=======================================================================================================
 private async void btnSubmit_Click(object sender, EventArgs e)
 {   
     if (txtDepart.Text != "" && txtOp.Text != "" && txtPN.Text != "" && txtWeight.Text != "" && txtPartName.Text != "" && txtSTDPack.Text != "")
     {
         SplashScreen _splash = new SplashScreen
         {
             StartPosition = FormStartPosition.CenterScreen,
             FormBorderStyle = FormBorderStyle.None,
             WindowState = FormWindowState.Normal,
             MaximumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight),
             MinimumSize = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight)
         };
         await Task.Delay(200);
         _splash.Show();
         _splash.BringToFront();
         _splash.Focus();
         await Task.Delay(200);
         DatabaseFunctions.InsertNew(txtDepart.Text, txtOp.Text, txtPN.Text, txtWeight.Text, txtPartName.Text, txtSTDPack.Text);
         _splash.Close();
     }
     else
     {
         MessageBox.Show("Please Enter Info For Each Field");
     }
 }
        //========================================================================================================
        //This method is called when the user clicks on the "Back" button when currently viewing archived entries.
        //  It properly updates the dgv to show all entries in the weight table again
        //========================================================================================================
        private async void btnCancelArchive_Click(object sender, EventArgs e)
        {
            SplashScreen _splash = new SplashScreen
            {
                StartPosition   = FormStartPosition.CenterScreen,
                FormBorderStyle = FormBorderStyle.None,
                WindowState     = FormWindowState.Normal,
                MaximumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight),
                MinimumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight)
            };
            await Task.Delay(200);

            _splash.Show();
            _splash.BringToFront();
            _splash.Focus();
            await Task.Delay(200);

            DatabaseFunctions.ViewCurrent();
            RefreshDGV();
            DatabaseFunctions.DetachFile();
            bolArchiveView         = false;
            pnlDefault.Visible     = true;
            pnlUpdate.Visible      = false;
            pnlArchiveView.Visible = false;
            btnViewArchive.Visible = true;
            _splash.Close();
        }
Beispiel #17
0
        //=======================================================================================================
        //This method is called when the user clicks the "Submit" button when they are currently in "UpdateRow"
        //  mode. It makes sure there is data entered in each text box, when this is true, it calls the
        //  "UpdateWeight" method from DatabaseFunction.cs. If the user has not entered info for each text box,
        //  it will prompt them to fill out all fields and try again
        //=======================================================================================================
        private async void btnSubmitUpdate_Click(object sender, EventArgs e)
        {
            string tempDept      = txtDepartUpdate.Text;
            string tempModName   = txtModName.Text;
            string tempIPAddress = txtIPAddress.Text;

            if (tempDept != "" && tempModName != "" && tempIPAddress != "")
            {
                SplashScreen _splash = new SplashScreen
                {
                    StartPosition   = FormStartPosition.CenterScreen,
                    FormBorderStyle = FormBorderStyle.None,
                    WindowState     = FormWindowState.Normal,
                    MaximumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight),
                    MinimumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight)
                };
                await Task.Delay(200);

                _splash.Show();
                _splash.BringToFront();
                _splash.Focus();
                await Task.Delay(200);

                DatabaseFunctions.UpdateModule(intTUID, tempDept, tempModName, tempIPAddress);
                pnlUpdate.Visible      = false;
                pnlDefault.Visible     = true;
                pnlArchiveView.Visible = false;
                btnViewArchive.Visible = true;
                _splash.Close();
            }
            else
            {
                MessageBox.Show("Please Enter Info For Each Field");
            }
        }
Beispiel #18
0
        private static void Main(string[] args)
        {
            SplashScreen ss = new SplashScreen(typeof(FrmSplash));

            //Long running Init stuff
            FrmMain frm = new FrmMain();

            ss.Close(frm, 300);

            if (args.Length == 2)
            {
                int port = -1;
                try
                {
                    port = int.Parse(args[1]);

                    if (port > 0 && port < 65535)
                    {
                        frm.pendingHost = args[0];
                        frm.pendingPort = port;
                    }
                }
                catch
                {
                }
            }

            Application.Run(frm);
        }
        //=======================================================================================================
        //This method is called when the user clicks the "Archive Entry" button, it then shows a message box to
        //  make sure the user wants to archive the order, if they click yes, it calls the "Archiving" method in
        //  the DatabaseFunctions.cs file.
        //=======================================================================================================
        private async void btnArchiveEntry_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are You Sure You Want To Archive This Entry?", "Archive Entry", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                SplashScreen _splash = new SplashScreen
                {
                    StartPosition   = FormStartPosition.CenterScreen,
                    FormBorderStyle = FormBorderStyle.None,
                    WindowState     = FormWindowState.Normal,
                    MaximumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight),
                    MinimumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight)
                };
                await Task.Delay(200);

                _splash.Show();
                _splash.BringToFront();
                _splash.Focus();
                await Task.Delay(200);

                DatabaseFunctions.Archiving(true);
                bolArchiveView         = false;
                pnlDefault.Visible     = true;
                pnlUpdate.Visible      = false;
                pnlArchiveView.Visible = false;
                btnViewArchive.Visible = true;
                _splash.Close();
            }
        }
Beispiel #20
0
        private void SplashScreen()
        {
            var splash = new SplashScreen("/Recursos/Imagenes/Splash.png");

            splash.Show(false, true);
            splash.Close(new TimeSpan(0, 0, 7));
        }
Beispiel #21
0
        protected override void OnStartup(StartupEventArgs e)
        {
            //加载系统准备
            base.OnStartup(e);
            //程序域产生异常,需要友好提示,并收集错误信息,该异常无法阻止e.IsTerminating,发生就代表程序即将奔溃
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;
            //系统退出模式更换,主窗体关闭即认为程序退出,尝试解决驻留进程的问题
            Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
            //环境变量的同步
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
            //加载配置文件
            ConfigManager.GetInstance().LoadConfig(ConfigType.Client);
            ConfigManager.GetInstance().LoadConfig(ConfigType.System);
            ConfigManager.GetInstance().LoadConfig(ConfigType.User);
            //加载公共资源
            var resourceDictionary = new ResourceDictionary();

            resourceDictionary.Source = new Uri("/Platform.Controls;component/Themes/ScrollBar.xaml", UriKind.RelativeOrAbsolute);
            this.Resources.MergedDictionaries.Add(resourceDictionary);
            //欢迎屏幕
            SplashScreen splashScreen = new SplashScreen(Assembly.GetExecutingAssembly(), "Res/SplashScreen.png");

            splashScreen.Show(false);
            splashScreen.Close(new TimeSpan(0, 0, 1));
            //TODO:终端绑定验证

            //打开主界面
            new MainWindow().Show();
        }
Beispiel #22
0
        private static void ShowSplashScreen(bool Status)
        {
            if (!Debugger.IsAttached && !DetectLinux.LinuxDetected())
            {
                SplashScreen f = new SplashScreen();
                f.Shown += new EventHandler((o, e) =>
                {
                    Thread ST = new Thread(() =>
                    {
                        Log.Info("SPLASH SCREEN: Closing Splash Screen");
                        Thread.Sleep(4000);
                        f.Invoke(new Action(() => { f.Close(); }));
                    })
                    {
                        IsBackground = true
                    };
                    ST.Start();
                });
                Application.Run(f);
            }

            if (Status == true)
            {
                ShowMainScreen();
            }
        }
Beispiel #23
0
        private async void Current_Startup(object sender, StartupEventArgs e)
        {
            var startupArguments = new StartupArguments();

            startupArguments.Parse(e.Args);

            if (!string.IsNullOrEmpty(startupArguments.Culture))
            {
                Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo(startupArguments.Culture);
            }

            var splashScreen = new SplashScreen(LocalizationHelper.GetResourceManager().GetString("TXT_SPLASH_SCREEN_PATH"));

            splashScreen.Show(false);

            CheckForUpdates();

            await AsyncHelper.CallSync(InitialiseApplication);

            splashScreen.Close(new TimeSpan(0, 0, 0));

            var window = new LogInWindow();

            if (window.ShowDialog() == true)
            {
                ShutdownMode = ShutdownMode.OnMainWindowClose;
                MainWindow   = new MainWindow();

                MainWindow.ShowDialog();
            }
            else
            {
                Current.Shutdown();
            }
        }
Beispiel #24
0
 protected override void InitializeShell()
 {
     base.InitializeShell();
     splscreen.Close(TimeSpan.FromMilliseconds(1000));
     Application.Current.MainWindow = (MainWindow)this.Shell;
     Application.Current.MainWindow.Show();
 }
Beispiel #25
0
        public CredentialsManagerForm()
        {
            SplashScreen splashScreen = new SplashScreen(Resources.Splash);

            Thread.CurrentThread.Name = " Main UI Thread";
            m_DownloadCompletedEvent  = new ManualResetEvent(false);

            InitializeComponent();
            m_ApplicationListView.SmallImageList = new ImageList();
            m_ApplicationListView.SmallImageList.Images.Add(Resources.Application);

            m_UsersListView.SmallImageList = new ImageList();
            m_UsersListView.SmallImageList.Images.Add(Resources.User);

            m_UsersToAssignListView.SmallImageList = new ImageList();
            m_UsersToAssignListView.SmallImageList.Images.Add(Resources.User);

            m_RolesListView.SmallImageList = new ImageList();
            m_RolesListView.SmallImageList.Images.Add(Resources.Role);

            m_UsersInRoleComboBox.SetImage(Resources.User);
            m_RolesForUserComboBox.SetImage(Resources.Role);

            ServiceAddress        = Settings.Default.AspNetSqlProviderService;
            m_AddressTextbox.Text = ServiceAddress;
            RefreshServicePage();
            RefreshApplicationsPage();

            splashScreen.Close();
        }
Beispiel #26
0
        public MainWindow()
        {
            Common = new Common();

            // Окно входа
            var win = new StartAppWindow();
            var show = win.ShowDialog();

            if (show != null && show.Value == false) {
                Application.Current.Shutdown();
            } else {
                // Если пользователь вошёл успешно
                InitializeComponent();

                var ss = new SplashScreen(@"Images\splashScreen.png");
                ss.Show(true, true);
                ss.Close(new TimeSpan(0, 0, 1));

                Common.LoginData = new LoginData {
                    HostName = win.TextBoxHostName.Text,
                    Port = win.TextBoxPort.Text,
                    UserName = win.TextBoxUserName.Text
                };

                DataContext = new ApplicationViewModel(this);
            } // if-else
        } // MainWindow
        //=======================================================================================================
        //This method is called when the user clicks the "Submit" button when they are currently in "UpdateRow"
        //  mode. It makes sure there is data entered in each text box, when this is true, it calls the
        //  "UpdateWeight" method from DatabaseFunction.cs. If the user has not entered info for each text box,
        //  it will prompt them to fill out all fields and try again
        //=======================================================================================================
        private async void btnSubmitUpdate_Click(object sender, EventArgs e)
        {
            if (txtDepartUpdate.Text != "" && txtOp.Text != "" && txtPN.Text != "" && txtWeight.Text != "" && txtPartName.Text != "" && txtStdPack.Text != "")
            {
                SplashScreen _splash = new SplashScreen
                {
                    StartPosition   = FormStartPosition.CenterScreen,
                    FormBorderStyle = FormBorderStyle.None,
                    WindowState     = FormWindowState.Normal,
                    MaximumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight),
                    MinimumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight)
                };
                await Task.Delay(200);

                _splash.Show();
                _splash.BringToFront();
                _splash.Focus();
                await Task.Delay(200);

                DatabaseFunctions.UpdateWeight(txtDepartUpdate.Text, txtOp.Text, txtPN.Text, txtWeight.Text, txtPartName.Text, txtStdPack.Text, intTUID);
                pnlUpdate.Visible      = false;
                pnlDefault.Visible     = true;
                pnlArchiveView.Visible = false;
                btnViewArchive.Visible = true;
                _splash.Close();
            }
            else
            {
                MessageBox.Show("Please Enter Info For Each Field");
            }
        }
Beispiel #28
0
        /// <summary>
        /// The RunApp
        /// </summary>
        protected void RunApp()
        {
            logger?.Trace("Создание приложения WPF");
            try
            {
                logger?.Trace("Отображение заставки");
                SplashScreen splash = new SplashScreen(Assembly.GetAssembly(typeof(TMPApp)), "SplashScreen.png");
                splash.Show(false, false);

                Task closeSplash = Task.Run(() =>
                {
                    Thread.Sleep(MINIMUM_SPLASH_TIME);
                    logger?.Trace("Скрытие заставки");
                    splash.Close(TimeSpan.FromMilliseconds(SPLASH_FADE_TIME));
                });

                // подключение обработки ошибок привязки
#if DEBUG
                this.AttachBindingErrorListener();
#endif
            }
            catch (Exception ex)
            {
                string message = "Не удалось запустить приложение.\n" + GetExceptionDetails(ex) + "\nОбратитесь к разработчику.\nПрограмма аварийно завершается.";
                MessageBox.Show(Current.MainWindow, message, Instance.Title, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
                logger?.Error(ex, "Аварийное завершение!");
                this.Shutdown(-1);
            }
        }
        //========================================================================================================
        //This method is called when the user in view archived mode, which makes the entry not archived anymore.
        //  If the list count is 0, it tells the user there are no entries to unarchive, if there is count greater
        //  than 0 it calls DatabaseFunctions archive method
        //========================================================================================================
        private async void btnUnarchive_Click(object sender, EventArgs e)
        {
            if (Program.PartWeights.Count > 0)
            {
                SplashScreen _splash = new SplashScreen
                {
                    StartPosition   = FormStartPosition.CenterScreen,
                    FormBorderStyle = FormBorderStyle.None,
                    WindowState     = FormWindowState.Normal,
                    MaximumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight),
                    MinimumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight)
                };
                await Task.Delay(200);

                _splash.Show();
                _splash.BringToFront();
                _splash.Focus();
                await Task.Delay(200);

                DatabaseFunctions.Archiving(false);
                bolArchiveView         = false;
                pnlDefault.Visible     = true;
                pnlUpdate.Visible      = false;
                pnlArchiveView.Visible = false;
                btnViewArchive.Visible = true;
                _splash.Close();
            }
            else
            {
                MessageBox.Show("No Entries To Unarchive");
            }
        }
        //=======================================================================================================
        //This method is called when the user clicks on the "Submit" button on frmMain. It then checks if all
        //  text boxes arent empty, if they are they will prompt the user to enter info for all text boxes, if
        //  all text boxes are filled out, it will call the proper DatabaseFunctions method to insert new entry
        //  in the printer table
        //=======================================================================================================
        private async void btnSubmit_Click(object sender, EventArgs e)
        {
            string tempDept        = txtDepart.Text;
            string tempPrinterName = txtPrinterName.Text;

            if (tempDept != "" && tempPrinterName != "")
            {
                SplashScreen _splash = new SplashScreen
                {
                    StartPosition   = FormStartPosition.CenterScreen,
                    FormBorderStyle = FormBorderStyle.None,
                    WindowState     = FormWindowState.Normal,
                    MaximumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight),
                    MinimumSize     = new Size(Program.SplashScreenWidth, Program.SplashScreenHeight)
                };
                await Task.Delay(200);

                _splash.Show();

                _splash.BringToFront();
                _splash.Focus();
                await Task.Delay(200);

                DatabaseFunctions.InsertNew(tempDept, tempPrinterName);
                txtPrinterName.Text = "";
                _splash.Close();
            }
            else
            {
                System.Windows.MessageBox.Show("Please Enter Info For Each Field");
            }
        }
Beispiel #31
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var appSplash = new SplashScreen("Images/PrecogSplash.png");

            appSplash.Show(false);
            appSplash.Close(TimeSpan.FromSeconds(3));
        }
Beispiel #32
0
        private static void Main(string[] args)
        {
            SplashScreen ss = new SplashScreen(typeof (FrmSplash));

            //Long running Init stuff
            FrmMain frm = new FrmMain();

            ss.Close(frm, 300);

            if (args.Length == 2)
            {
                int port = -1;
                try
                {
                    port = int.Parse(args[1]);

                    if (port > 0 && port < 65535)
                    {
                        frm.pendingHost = args[0];
                        frm.pendingPort = port;
                    }
                }
                catch
                {

                }
            }

            Application.Run(frm);
        }
Beispiel #33
0
        private void startB_Click(object sender, EventArgs e)
        {
            List<string> nicknames = new List<string>();

            foreach (unit hero in heroes)
                if (hero.codeID == "AnyHero" && !string.IsNullOrEmpty(hero.name))
                    nicknames.Add(hero.name);

            resultsLV.Items.Clear();

            if (!Directory.Exists(pathTextBox.Text))
            {
                MessageBox.Show("Specified path does not exists");
                return;
            }
            string[] files = Directory.GetFiles(pathTextBox.Text, "*.w3g", subfoldersCB.Checked ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
            startB.Enabled = false;
            resultsLV.BackColor = Color.WhiteSmoke;
            resultsLV.BeginUpdate();

            SplashScreen splashScreen = new SplashScreen();
            splashScreen.Show();
            splashScreen.ShowText("Searching...");

            int index = 0;
            Replay replay;
            foreach (string file in files)
            {
                index++;
                try
                {
                    replay = new Replay(file);
                    if (IsReplayMatchesCriteria(replay, nicknames))
                    {
                        ListViewItem lvi = new ListViewItem(file);
                        lvi.Tag = replay;

                        resultsLV.Items.Add(lvi);
                    }
                }
                catch { }

                splashScreen.ShowProgress((double)index, (double)files.Length);
            }

            splashScreen.Close();

            resultsLV.EndUpdate();
            resultsLV.BackColor = Color.AliceBlue;
            startB.Enabled = true;
        }
Beispiel #34
0
        private static void Main()
        {
            SplashScreen ss = new SplashScreen(typeof (FrmSplash));

            //Long running Init stuff
            FrmMain frm = new FrmMain();

            ss.Close(frm, 300);

            Application.Run(frm);
        }