private void BackMethod(object param) { StartWindow startWindow = new StartWindow(); App.Current.MainWindow.Close(); App.Current.MainWindow = startWindow; startWindow.Show(); }
public void Back(object param) { StartWindow startWindow = new StartWindow(); App.Current.MainWindow.Close(); App.Current.MainWindow = startWindow; startWindow.Show(); }
private void btnBack_Click(object sender, RoutedEventArgs e) { this.ClearFields(); MainWindow mainWindow = StartWindow.GetMainWindow(this); this.Visibility = Visibility.Hidden; mainWindow.movies.Visibility = Visibility.Visible; }
private void btnBack_Click(object sender, RoutedEventArgs e) { this.Visibility = Visibility.Hidden; this.moviesContainer.Children.RemoveAt(0); MainWindow mainWindow = StartWindow.GetMainWindow(this); mainWindow.startingUserControl.Visibility = Visibility.Visible; mainWindow.User = new User(); }
private void BtnLogout(object sender, RoutedEventArgs e) { var startWindow = new StartWindow(); App.Current.MainWindow = startWindow; _profilePage.Close(); startWindow.Show(); }
protected override void OnClick() { base.OnClick(); Window win = Application.Current.MainWindow; StartWindow main = new StartWindow(); main.Show(); win.Close(); }
private void btnBack_Click(object sender, RoutedEventArgs e) { this.ClearContent(); this.Visibility = Visibility.Hidden; var mainWindow = StartWindow.GetMainWindow(this); mainWindow.menu.Visibility = Visibility.Visible; }
private void btnSeat_Click(object sender, EventArgs e) { Button button = sender as Button; MainWindow mainWindow = StartWindow.GetMainWindow(this); mainWindow.seatBooking.PlaceSeats(int.Parse(button.Uid)); this.Visibility = Visibility.Hidden; mainWindow.seatBooking.Visibility = Visibility.Visible; }
private void FillSchedule() { MainWindow mainWindow = StartWindow.GetMainWindow(this); if (mainWindow.User.IsAdmin) { this.InsertAddScreeningButton(); } List <Schedule> movieSchedule = Query.GetMovieSchedules(int.Parse(this.txtId.Text)); if (movieSchedule.Count == 0) { TextBlock textBlock = new TextBlock(); textBlock.Text = "There are no projections for this movie."; textBlock.FontSize = 15; textBlock.TextAlignment = TextAlignment.Center; textBlock.Foreground = Brushes.Yellow; this.schedulePanel.Children.Add(textBlock); } else { foreach (var projection in movieSchedule) { StackPanel horizontalSchedulePanel = new StackPanel(); horizontalSchedulePanel.Orientation = Orientation.Horizontal; Button button = new Button(); button.Content = string.Format("{0} price: {1} $", projection.Date.ToString(), projection.Price); button.Uid = projection.Id.ToString(); button.FontSize = 20; button.Foreground = Brushes.Black; button.Width = 465; button.Background = Brushes.Gray; button.Margin = new Thickness(0, 0, 0, 10); button.Effect = ratingBar.Effect; button.Click += this.btnSeat_Click; horizontalSchedulePanel.Children.Add(button); if (mainWindow.User.IsAdmin) { Button btnRemoveScreening = new Button(); btnRemoveScreening.BorderBrush = Brushes.Transparent; btnRemoveScreening.Uid = projection.Id.ToString(); btnRemoveScreening.Background = this.btnDeleteIcon.Background; btnRemoveScreening.Width = 30; btnRemoveScreening.Height = 30; btnRemoveScreening.Margin = new Thickness(0, 0, 0, 10); btnRemoveScreening.Click += this.btnRemoveScreening_Click; horizontalSchedulePanel.Children.Add(btnRemoveScreening); } this.schedulePanel.Children.Add(horizontalSchedulePanel); } } }
static void Main() { Mark = "%m"; Version = 1.1; Application.EnableVisualStyles( ); Application.SetCompatibleTextRenderingDefault(false); st = new StartWindow( ); Application.Run(st); }
private void App_OnStartup(object sender, StartupEventArgs e) { ///test git master 6 App.Current.ShutdownMode = ShutdownMode.OnMainWindowClose; var ninjectKernel = new StandardKernel(); ninjectKernel.Load(new CommonModule()); startWindow = new StartWindow(ninjectKernel.Get <IFactory>()); startWindow.Show(); }
public MainWindowViewModel() { var startWindow = new StartWindow(); if (startWindow.ShowDialog() == false) { Application.Current.Shutdown(); return; } StartWindowAction startWindowAction = (startWindow.DataContext as StartWindowViewModel).StartWindowAction; switch (startWindowAction) { case StartWindowAction.NewGame: Game = new Game(); break; case StartWindowAction.LoadGame: Game = new Game(); LoadGame(); break; case StartWindowAction.ExitGame: Application.Current.Shutdown(); break; default: break; } Game.OnActionCompleted += ((s) => { ActionText = s; }); OpenGameFieldSettingsCommand = new RelayCommand(); OpenGameFieldSettingsCommand.ExecutedCommand += (() => { GetGameFieldSettingsWindow(); }); StartGameCommand = new RelayCommand(); StartGameCommand.ExecutedCommand += StartGame; SaveGameCommand = new RelayCommand(); SaveGameCommand.ExecutedCommand += SaveGame; LoadGameCommand = new RelayCommand(); LoadGameCommand.ExecutedCommand += LoadGame; StopGameCommand = new RelayCommand(); StopGameCommand.ExecutedCommand += StopGame; }
public MainWindow() { InitializeComponent(); StartWindow startWindow = new StartWindow(); this.DataContext = startWindow; if (startWindow.HidenWindow == null) { startWindow.HidenWindow = new Action(this.Close); } }
protected LobbyWindow m_kLobbyWindow = null; // 切换等待界面 public override void OnEnterStatus() { // 首先初始化配置 TabtoyConfigManager.Init(); if (m_kStartWindow == null) { m_kStartWindow = OpenUI <StartWindow> () as StartWindow; } m_kStartWindow.Show(); }
public App() { MainWindow = new StartWindow(); MainWindow.Show(); LoginViewModel viewModel = new LoginViewModel(); MainWindow.DataContext = viewModel; MainWindow.Show(); }
/// <summary> /// Настроить видимость надписей в заставке. Если они пустые, то и надписи невидимы. /// </summary> /// <param name="text"></param> /// <param name="sw"></param> /// <param name="who"></param> private static void SetSplashTextboxVisibilitis(string text, StartWindow sw, string who) { if (string.IsNullOrEmpty(text)) { sw.TextBlock.Visibility = Visibility.Collapsed; } if (string.IsNullOrEmpty(who)) { sw.who.Visibility = Visibility.Collapsed; } }
public AdminMenuUC(StartWindow receivedWindow, int userId) { InitializeComponent(); st = receivedWindow; this.userId = userId; using (LibraryDBEntities db = new LibraryDBEntities()) { var user = db.Users.Find(userId); // Greeting.Content = "Hello" + user.FName + " " + user.LName + "!"; } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); bool useAuthentication = false; try { IConfigurationProvider provider = new XmlConfigurationProvider(); Analyzer analyzer = new Analyzer(provider); ConveyorService conveyor = new ConveyorService(54); AnalyzerDemoController demoController = new AnalyzerDemoController(provider, conveyor); demoController.LoadConfiguration("DemoControllerConfiguration"); StartWindow startWindow = new StartWindow(); MainWindow mainWindow = new MainWindow(); mainWindow.Init(analyzer, conveyor, demoController); startWindow.StartPosition = FormStartPosition.CenterScreen; mainWindow.StartPosition = FormStartPosition.CenterScreen; if (useAuthentication) { Application.Run(startWindow); if (startWindow.IsAuthenticated) { Application.Run(mainWindow); } } else { Application.Run(mainWindow); } analyzer.SaveUnitsConfiguration(); demoController.SaveConfiguration("DemoControllerConfiguration"); } catch (System.IO.FileLoadException) { MessageBox.Show("Ошибка при открытии файла конфигурации!"); return; } catch (System.IO.IOException) { MessageBox.Show("Ошибка при открытии файла конфигурации!"); return; } }
private void btnBack_Click(object sender, RoutedEventArgs e) { this.Visibility = Visibility.Hidden; this.insertScheduleContainer.Visibility = Visibility.Hidden; this.commentsContainer.Visibility = Visibility.Hidden; this.scheduleContainer.Visibility = Visibility.Hidden; this.informationContainer.Visibility = Visibility.Visible; this.ClearFields(); MainWindow mainWindow = StartWindow.GetMainWindow(this); mainWindow.movies.Visibility = Visibility.Visible; }
public void EnterToStart() { if (m_kStartWindow == null) { m_kStartWindow = OpenUI <StartWindow> (); } m_kStartWindow.Show(); m_kStartWindow.OnShow(); if (m_kLobbyWindow != null) { m_kLobbyWindow.Hide(); } }
protected override void OnStartup(StartupEventArgs e) { var builder = new ContainerBuilder(); builder.RegisterType <MainWindowViewModel>().AsSelf().SingleInstance(); builder.RegisterType <LayerService>().AsSelf().SingleInstance(); ViewContainer = builder.Build(); var model = ViewContainer.Resolve <MainWindowViewModel>(); var view = new StartWindow { DataContext = model }; view.Show(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); ShellWindow shellWindow = new ShellWindow(); StartWindow startWindow = new StartWindow(); Task.Run(() => { Thread.Sleep(3000); this.Dispatcher.Invoke(() => { startWindow.Close(); }); }); startWindow.ShowDialog(); shellWindow.Show(); Debug.WriteLine(string.Join(",", Enumerable.Range(1, 300).ToArray())); Random random = new Random(); Trace.WriteLine(string.Join(",", Enumerable.Range(1, 300).Select(l => random.Next(1, 100)).ToArray())); Debug.WriteLine(string.Join(",", Enumerable.Range(1, 360).ToArray())); Debug.WriteLine(string.Join(",", Enumerable.Range(1, 360).Select(l => Math.Round(Math.Sin(Convert.ToDouble(l.ToString()) / 4) * 5.0 + 5, 2)).ToArray())); Debug.WriteLine(string.Join(",", Enumerable.Range(1, 360).Select(l => Math.Round(Math.Sin(Convert.ToDouble(l.ToString()) / 10) * 5.0 + 5, 2)).ToArray())); Debug.WriteLine(string.Join(",", Enumerable.Range(1, 360).Select(l => l * 3).ToArray())); Debug.WriteLine(string.Join(",", Enumerable.Range(1, 360).Select(l => Math.Round((10.0 / 360.0) * l, 2)).ToArray())); int[] sss = { 1, 2, 3, 4, 5, 6 }; int[] sss1 = { 1 }; var sssss = sss1.Zip(sss, (l, k) => { return(l); }).ToList(); }
private void OpenProjectEvent(object sender, RoutedEventArgs e) { if (haveUnsavedChanges) { MessageBoxResult result = MessageBox.Show("Czy zapisać zmiany w projekcie?", "Zmiany", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning); switch (result) { case MessageBoxResult.Cancel: return; case MessageBoxResult.Yes: { SaveAction(sender, null); if (haveUnsavedChanges) { return; } break; } case MessageBoxResult.No: break; } } do { Project selProject = null; StartWindow start = new StartWindow(); start.SelectedProject += p => selProject = p; Visibility = Visibility.Collapsed; start.ShowDialog(); if (selProject == null) { activeProject = null; this.Close(); return; } else { LoadProject(selProject); } }while (activeProject == null); try { this.Visibility = Visibility.Visible; } catch { } haveUnsavedChanges = true; }
public bool Open() { if (SelectedEmployee != null && SelectedEmployee != Employees[0]) { StartWindow startWindow = new StartWindow(SelectedEmployee); startWindow.Show(); return(true); } else { string message = "You need to select employee account."; var exceptionWindow = new ExceptionWindow(message); exceptionWindow.ShowDialog(); return(false); } }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; // graphics.IsFullScreen = true; graphics.ApplyChanges(); // For the buttons that is used to navigate through the gameState IsMouseVisible = true; btnRestart = new cButton(Content.Load <Texture2D>("RestartButton"), GraphicsDevice); btnPlay = new cButton(Content.Load <Texture2D>("StartButton"), GraphicsDevice); btnPlay.setPosition(new Vector2(310, 450)); btnRestart.setPosition(new Vector2(310, 300)); endingScreenTexture = Content.Load <Texture2D>("CreditsScreen"); lostScreenTexture = Content.Load <Texture2D>("GameOverScreen-still"); startingScreenTexture = Content.Load <Texture2D>("title_screen"); startingScreen = new StartWindow(startingScreenTexture); backGroundWoudsTexture = Content.Load <Texture2D>("backGround"); //Loading the World Folder map = new Map(); Tiles.Content = Content; camera = new Camera(GraphicsDevice.Viewport); map.GenerateWorld1(); // Load for the Characters idle = Content.Load <Texture2D>("john_idle"); bullet = Content.Load <Texture2D>("john_bullet"); player = new Player(idle, bullet); player.Load(Content); gruntidle = Content.Load <Texture2D>("grunt_run"); enemy.Add(new Enemy(gruntidle, enemy1Pos, 3, bullet)); enemy.Add(new Enemy(gruntidle, enemy2Pos, 2, bullet)); enemy.Add(new Enemy(gruntidle, enemy3Pos, 1, bullet)); enemy.Add(new Enemy(gruntidle, enemy4Pos, 1, bullet)); enemy.Add(new Enemy(gruntidle, enemy5Pos, 2, bullet)); enemy.Add(new Enemy(gruntidle, enemy6Pos, 3, bullet)); foreach (Enemy enemy in enemy) { enemy.Load(Content); } }
private void btnLogin_Click(object sender, RoutedEventArgs e) { var svc = new CheckersClient.LoginService.AddServiceClient(); ins = svc.IsUserExist(txtUserName.Text, txtPassword.Password); string value = this.txtUserName.Text; Guid id = ins.clientDictionary.FirstOrDefault(x => x.Value.UserName == value).Key; if (ins.clientDictionary.Count != 0) { StartWindow window2 = new StartWindow(value, ins, id, svc); window2.Show(); this.Close(); } else { MessageBox.Show("Login failed"); } }
public UserControl_StartWindow(StartWindow startWindow) { InitializeComponent(); new Thread(() => { Thread.Sleep(2000); LabelWelcome.Dispatcher.BeginInvoke((Action)( () => LabelWelcome.Visibility = System.Windows.Visibility.Visible )); Thread.Sleep(1000); startWindow.Dispatcher.BeginInvoke((Action)( () => new MainWindow(startWindow).Show() )); }).Start(); }
private void btnAddMovie_Click(object sender, RoutedEventArgs e) { if (!this.isUploaded) { MessageBox.Show("First, you must upload the image!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { int year = 0; if (!int.TryParse(this.txtYear.Text, out year)) { MessageBox.Show("Your input for year is not a number!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } int duration = 0; if (!int.TryParse(this.txtDuration.Text, out duration)) { MessageBox.Show("Your input for duration is not a number!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } Movie movie = new Movie(this.txtName.Text, this.txtDescription.Text, this.txtGenre.Text, year, duration, this.txtActors.Text, this.txtDirector.Text, this.poster, this.txtTrailer.Text); if (AdminQuery.AddMovie(movie)) { MessageBox.Show("Movie was added successfully", "Information", MessageBoxButton.OK, MessageBoxImage.Information); MainWindow mainWindow = StartWindow.GetMainWindow(this); mainWindow.movies.moviesContainer.Children.Clear(); mainWindow.movies.LoadMovies(); mainWindow.movies.InsertAddButton(); mainWindow.movieInformation.FillInformation(movie.Name); this.Visibility = Visibility.Hidden; mainWindow.movieInformation.Visibility = Visibility.Visible; this.ClearFields(); } } }
private void btnDeleteMovie_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show("Are you sure you want to delete this movie?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { if (AdminQuery.RemoveMovie(int.Parse(this.btnDeleteMovie.Uid))) { MainWindow mainWindow = StartWindow.GetMainWindow(this); mainWindow.movies.moviesContainer.Children.Clear(); mainWindow.movies.LoadMovies(); mainWindow.movies.InsertAddButton(); MessageBox.Show("You successfully removed the movie.", "Information", MessageBoxButton.OK, MessageBoxImage.Information); this.ClearFields(); this.btnBack_Click(sender, e); } } }
private void ProgramsClick(object sender, RoutedEventArgs e) { if (programOpen) { programOpen = false; foreach (var win in Application.Current.Windows) { var window = ((Window)win); if (window.Name == "Start") { window.Close(); } } return; } var start = new StartWindow(); start.Show(); programOpen = true; }