示例#1
5
 // There's not supposed to be any logic in the view, so I'd move most of the methods in here to a controller
 public LoginScreen(MainFrame mainFrame)
 {
     this.MainFrame = mainFrame;
     InitializeComponent();
     _controller = new LoginController(mainFrame, this);
 }
 public LoginController(MainFrame mainFrame, LoginScreen screen)
 {
     this._screen = screen;
     _dbc = DatabaseController.Instance;
     this.MainFrame = mainFrame;
 }
 public LoginScreen(MainFrame mainFrame)   
                                 // There's not supposed to be any logic in the view, so I'd move most of the methods in here to a controller
 {                                      
     this.MainFrame = mainFrame;
     InitializeComponent();
     _controller = new LoginController(mainFrame, this);
 }
 /// <summary>
 /// Contructor for the More-Options-Window class.
 /// Initalizes context and the main frame object.
 /// Calls the InitializeComponent method.
 /// Calls the fillPlacedObjectListFromContext method, 
 /// to list the values of the plcable object, 
 /// wich are allready placed.
 /// </summary>
 /// <param name="mainFrame"></param>
 /// <param name="context"></param>
 public MoreOptionsWindow(MainFrame mainFrame, Context context)
 {
     this.context = context;
     MainFrame = mainFrame;
     InitializeComponent();
     fillPlacedObjectListFromContext();
 }
        //
        public PlacementController(MainFrame motherFrame, ProductAdding pa)
        {
            this.motherFrame = motherFrame;
            productAdding = pa;
            clickLocation = new Point(0, 0);
            productAdding.productPanel.knowYourController(this);

            //Make an event when the selection of the ASSORTMENT or INVENTORY has changed
            productAdding.productList1.SelectionChanged += new ProductSelectionChanged(this.ChangeSelected);


            //Select the first product from the product list, and display it in the default info
            try
            {
                ProductInfo defaultInfo = new ProductInfo(ProductModel.List[0]);
                ChangeSelected(defaultInfo);
            }
            catch { }


            //Make an event that triggers when the list is changed, so that it automatically repaints the screen.
            placedProductList.CollectionChanged += ppList_CollectionChanged;




            //TEMP
            //Fill the staticlyplaced list with walls
            Vector pointTopLeft = new Vector(0, 0);
            Vector pointTopRight = new Vector(productAdding.productPanel.Width - 1, 0);
            Vector pointBottomLeft = new Vector(0, productAdding.productPanel.Height - 1);
            Vector pointBottomRight = new Vector(productAdding.productPanel.Width - 1, productAdding.productPanel.Height - 1);

            staticlyPlacedObjectList = new List<PlacedProduct>();

            int length = (int)(pointBottomRight.Y - pointTopRight.Y);
            int width = (int)(pointTopRight.X - pointTopLeft.X);

            staticlyPlacedObjectList.Add(   //Top
                new PlacedProduct(
                    new ProductModel(0, "", "", width, 1, 1, true),
                    new PointF(width / 2, 0)));

            staticlyPlacedObjectList.Add(   //Right
                new PlacedProduct(
                    new ProductModel(0, "", "", 1, 1, length, true),
                    new PointF(width, length / 2)));

            staticlyPlacedObjectList.Add(   //Bottom
                new PlacedProduct(
                    new ProductModel(0, "", "", width, 1, 1, true),
                    new PointF(width / 2, length)));

            staticlyPlacedObjectList.Add(   //Left
                new PlacedProduct(
                    new ProductModel(0, "", "", 1, 1, length, true),
                    new PointF(0, length / 2)));


        }
 public SpaceChoice(MainFrame mainScreen)
 {
     this.MainScreen = mainScreen;      
     InitializeComponent();
     FillComboBox(comboBox1);
     Invalidate();
 }
示例#7
1
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="mf">View form</param>
 /// <param name="uc">Controller for logged in user</param>
 public TracksController(MainFrame mf, UserController uc)
 {
     myViewFrame = mf;
     myUserController = uc;
     userId = myUserController.getUserId();
     myTracks = new Tracks(userId);
 }
示例#8
1
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // On crée la mainframe mais on ne l'affichage pas encore
            BrickInvaders._frame = new MainFrame();

            // On crée le launcher et on le lance
            Launcher launcher = new Launcher();
            Application.Run(launcher);

            // On récupère la configuration qui en est issue
            Configuration c = launcher.Configuration;

            // Si elle existe (le launcher n'a pas été fermé mais on l'a validé)
            if (c != null)
            {
                // On crée le joueur et le modèle du jeu, on charge les scores associés, la mainframe surveillera le modèle pour détecter la défaite entre autre
                Player p = new Player(launcher.Pseudo);
                ModelInterface m = new GameModel();
                m.SetScoresModel(new ScoresModel(c.GameMode));
                m.AddObserver(BrickInvaders._frame);

                // On initialise le contrôleur
                Engine.Initialise(p, c, m, BrickInvaders._frame);

                // On lance l'application depuis la mainframe
                Application.Run(BrickInvaders._frame);
            }
        }
示例#9
1
文件: Engine.cs 项目: K-You/MISN
 public static void Initialise(Player p, Configuration c, ModelInterface m, MainFrame form)
 {
     if (INSTANCE == null)
     {
         INSTANCE = new Engine(p, c, m, form);
     }
 }
示例#10
1
		public ConfigDlg(MainFrame main)
		{

			InitializeComponent();

			_main = main;

		}
示例#11
1
        void LoadInitialFile(string filename)
        {
            mainFrame = new MainFrame();
            controller = new Controller(mainFrame);

            bool success = controller.LoadInitialFile(TestUtil.GetTestFile(filename), true);
            Assert.IsTrue(success);

            // Start the UI
            mainFrame.Show();
        }
        public AssortmentScreen(MainFrame hoofdscherm)
        {
            InitializeComponent();
            this.hoofdscherm = hoofdscherm;
            controller = new AssortmentController(this);
            noAmountCheckBox.Checked = true;
            deleteCheckBox.Checked = true;
            DropdownBrand.SelectedIndex = 0;
            DropdownCategory.SelectedIndex = 0;
            Invalidate();

        }
示例#13
1
文件: Engine.cs 项目: K-You/MISN
            private Engine(Player p, Configuration c, ModelInterface m, MainFrame form)
            {
                this._player = p;
                this._configuration = c;
                this._model = m;

                form.Engine = this;

                this._timer = new System.Timers.Timer(DEFAULT_INTERVAL);
                this._timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
                this._timer.SynchronizingObject = form;
            }
        public InventoryScreen(MainFrame hoofdscherm ) 
        {
            //create new controller for this screen
            this._controller = new InventoryController(this);                          
  
            this.Hoofdscherm = hoofdscherm;             
            // init screen and fill all the data
            InitializeComponent();
            _controller.FillData();
            _controller.FillDropdown();
            Invalidate();

       
        }
示例#15
1
文件: BaseForm.cs 项目: qq5013/XJ_WCS
 public void SetMainFrame(MainFrame mainFrame)
 {
     this.mainFrame = mainFrame;
 }
 public MapsScreen(MainFrame mainFrame)
 {
     this.MainFrame = mainFrame;
     InitializeComponent();
     _controller = new MapsController(this);
 }
示例#17
1
        private MainFrame myViewFrame; //View

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Guest user controller constructor
        /// </summary>
        /// <param name="ts">View frame</param>
        public UserController(MainFrame ts)
        {
            myViewFrame = ts;
            myUser = new User(-1);
        }
 public MainScreen(MainFrame mainFrame)
 {
     this.MainFrame = mainFrame;
     InitializeComponent();
 }
示例#19
1
        private void InitializeMachineInfo()
        {
            if (this.LocalInformationConfigData == null || this.LocalInformationConfigData.MachineInfos == null || this.LocalInformationConfigData.MachineInfos.Count < 1)
            {
                return;
            }

            this._machineForms = new Dictionary<string, MainFrame>();
            this._machineMessageInfos = new Dictionary<string, MachineMessageInfo>();

            for (int i = 0; i < this.LocalInformationConfigData.MachineInfos.Count; i++)
            {
                MachineLocalInformationConfig machineLocalInfo = this.LocalInformationConfigData.MachineInfos[i];

                MainFrame frm = new MainFrame(this.LocalInformationConfigData, machineLocalInfo);

                frm.ScreenSize = this.LocalInformationConfigData.ScreenSize;
                frm.MachineMessageEvent += new EventHandler<EventBaseInfo<EventMachineMessageInfo>>(MachineMessageEvent);
                frm.TopLevel = false;
                frm.Show();

                this._machineForms.Add(machineLocalInfo.MachineID, frm);
            }

            this.ShowMachineForm(this.LocalInformationConfigData.MachineInfos[0].MachineID);

            this.SetMachineTablePanel();
            this.MachineMessageBox.RemoveMachineMessage(this.LocalInformationConfigData.MachineInfos[0].MachineID);
        }
示例#20
1
 void CloseMainFrame()
 {
     mainFrame.Dispose();
     mainFrame = null;
 }
示例#21
0
 private void BtnUserConfig_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new Pages.PageUserConfig());
 }
示例#22
0
 public MainWindow()
 {
     InitializeComponent();
     MainFrame.Navigate(new Pages.LogIn());
 }
示例#23
0
 private void UserBtn_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new UserPage());
 }
示例#24
0
 private void WindowLoaded(object sender, RoutedEventArgs e)
 {
     //MainFrame.Content = new MainMenu();
     MainMenu = new MainMenu(this);
     MainFrame.Navigate(MainMenu);
 }
示例#25
0
 private void GoToCrews_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(typeof(CrewView));
 }
示例#26
0
 private void GoToFlights_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(typeof(FlightView));
 }
示例#27
0
 private void MessageCenter_MainFrameNavigatedTo1(Type page, object par)
 {
     MainFrame.Navigate(page, par);
 }
示例#28
0
 private void BtnCreateNewEntry_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new FormNewEntry());
 }
示例#29
0
 private void ManageUserButton_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(typeof(ManageUserPage));
 }
示例#30
0
 private void HomeButton_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(typeof(LoginPage));
 }
示例#31
0
 public MainPage()
 {
     this.InitializeComponent();
     MainFrame.Navigate(typeof(LoginPage));
 }
示例#32
0
 private void BtnSearchEntry_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new SearchEntry());
 }
示例#33
0
 private void HistoryBtn_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new HistoryPage());
 }
示例#34
0
 internal void Navigate(Type type)
 {
     MainFrame.Navigate(type);
 }
示例#35
0
 private void GoToDepartures_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(typeof(DepartureView));
 }
示例#36
0
 void CloseMainFrame()
 {
     mainFrame.Dispose();
     mainFrame = null;
 }
示例#37
0
 private void GoToPlanes_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(typeof(PlaneView));
 }
示例#38
0
 public MainUnitPage()
 {
     InitializeComponent();
     MainFrame.Navigate(new Uri("Pages/Units.xaml", UriKind.RelativeOrAbsolute));
 }
示例#39
0
 private void GoToStewardesses_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(typeof(StewardessView));
 }
示例#40
0
        public MainWindow()
        {
            InitializeComponent();

            MainFrame.Navigate(new Home());
        }
示例#41
0
 private void usun_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new Uri("Pages/DeleteUnit.xaml", UriKind.RelativeOrAbsolute));
 }
示例#42
0
 public static void Initialise(Player p, Configuration c, ModelInterface m, MainFrame form)
 {
     if (INSTANCE == null)
     {
         INSTANCE = new Engine(p, c, m, form);
     }
 }
示例#43
0
 private void OwnerTable_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new OwnerTable());
 }
示例#44
0
 private void StartNewGameBtn_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new Pages.GameSelectTypePage());
 }
示例#45
0
 private void CardTable_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new MainPage());
 }
示例#46
0
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            if (App.Discord == null)
            {
                return; // im not 100% sure why this gets called on logout but it does so
            }
            Analytics.TrackEvent("DiscordPage_Loaded");

            try
            {
                App.Discord.MessageCreated += Notification_MessageCreated;

                UpdateTitleBar();
                CheckSettingsPane();

                _loaded = true;

                this.FindParent <MainPage>().HideConnectingOverlay();

                var service = DiscordNavigationService.GetForCurrentView();

                if (_args != null && _args.ChannelId != 0 && App.Discord.TryGetCachedChannel(_args.ChannelId, out var channel))
                {
                    Analytics.TrackEvent("DiscordPage_NavigateToSpecifiedChannel");
                    await service.NavigateAsync(channel);
                }
                else
                {
                    Analytics.TrackEvent("DiscordPage_NavigateToFriendsPage");
                    Model.IsFriendsSelected = true;
                    SidebarFrame.Navigate(typeof(DMChannelsPage));
                    MainFrame.Navigate(typeof(FriendsPage));
                }

                if (_args?.ThemeLoadException != null)
                {
                    Analytics.TrackEvent("DiscordPage_ThemeErrorMessageShown");

                    var message = App.Discord.CreateMockMessage(
                        $"We had some trouble loading your selected themes, so we disabled them for this launch. For more information, see settings.",
                        App.Discord.CreateMockUser("Unicord", "CORD"));
                    ShowNotification(message);
                }

                var notificationService = BackgroundNotificationService.GetForCurrentView();
                await notificationService.StartupAsync();

                var possibleConnection = await VoiceConnectionModel.FindExistingConnectionAsync();

                if (possibleConnection != null)
                {
                    (DataContext as DiscordPageModel).VoiceModel = possibleConnection;
                }

                await ContactListManager.UpdateContactsListAsync();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex);
                await UIUtilities.ShowErrorDialogAsync("An error has occured.", ex.Message);
            }
        }
示例#47
0
 public MainWindow()
 {
     this.InitializeComponent();
     MainFrame.Navigate(typeof(FirstPage));
 }
示例#48
0
 internal void Navigate(Type type, object parameter)
 {
     MainFrame.Navigate(type, parameter);
 }
示例#49
0
        private async void NavView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args)
        {
            if (args.IsSettingsInvoked)
            {
                MainFrame.Navigate(typeof(Views.SettingPage));
                //Utils.ShowMessageToast("你选择了设置");
                return;
            }


            var item = args.InvokedItemContainer.Tag as MenuModel;

            switch (item.openMode)
            {
            case MenuOpenMode.Home:
                MainFrame.Navigate(typeof(Views.HomePage), item.parameters);
                break;

            case MenuOpenMode.Search:
                MainFrame.Navigate(typeof(Views.SearchPage));
                break;

            case MenuOpenMode.Download:
                break;

            case MenuOpenMode.LoaclMusic:
                break;

            case MenuOpenMode.Collection:
                break;

            case MenuOpenMode.Attention:
                break;

            case MenuOpenMode.Songlist:
                MainFrame.Navigate(typeof(Views.SonglistPage), item.parameters);
                break;

            case MenuOpenMode.Song:
                break;

            case MenuOpenMode.User:
                MainFrame.Navigate(typeof(Views.SingerPage), item.parameters);
                break;

            case MenuOpenMode.Webpage:
                break;

            case MenuOpenMode.Account:
                MainFrame.Navigate(typeof(Views.UserPage));
                break;

            case MenuOpenMode.Rank:
                MainFrame.Navigate(typeof(Views.RankPage));
                break;

            case MenuOpenMode.Radio:
                break;

            case MenuOpenMode.Login:
                await Utils.ShowLoginDialog();

                break;

            case MenuOpenMode.MyCollect:
                break;

            case MenuOpenMode.MyAttention:
                break;

            default:
                break;
            }
        }
示例#50
0
 private void BtnHome_Click(object sender, RoutedEventArgs e)
 {
     MainFrame.Navigate(new Home());
 }