static int Main(string[] args) { bool quit = false; wm = new WindowManager ( ); while ( !quit ) { wm.draw ( ); } const int SIZE_H = 30; const int SIZE_W = 30; Stopwatch t = new Stopwatch(); t.Start(); World GameWorld = new World(SIZE_H, SIZE_W); t.Stop(); long l = t.ElapsedMilliseconds; t.Reset(); t.Start(); GameWorld.print(); t.Stop(); long m = t.ElapsedMilliseconds; System.Console.WriteLine("Generated a {0} x {1} World in: {2} seconds", SIZE_H, SIZE_W, (double)l / 1000); System.Console.WriteLine("And Printed it in {0} seconds", (double)m / 1000); Thread.Sleep(22000); return 0; }
void OnEnable() { manager = (WindowManager)target; pages = new SerializedObject(manager); m_pages = pages.FindProperty("pages"); }
public ModelOrientationControl(IRenderEngine renderPlugin, WindowManager wm) { InitializeComponent(); this.wm = wm; this.renderPlugin = renderPlugin; engine = renderPlugin as RayCaster; }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override async void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (Debugger.IsAttached) { DebugSettings.EnableFrameRateCounter = true; } #endif var rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { NavigationHelper.Register<PageStates, MainPage>(PageStates.Main); NavigationHelper.Register<PageStates, SecondPage>(PageStates.Second); NavigationHelper.Register<PageStates, ThirdPage>(PageStates.Third); NavigationHelper.Register<SecondaryStates, SeparatePage>(SecondaryStates.Main); var core = new SampleApplication(); await core.Startup(builder => { builder.RegisterType<Special>().As<ISpecial>(); }); var region = core.RegionManager.RegionByType<MainWindow>(); var fn = new FrameNavigation<PageStates, PageTransitions>(rootFrame, region); await region.Startup(core.RegionManager); var wm = new WindowManager(core); // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter //rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); }
public PluginManager(DTE2 _applicationObject, AddIn _addInInstance) { this._applicationObject =_applicationObject; this._addInInstance = _addInInstance; menuManager = new MenuManager(_applicationObject); windowManager = new WindowManager(_applicationObject, _addInInstance); }
void Start() { resources = GameObject.Find ("Resources"); troops = GameObject.Find ("Troops"); notifications = GameObject.Find ("Notifications"); window = GameObject.Find ("Window").GetComponent<WindowManager> (); Visibility (); }
private WindowManager() { if (_instance != null) { throw new Exception("单件实例错误"); } _instance = this; }
public MainMenu(WindowManager _WM, State _parentState, int _X, int _Y, int _SizeX, int _SizeY) : base(_WM, _parentState, _X, _Y, _SizeX, _SizeY, "Main Menu", BorderType.Resizable) { StartGameButton = new Widgets.TextButton(_WM, "Start Game", 20, 40, 50, 100, new EventHandler(StartGame)); AddWidget(StartGameButton); QuitGameButton = new Widgets.TextButton(_WM, "QuitGame", 20, 100, 50, 100, new EventHandler(QuitGame)); AddWidget(QuitGameButton); }
public IngameShipState(WindowManager WM) : base(WM) { CurrentMap = new IngameObjects.NetworkWorld(this); GameView = new View(); //WM.AddWindow(new Windows.MainMenu(WM, this, 100, 100, 250, 200)); Chat = new Windows.ChatBox(WM, this, 100, 100, 250, 200); WM.AddWindow(Chat); }
void RegisterViews(TinyIoCContainer container) { var windowManager = new WindowManager (container); windowManager.RegisterView<MainPageViewModel, MainPage> (); windowManager.RegisterView<AddTicketViewModel, AddTicketPage> (); container.Register<IWindowManager> (windowManager); container.Register<IViewManager> (windowManager); }
public ApplicationViewModel(Repository repository, ApplicationContext applicationContext, WindowManager windowManager) { if (repository == null) throw new ArgumentNullException("repository"); if (applicationContext == null) throw new ArgumentNullException("applicationContext"); if (windowManager == null) throw new ArgumentNullException("windowManager"); Repository = repository; WindowManager = windowManager; ApplicationContext = applicationContext; }
public ChatBox(WindowManager _WM, State _parentState, int _X, int _Y, int _SizeX, int _SizeY) : base(_WM, _parentState, _X, _Y, _SizeX, _SizeY, "Chat Box", BorderType.None) { ParentState = _parentState; OutComing = new DystopiaUI.Widgets.TextBox(_WM, 5, _SizeY-28-(1*25), 100, 1, true); InComing = new DystopiaUI.Widgets.TextBox(_WM, 5, 0, _SizeX-10, 6, true); SendButton = new DystopiaUI.Widgets.TextButton(_WM, "Send", _SizeX - 10 - 40, _SizeY -28-50, 100, 100, new EventHandler(SendMessage)); AddWidget(OutComing); AddWidget(InComing); AddWidget(SendButton); }
public virtual void Setup() { Repository = Substitute.For<Repository>(); Repository.Name.Returns("DefaultRepositoryName"); Repository.FilePath.Returns(@"C:\Test.mmdb"); ApplicationContext = Substitute.For<ApplicationContext>(); ApplicationContext.Now.Returns(new DateTime(CurrentYear, CurrentMonth, CurrentDay)); WindowManager = Substitute.For<WindowManager>(); Application = new ApplicationViewModel(Repository, ApplicationContext, WindowManager); }
// Use this for initialization void Start() { window = GameObject.Find ("Window").GetComponent<WindowManager> (); xBox = GameObject.Find ("X-Cord"); yBox = GameObject.Find ("Y-Cord"); cameraBox = GameObject.Find ("CameraBox"); GameObject data = GameObject.Find ("World Data Storage"); saveData = data.GetComponent<WorldSavedCoordinates> (); xCord = saveData.GetCurrentLocationX(); yCord = saveData.GetCurrentLocationY(); positionMovement (); }
private WindowManager _windows; // Draw window and button for toolbar #endregion Fields #region Methods // Run once at the mode loading public void Awake() { // it might help //ReportManager report = gameObject.AddComponent<ReportManager>(); report = ReportManager.Instance(); // Call the instance report.Kistory = this; // We need this for corutines _windows = new WindowManager(); // we need this to draw interface this.eventTime = DateTime.Now; // ? KDebug.Log("Awake", KDebug.Type.MONO); }
void Awake() { if (Instance != null) { Destroy(gameObject); } else { DontDestroyOnLoad(gameObject); Instance = this; } stateManager = GetComponent<WindowState>(); activePages = new List<GameObject>(); canvas = GameObject.FindGameObjectWithTag("Canvas"); }
public TextButton(WindowManager _WM,string StartString, int _X, int _Y, int _SizeX, int _SizeY, EventHandler callback) : base(_WM, _X,_Y,_SizeX,_SizeY) { ButtonText = new Text(StartString, WM.font,15); ButtonPressed += callback; localx = _X; localy = _Y; BackPlate = new RectangleShape(); //BackPlate.Size = new Vector2f(ButtonText BackPlate.FillColor = Color.Magenta; SetSize((int)ButtonText.GetGlobalBounds().Width, (int)ButtonText.GetGlobalBounds().Height*2); LeftSide = new Sprite(new Texture("UI.png", new IntRect(8, 32, 8, 24))); Center = new Sprite(new Texture("UI.png", new IntRect(17, 32, 1, 24))); Center.Scale = new Vector2f(sizeX-8-8, 1); RightSide = new Sprite(new Texture("UI.png", new IntRect(96, 32, 8, 24))); }
protected override void DisplayRootView() { #if SILVERLIGHT Application.Current.RootVisual = new ShellView(); #else IWindowManager windowManager; try { windowManager = IoC.Get<IWindowManager>(); } catch { windowManager = new WindowManager(); } windowManager.ShowWindow(new ShellView()); #endif }
public MainForm(IPathResolver pathResolver, IScriptManager scriptManager, Settings settings) { m_settings = settings; m_pathResolver = pathResolver; m_scriptMgr = scriptManager; InitializeComponent(); // Window manager m_windowMgr = new WindowManager(m_pathResolver, dockPanel, m_settings); m_windowMgr.OnCaretChanged += new EventHandler<CaretChangedEventArgs>(WindowManagerOnCaretChanged); // Post component initialization openFileDialog.InitialDirectory = m_pathResolver.BaseDirectory; // Load output window m_outputContent = new OutputContentBox(); m_outputContent.Show(dockPanel, DockState.DockBottom); // Load error window m_errorContent = new ErrorContentBox(); m_errorContent.Show(dockPanel, DockState.DockBottom); m_errorContent.ErrorSelected += new EventOnErrorSelected(OnErrorSelected); // Adjust bottom panel dockPanel.DockBottomPortion = m_settings.DockBottom; dockPanel.DockRightPortion = m_settings.DockRight; dockPanel.DockLeftPortion = m_settings.DockLeft; dockPanel.DockTopPortion = m_settings.DockTop; // Attach event handlers m_scriptMgr.CompileFinished += new EventHandler(OnCompileFinished); m_scriptMgr.CompileInterrupted += new EventHandler(OnCompileInterrupted); m_scriptMgr.CompileStarting += new EventHandler(OnCompileStarting); m_scriptMgr.ScriptError += new EventHandler<ScriptErrorEventArgs>(OnScriptError); m_scriptMgr.ScriptOutput += new EventHandler<ScriptOutputEventArgs>(OnScriptOutput); m_scriptMgr.ScriptEngineRestarted += new EventHandler(OnScriptEngineRestarted); m_scriptMgr.ScriptEngineRestarting += new EventHandler(OnScriptEngineRestarting); // Disable Windows-XP default theme; use system colours ToolStripProfessionalRenderer renderer = new ToolStripProfessionalRenderer(); renderer.ColorTable.UseSystemColors = true; renderer.RoundedEdges = true; ToolStripManager.Renderer = renderer; }
public TextBox(WindowManager _WM, int _X, int _Y, int _SizeX,int _SizeY,bool _AllowInput) : base(_WM, _X, _Y, _SizeX, _SizeY) { localx = _X; localy = _Y; AllowInput = _AllowInput; BoxText = new Text("", _WM.font,15); BackPlate = new RectangleShape(); Cursor = new RectangleShape(); Cursor.Size = new Vector2f(1, BoxText.GetLocalBounds().Height*2); Cursor.FillColor = Color.Green; //BoxText.Position = new Vector2f(_X, _Y); SetSize(_SizeX, 15*_SizeY); BackPlate.Size = new Vector2f(BoundingBox.Width, BoundingBox.Height); //BackPlate.Position = new Vector2f(BoxText.GetLocalBounds().Left, BoxText.GetLocalBounds().Top); //BackPlate.Size = new Vector2f((int)BoxText.GetGlobalBounds().Width, (int)BoxText.GetGlobalBounds().Height * 2); BackPlate.FillColor = Color.Magenta; }
void Awake() { Inst = this; // 获取当前线程上下文ID mainContextID = Thread.CurrentContext.ContextID; // 实例化所有的Manager num_manager = 7; mangers = new BaseManager[num_manager]; mangers[0] = new AsyncManager(); mangers[1] = new DataManager(); mangers[2] = new NetManager(); mangers[3] = new AssetManager(); mangers[4] = new SoundManager(); mangers[5] = new AlarmManager(); mangers[6] = new WindowManager(); //mangers[7] = new WindowAlertExecutor(); // 初始化日志 Logger.Initialize(); SendAwake(); }
void Aveva.ApplicationFramework.IAddin.Start(ServiceManager serviceManager) { mServiceManager = serviceManager; mWindowManager = (WindowManager)serviceManager.GetService(typeof(WindowManager)); mCommandBarManager = (CommandBarManager)serviceManager.GetService(typeof(CommandBarManager)); mCommandBarManager.RootTools.ToolAdded+=new ToolEventHandler(RootTools_ToolAdded); //Create an instance of Addin control mAddinControl = new NetGridAddinControl(); //Add the Addin mAddinWindow = (DockedWindow)mWindowManager.CreateDockedWindow("Grid Control Addin", "Grid Control Addin", mAddinControl, DockedPosition.Left); mAddinWindow.Width = 225; mAddinWindow.Closing +=new System.ComponentModel.CancelEventHandler(mAddinWindow_Closing); //Hide mAddinWindow.Hide(); //Load custom menus mCommandBarManager.UILoaded +=new EventHandler(mCommandBarManager_UILoaded); }
private static void Init() { Window = WindowManager.SpawnWindow(); Window.InitialTitle = Window.TitleText.text = Window.NonLocTitle = title; Window.MinSize.x = 670; Window.MinSize.y = 580; Window.name = "TrainerSettings"; Window.MainPanel.name = "TrainerSettingsPanel"; //Window.rectTransform = new RectTransform(); //Window.rectTransform.position = new Vector3 //{ // x = 50f, // y = 50f, // z = 0f //}; WindowManager.ActiveWindows.Add(Window); if (Window.name == "TrainerSettings") { Window.GetComponentsInChildren <Button>() .SingleOrDefault(x => x.name == "CloseButton") .onClick.AddListener(() => shown = false); } List <GameObject> Buttons = new List <GameObject>(); List <GameObject> col1 = new List <GameObject>(); List <GameObject> col2 = new List <GameObject>(); List <GameObject> col3 = new List <GameObject>(); Utils.AddInputBox("Product Name Here", new Rect(1, 96, 150, 32), boxText => TrainerBehaviour.price_ProductName = boxText); Utils.AddButton("Add Money", new Rect(1, 0, 150, 32), TrainerBehaviour.IncreaseMoney); Utils.AddButton("Add Reputation", new Rect(161, 0, 150, 32), TrainerBehaviour.AddRep); Utils.AddButton("Set Product Price", new Rect(161, 96, 150, 32), TrainerBehaviour.SetProductPrice); Utils.AddButton("Set Product Stock", new Rect(322, 96, 150, 32), TrainerBehaviour.SetProductStock); Utils.AddButton("Set Active Users", new Rect(483, 96, 150, 32), TrainerBehaviour.AddActiveUsers); Utils.AddButton("Max Followers", new Rect(1, 32, 150, 32), TrainerBehaviour.MaxFollowers); Utils.AddButton("Fix Bugs", new Rect(161, 32, 150, 32), TrainerBehaviour.FixBugs); Utils.AddButton("Max Code", new Rect(322, 32, 150, 32), TrainerBehaviour.MaxCode); Utils.AddButton("Max Art", new Rect(483, 32, 150, 32), TrainerBehaviour.MaxArt); Utils.AddButton("Takeover Company", new Rect(1, 160, 150, 32), TrainerBehaviour.TakeoverCompany); Utils.AddButton("Subsidiary Company", new Rect(161, 160, 150, 32), TrainerBehaviour.SubDCompany); Utils.AddButton("Bankrupt", new Rect(322, 160, 150, 32), TrainerBehaviour.ForceBankrupt); Utils.AddButton("AI Bankrupt All", TrainerBehaviour.AIBankrupt, ref Buttons); Utils.AddButton("Days per month", TrainerBehaviour.MonthDays, ref Buttons); Utils.AddButton("Clear all loans", TrainerBehaviour.ClearLoans, ref Buttons); Utils.AddButton("HR Leaders", TrainerBehaviour.HREmployees, ref Buttons); Utils.AddButton("Max Skill of employees", TrainerBehaviour.EmployeesToMax, ref Buttons); Utils.AddButton("Remove Products", TrainerBehaviour.RemoveSoft, ref Buttons); Utils.AddButton("Reset age of employees", TrainerBehaviour.ResetAgeOfEmployees, ref Buttons); Utils.AddButton("Sell products stock", TrainerBehaviour.SellProductStock, ref Buttons); Utils.AddButton("Unlock all furniture", TrainerBehaviour.UnlockAll, ref Buttons); Utils.AddButton("Unlock all space", TrainerBehaviour.UnlockAllSpace, ref Buttons); Utils.AddToggle("Disable Needs", TrainerBehaviour.LockNeeds, a => TrainerBehaviour.LockNeeds = !TrainerBehaviour.LockNeeds, ref col1); Utils.AddToggle("Disable Stress", TrainerBehaviour.LockStress, a => TrainerBehaviour.LockStress = !TrainerBehaviour.LockStress, ref col1); Utils.AddToggle("Free Employees", TrainerBehaviour.FreeEmployees, a => TrainerBehaviour.FreeEmployees = !TrainerBehaviour.FreeEmployees, ref col1); Utils.AddToggle("Free Staff", TrainerBehaviour.FreeStaff, a => TrainerBehaviour.FreeStaff = !TrainerBehaviour.FreeStaff, ref col1); Utils.AddToggle("Full Efficiency", TrainerBehaviour.LockEffSat, a => TrainerBehaviour.LockEffSat = !TrainerBehaviour.LockEffSat, ref col1); Utils.AddToggle("Full Satisfaction", TrainerBehaviour.LockSat, a => TrainerBehaviour.LockSat = !TrainerBehaviour.LockSat, ref col1); Utils.AddToggle("Lock Age of Employees", TrainerBehaviour.LockAge, a => TrainerBehaviour.LockAge = !TrainerBehaviour.LockAge, ref col1); Utils.AddToggle("No Vacation", TrainerBehaviour.NoVacation, a => TrainerBehaviour.NoVacation = !TrainerBehaviour.NoVacation, ref col1); Utils.AddToggle("No Sickness", TrainerBehaviour.NoSickness, a => TrainerBehaviour.NoSickness = !TrainerBehaviour.NoSickness, ref col1); Utils.AddToggle("Ultra Efficiency (Tick Full Eff first)", TrainerBehaviour.MaxOutEff, a => TrainerBehaviour.MaxOutEff = !TrainerBehaviour.MaxOutEff, ref col1); Utils.AddToggle("Full Environment", TrainerBehaviour.FullEnv, a => TrainerBehaviour.FullEnv = !TrainerBehaviour.FullEnv, ref col2); Utils.AddToggle("Full Sun Light", TrainerBehaviour.Fullbright, a => TrainerBehaviour.Fullbright = !TrainerBehaviour.Fullbright, ref col2); Utils.AddToggle("Lock Temperature To 21", TrainerBehaviour.TempLock, a => TrainerBehaviour.TempLock = !TrainerBehaviour.TempLock, ref col2); Utils.AddToggle("No Maintenance", TrainerBehaviour.NoMaintenance, a => TrainerBehaviour.NoMaintenance = !TrainerBehaviour.NoMaintenance, ref col2); Utils.AddToggle("Noise Reduction", TrainerBehaviour.NoiseRed, a => TrainerBehaviour.NoiseRed = !TrainerBehaviour.NoiseRed, ref col2); Utils.AddToggle("Rooms Never Dirty", TrainerBehaviour.CleanRooms, a => TrainerBehaviour.CleanRooms = !TrainerBehaviour.CleanRooms, ref col2); Utils.AddToggle("Auto Distribution Deals", TrainerBehaviour.dDeal, a => TrainerBehaviour.dDeal = !TrainerBehaviour.dDeal, ref col3); Utils.AddToggle("Free Print", TrainerBehaviour.FreePrint, a => TrainerBehaviour.FreePrint = !TrainerBehaviour.FreePrint, ref col3); Utils.AddToggle("Free Water & Electricity", TrainerBehaviour.NoWaterElect, a => TrainerBehaviour.NoWaterElect = !TrainerBehaviour.NoWaterElect, ref col3); Utils.AddToggle("Increase Bookshelf Skill", TrainerBehaviour.IncBookshelfSkill, a => TrainerBehaviour.IncBookshelfSkill = !TrainerBehaviour.IncBookshelfSkill, ref col3); Utils.AddToggle("Increase Courier Capacity", TrainerBehaviour.IncCourierCap, a => TrainerBehaviour.IncCourierCap = !TrainerBehaviour.IncCourierCap, ref col3); Utils.AddToggle("Increase Print Speed", TrainerBehaviour.IncPrintSpeed, a => TrainerBehaviour.IncPrintSpeed = !TrainerBehaviour.IncPrintSpeed, ref col3); Utils.AddToggle("More Hosting Deals", TrainerBehaviour.MoreHosting, a => TrainerBehaviour.MoreHosting = !TrainerBehaviour.MoreHosting, ref col3); Utils.AddToggle("Reduce Internet Cost", TrainerBehaviour.RedISPCost, a => TrainerBehaviour.RedISPCost = !TrainerBehaviour.RedISPCost, ref col3); Utils.DoLoops(Buttons.ToArray(), col1.ToArray(), col2.ToArray(), col3.ToArray()); }
public async void CloseScene() { await Base.GameManager.Instance.CloseScene(true); WindowManager.CloseWindow(); }
// Use this for initialization void Start() { console = GameObject.Find ("Console"); dev = console.GetComponent<DevOptions>(); resourceData = resourceValues.GetComponent<ResourceData> (); troopData = troopNumbers.GetComponent<TroopData> (); windowManager = window.GetComponent<WindowManager> (); var repo = ConsoleCommandsRepository.Instance; repo.RegisterCommand ("changetroops", ChangeTroops); repo.RegisterCommand ("closewindow", CloseWindow); repo.RegisterCommand ("debug", DebugOn); repo.RegisterCommand ("exit", Exit); repo.RegisterCommand ("foodrate", FoodRate); repo.RegisterCommand("help", Help); repo.RegisterCommand("load", Load); repo.RegisterCommand ("metalrate", MetalRate); repo.RegisterCommand ("openwindow", OpenWindow); repo.RegisterCommand ("stonerate", StoneRate); repo.RegisterCommand ("woodrate", WoodRate); }
public TextElemet(OoShapeObserver shape) { Shape = shape; if (shape != null) { Text = shape.Text; ScreenPosition = shape.GetRelativeScreenBoundsByDom(); ObjectBoundingBox = BrailleTextView.MakeZoomBoundingBox(ScreenPosition, WindowManager.GetPrintZoomLevel()); Matrix = BrailleTextView.BrailleRenderer.RenderMatrix(ObjectBoundingBox.Width, Text); Position = new Point(ObjectBoundingBox.X, ObjectBoundingBox.Y); Center = new Point(ObjectBoundingBox.X + (ObjectBoundingBox.Width / 2), ObjectBoundingBox.Y + (ObjectBoundingBox.Height / 2)); } else { Center = Position = new Point(); Matrix = new bool[0, 0]; ObjectBoundingBox = ScreenPosition = new Rectangle(); Text = String.Empty; } }
private void timer_Tick(object sender, EventArgs e) { timer.Stop(); WindowManager.UpdateAllScreensWindow("TipWindow", true); }
private void CUpdater_FileIdentifiersUpdated() { WindowManager.AddCallback(new Action(HandleFileIdentifierUpdate), null); }
protected override void OnClosed(EventArgs e) { base.OnClosed(e); WindowManager.RemoveDependencyBrowser(this); }
public void ShowGraphProperties() { var graphPropertiesView = new GraphPropertiesViewModel(Document); WindowManager?.ShowDialog(graphPropertiesView); }
public AppBootstrapper() { this.windowManager = new WindowManager(); }
public RDMPSingleControlTabMenu(IActivateItems activator, RDMPSingleControlTab tab, WindowManager windowManager) { _tab = tab; Items.Add("Close Tab", null, (s, e) => tab.Close()); Items.Add("Close All Tabs", null, (s, e) => windowManager.CloseAllWindows(tab)); Items.Add("Close All But This", null, (s, e) => windowManager.CloseAllButThis(tab)); Items.Add("Show", null, (s, e) => tab.HandleUserRequestingEmphasis(activator)); if (tab is PersistableSingleDatabaseObjectDockContent single) { var builder = new GoToMenuBuilder(activator); Items.Add(builder.GetMenu(single.DatabaseObject)); } Items.Add("Refresh", FamFamFamIcons.arrow_refresh, (s, e) => _tab.HandleUserRequestingTabRefresh(activator)); var help = new ToolStripMenuItem("Help", FamFamFamIcons.help, (s, e) => _tab.ShowHelp(activator)); help.ShortcutKeys = Keys.F1; Items.Add(help); }
public XNAOptionsPanel(WindowManager windowManager, UserINISettings iniSettings) : base(windowManager) { IniSettings = iniSettings; }
/// <summary> /// Initializes the main menu's controls. /// </summary> public override void Initialize() { GameProcessLogic.GameProcessExited += SharedUILogic_GameProcessExited; Name = "MainMenu"; BackgroundTexture = AssetLoader.LoadTexture("MainMenu\\mainmenubg.png"); ClientRectangle = new Rectangle(0, 0, BackgroundTexture.Width, BackgroundTexture.Height); WindowManager.CenterControlOnScreen(this); var btnNewCampaign = new XNAClientButton(WindowManager); btnNewCampaign.Name = "btnNewCampaign"; btnNewCampaign.IdleTexture = AssetLoader.LoadTexture("MainMenu\\campaign.png"); btnNewCampaign.HoverTexture = AssetLoader.LoadTexture("MainMenu\\campaign_c.png"); btnNewCampaign.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnNewCampaign.LeftClick += BtnNewCampaign_LeftClick; btnNewCampaign.HotKey = Keys.C; var btnLoadGame = new XNAClientButton(WindowManager); btnLoadGame.Name = "btnLoadGame"; btnLoadGame.IdleTexture = AssetLoader.LoadTexture("MainMenu\\loadmission.png"); btnLoadGame.HoverTexture = AssetLoader.LoadTexture("MainMenu\\loadmission_c.png"); btnLoadGame.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnLoadGame.LeftClick += BtnLoadGame_LeftClick; btnLoadGame.HotKey = Keys.L; var btnSkirmish = new XNAClientButton(WindowManager); btnSkirmish.Name = "btnSkirmish"; btnSkirmish.IdleTexture = AssetLoader.LoadTexture("MainMenu\\skirmish.png"); btnSkirmish.HoverTexture = AssetLoader.LoadTexture("MainMenu\\skirmish_c.png"); btnSkirmish.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnSkirmish.LeftClick += BtnSkirmish_LeftClick; btnSkirmish.HotKey = Keys.S; var btnCnCNet = new XNAClientButton(WindowManager); btnCnCNet.Name = "btnCnCNet"; btnCnCNet.IdleTexture = AssetLoader.LoadTexture("MainMenu\\cncnet.png"); btnCnCNet.HoverTexture = AssetLoader.LoadTexture("MainMenu\\cncnet_c.png"); btnCnCNet.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnCnCNet.LeftClick += BtnCnCNet_LeftClick; btnCnCNet.HotKey = Keys.M; var btnLan = new XNAClientButton(WindowManager); btnLan.Name = "btnLan"; btnLan.IdleTexture = AssetLoader.LoadTexture("MainMenu\\lan.png"); btnLan.HoverTexture = AssetLoader.LoadTexture("MainMenu\\lan_c.png"); btnLan.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnLan.LeftClick += BtnLan_LeftClick; btnLan.HotKey = Keys.N; var btnOptions = new XNAClientButton(WindowManager); btnOptions.Name = "btnOptions"; btnOptions.IdleTexture = AssetLoader.LoadTexture("MainMenu\\options.png"); btnOptions.HoverTexture = AssetLoader.LoadTexture("MainMenu\\options_c.png"); btnOptions.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnOptions.LeftClick += BtnOptions_LeftClick; btnOptions.HotKey = Keys.O; var btnMapEditor = new XNAClientButton(WindowManager); btnMapEditor.Name = "btnMapEditor"; btnMapEditor.IdleTexture = AssetLoader.LoadTexture("MainMenu\\mapeditor.png"); btnMapEditor.HoverTexture = AssetLoader.LoadTexture("MainMenu\\mapeditor_c.png"); btnMapEditor.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnMapEditor.LeftClick += BtnMapEditor_LeftClick; btnMapEditor.HotKey = Keys.E; var btnStatistics = new XNAClientButton(WindowManager); btnStatistics.Name = "btnStatistics"; btnStatistics.IdleTexture = AssetLoader.LoadTexture("MainMenu\\statistics.png"); btnStatistics.HoverTexture = AssetLoader.LoadTexture("MainMenu\\statistics_c.png"); btnStatistics.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnStatistics.LeftClick += BtnStatistics_LeftClick; btnStatistics.HotKey = Keys.T; var btnCredits = new XNAClientButton(WindowManager); btnCredits.Name = "btnCredits"; btnCredits.IdleTexture = AssetLoader.LoadTexture("MainMenu\\credits.png"); btnCredits.HoverTexture = AssetLoader.LoadTexture("MainMenu\\credits_c.png"); btnCredits.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnCredits.LeftClick += BtnCredits_LeftClick; btnCredits.HotKey = Keys.R; var btnExtras = new XNAClientButton(WindowManager); btnExtras.Name = "btnExtras"; btnExtras.IdleTexture = AssetLoader.LoadTexture("MainMenu\\extras.png"); btnExtras.HoverTexture = AssetLoader.LoadTexture("MainMenu\\extras_c.png"); btnExtras.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnExtras.LeftClick += BtnExtras_LeftClick; btnExtras.HotKey = Keys.E; var btnExit = new XNAClientButton(WindowManager); btnExit.Name = "btnExit"; btnExit.IdleTexture = AssetLoader.LoadTexture("MainMenu\\exitgame.png"); btnExit.HoverTexture = AssetLoader.LoadTexture("MainMenu\\exitgame_c.png"); btnExit.HoverSoundEffect = AssetLoader.LoadSound("MainMenu\\button.wav"); btnExit.LeftClick += BtnExit_LeftClick; XNALabel lblCnCNetStatus = new XNALabel(WindowManager); lblCnCNetStatus.Name = "lblCnCNetStatus"; lblCnCNetStatus.Text = "DTA players on CnCNet:"; lblCnCNetStatus.ClientRectangle = new Rectangle(12, 9, 0, 0); lblCnCNetPlayerCount = new XNALabel(WindowManager); lblCnCNetPlayerCount.Name = "lblCnCNetPlayerCount"; lblCnCNetPlayerCount.Text = "-"; lblVersion = new XNALabel(WindowManager); lblVersion.Name = "lblVersion"; lblVersion.Text = CUpdater.GameVersion; lblUpdateStatus = new XNALinkLabel(WindowManager); lblUpdateStatus.Name = "lblUpdateStatus"; lblUpdateStatus.LeftClick += LblUpdateStatus_LeftClick; lblUpdateStatus.ClientRectangle = new Rectangle(0, 0, 160, 20); AddChild(btnNewCampaign); AddChild(btnLoadGame); AddChild(btnSkirmish); AddChild(btnCnCNet); AddChild(btnLan); AddChild(btnOptions); AddChild(btnMapEditor); AddChild(btnStatistics); AddChild(btnCredits); AddChild(btnExtras); AddChild(btnExit); AddChild(lblCnCNetStatus); AddChild(lblCnCNetPlayerCount); if (!ClientConfiguration.Instance.ModMode) { // ModMode disables version tracking and the updater if it's enabled AddChild(lblVersion); AddChild(lblUpdateStatus); CUpdater.FileIdentifiersUpdated += CUpdater_FileIdentifiersUpdated; CUpdater.OnCustomComponentsOutdated += CUpdater_OnCustomComponentsOutdated; } innerPanel = new MainMenuDarkeningPanel(WindowManager); innerPanel.ClientRectangle = new Rectangle(0, 0, ClientRectangle.Width, ClientRectangle.Height); AddChild(innerPanel); innerPanel.Hide(); base.Initialize(); // Read control attributes from INI innerPanel.UpdateQueryWindow.UpdateDeclined += UpdateQueryWindow_UpdateDeclined; innerPanel.UpdateQueryWindow.UpdateAccepted += UpdateQueryWindow_UpdateAccepted; innerPanel.UpdateWindow.UpdateCompleted += UpdateWindow_UpdateCompleted; innerPanel.UpdateWindow.UpdateCancelled += UpdateWindow_UpdateCancelled; innerPanel.UpdateWindow.UpdateFailed += UpdateWindow_UpdateFailed; this.ClientRectangle = new Rectangle((WindowManager.RenderResolutionX - ClientRectangle.Width) / 2, (WindowManager.RenderResolutionY - ClientRectangle.Height) / 2, ClientRectangle.Width, ClientRectangle.Height); innerPanel.ClientRectangle = new Rectangle(0, 0, WindowManager.RenderResolutionX, WindowManager.RenderResolutionY); CnCNetPlayerCountTask.CnCNetGameCountUpdated += CnCNetInfoController_CnCNetGameCountUpdated; cncnetPlayerCountCancellationSource = new CancellationTokenSource(); CnCNetPlayerCountTask.InitializeService(cncnetPlayerCountCancellationSource); WindowManager.GameClosing += WindowManager_GameClosing; skirmishLobby.Exited += SkirmishLobby_Exited; lanLobby.Exited += LanLobby_Exited; optionsWindow.EnabledChanged += OptionsWindow_EnabledChanged; GameProcessLogic.GameProcessStarted += SharedUILogic_GameProcessStarted; GameProcessLogic.GameProcessStarting += SharedUILogic_GameProcessStarting; UserINISettings.Instance.SettingsSaved += SettingsSaved; CUpdater.Restart += CUpdater_Restart; }
private void BtnExit_LeftClick(object sender, EventArgs e) { FadeMusicExit(); WindowManager.HideWindow(); }
// Actions // public void ShowAbout() { WindowManager?.ShowDialog(new AboutViewModel()); }
/// <summary> /// 不需要主动调用,绑定到界面的关闭或返回按钮就行 /// </summary> protected virtual void Close() { WindowManager.GetSingleton().Close(); }
public SkirmishLobby(WindowManager windowManager, TopBar topBar, List <GameMode> GameModes, DiscordHandler discordHandler) : base(windowManager, "SkirmishLobby", GameModes, false, discordHandler) { this.topBar = topBar; }
// Use this for initialization void Start() { gameObject.GetComponent<Button>().onClick.AddListener(() => { click(); }); window = GameObject.Find ("Window").GetComponent<WindowManager>(); }
public ModelOrientationControl(ref RayCaster raycaster, WindowManager wm) : this(((IRenderEngine)raycaster), wm) { }
private void Finish() { if (!ClientConfiguration.Instance.ModMode) { ProgramConstants.GAME_VERSION = CUpdater.GameVersion; } var gameCollection = new GameCollection(); gameCollection.Initialize(GraphicsDevice); var lanLobby = new LANLobby(WindowManager, gameCollection, mapLoader.GameModes); var cncnetManager = new CnCNetManager(WindowManager, gameCollection); var tunnelHandler = new TunnelHandler(WindowManager, cncnetManager); var topBar = new TopBar(WindowManager, cncnetManager); var optionsWindow = new OptionsWindow(WindowManager, gameCollection, topBar); var pmWindow = new PrivateMessagingWindow(WindowManager, cncnetManager, gameCollection); privateMessagingPanel = new PrivateMessagingPanel(WindowManager); var cncnetGameLobby = new CnCNetGameLobby(WindowManager, "MultiplayerGameLobby", topBar, mapLoader.GameModes, cncnetManager, tunnelHandler, gameCollection); var cncnetGameLoadingLobby = new CnCNetGameLoadingLobby(WindowManager, topBar, cncnetManager, tunnelHandler, mapLoader.GameModes, gameCollection); var cncnetLobby = new CnCNetLobby(WindowManager, cncnetManager, cncnetGameLobby, cncnetGameLoadingLobby, topBar, pmWindow, tunnelHandler, gameCollection); var gipw = new GameInProgressWindow(WindowManager); var skirmishLobby = new SkirmishLobby(WindowManager, topBar, mapLoader.GameModes); topBar.SetSecondarySwitch(cncnetLobby); var mainMenu = new MainMenu(WindowManager, skirmishLobby, lanLobby, topBar, optionsWindow, cncnetLobby, cncnetManager); WindowManager.AddAndInitializeControl(mainMenu); DarkeningPanel.AddAndInitializeWithControl(WindowManager, skirmishLobby); DarkeningPanel.AddAndInitializeWithControl(WindowManager, cncnetGameLoadingLobby); DarkeningPanel.AddAndInitializeWithControl(WindowManager, cncnetGameLobby); DarkeningPanel.AddAndInitializeWithControl(WindowManager, cncnetLobby); DarkeningPanel.AddAndInitializeWithControl(WindowManager, lanLobby); DarkeningPanel.AddAndInitializeWithControl(WindowManager, optionsWindow); WindowManager.AddAndInitializeControl(privateMessagingPanel); privateMessagingPanel.AddChild(pmWindow); topBar.SetTertiarySwitch(pmWindow); WindowManager.AddAndInitializeControl(gipw); skirmishLobby.Disable(); cncnetLobby.Disable(); cncnetGameLobby.Disable(); cncnetGameLoadingLobby.Disable(); lanLobby.Disable(); pmWindow.Disable(); optionsWindow.Disable(); WindowManager.AddAndInitializeControl(topBar); topBar.AddPrimarySwitchable(mainMenu); WindowManager.AddAndInitializeControl(new PrivateMessageNotificationBox(WindowManager)); mainMenu.PostInit(); if (UserINISettings.Instance.AutomaticCnCNetLogin && NameValidator.IsNameValid(ProgramConstants.PLAYERNAME) == null) { cncnetManager.Connect(); } WindowManager.RemoveControl(this); Cursor.Visible = visibleSpriteCursor; }
public async void TestMainWindowThenMessageBoxThenBackgroundModalBoxReverseClose() { LoggerResult loggerResult; const string messageBoxName = nameof(TestMainWindowThenMessageBoxThenBackgroundModalBoxReverseClose); var dispatcher = await WindowManagerHelper.CreateUIThread(); using (WindowManagerHelper.InitWindowManager(dispatcher, out loggerResult)) { var window = dispatcher.Invoke(() => new StandardWindow()); // Open the main window var shown = WindowManagerHelper.NextMainWindowChanged(window); dispatcher.Invoke(() => WindowManager.ShowMainWindow(window)); await WindowManagerHelper.TaskWithTimeout(shown); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowsStatus(window); }); // Open a message box var messageBoxOpened = WindowManagerHelper.NextMessageBoxOpened(); dispatcher.InvokeAsync(() => MessageBox.Show("Test", messageBoxName)); await WindowManagerHelper.TaskWithTimeout(messageBoxOpened); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowsStatus(window, null); }); // Open a modal window var modalWindow = dispatcher.Invoke(() => new StandardWindow { Title = messageBoxName }); var modalWindowOpened = WindowManagerHelper.NextModalWindowOpened(modalWindow); dispatcher.InvokeAsync(() => WindowManager.ShowModal(modalWindow, WindowOwner.MainWindow)); await WindowManagerHelper.TaskWithTimeout(modalWindowOpened); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowsStatus(window, modalWindow, null); }); // Close the modal window var modalWindowInfo = WindowManager.ModalWindows[0]; var modalWindowClosed = WindowManagerHelper.NextModalWindowClosed(modalWindow); dispatcher.Invoke(() => modalWindow.Close()); await WindowManagerHelper.TaskWithTimeout(modalWindowClosed); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowClosed(modalWindowInfo); WindowManagerHelper.AssertWindowsStatus(window, null); }); // Close the messageBox var messageBoxInfo = WindowManager.ModalWindows[0]; var messageBoxClosed = WindowManagerHelper.NextMessageBoxClosed(); WindowManagerHelper.KillWindow(messageBoxInfo.Hwnd); await WindowManagerHelper.TaskWithTimeout(messageBoxClosed); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowClosed(messageBoxInfo); WindowManagerHelper.AssertWindowsStatus(window); }); // Close the main window var mainWindow = WindowManager.MainWindow; var hidden = WindowManagerHelper.NextMainWindowChanged(null); dispatcher.Invoke(() => window.Close()); await WindowManagerHelper.TaskWithTimeout(hidden); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowClosed(mainWindow); WindowManagerHelper.AssertWindowsStatus(null); }); } Assert.AreEqual(false, loggerResult.HasErrors); dispatcher.InvokeShutdown(); }
private void CUpdater_Restart(object sender, EventArgs e) { WindowManager.AddCallback(new Action(WindowManager.CloseGame), null); }
/// <summary> /// 创建默认的提示界面布局UI /// </summary> /// <param name="themeName">主题名</param> /// <param name="screenName">屏幕名称</param> /// <returns></returns> public UIDesignModel GetCreateDefaultTipWindowUI( string themeName, string screenName) { screenName = screenName.Replace("\\", ""); var screen = System.Windows.Forms.Screen.PrimaryScreen; if (screenName != string.Empty) { foreach (var item in System.Windows.Forms.Screen.AllScreens) { string itemScreenName = item.DeviceName.Replace("\\", ""); if (itemScreenName == screenName) { screen = item; break; } } } var screenSize = WindowManager.GetSize(screen); //创建默认布局 var data = new UIDesignModel(); data.ContainerAttr = new ContainerModel() { Background = Brushes.White, Opacity = .98 }; var elements = new List <ElementModel>(); var tipimage = new ElementModel(); tipimage.Type = Project1.UI.Controls.Enums.DesignItemType.Image; tipimage.Width = 272; tipimage.Opacity = 1; tipimage.Height = 187; tipimage.Image = $"pack://application:,,,/ProjectEye;component/Resources/Themes/{themeName}/Images/tipImage.png"; tipimage.X = screenSize.Width / 2 - tipimage.Width / 2; tipimage.Y = screenSize.Height * .24; var tipText = new ElementModel(); tipText.Type = Project1.UI.Controls.Enums.DesignItemType.Text; tipText.Text = "您已持续用眼{t}分钟,休息一会吧!请将注意力集中在至少6米远的地方20秒!"; tipText.Opacity = 1; tipText.TextColor = Project1UIColor.Get("#45435b"); tipText.Width = 400; tipText.Height = 50; tipText.X = screenSize.Width / 2 - tipText.Width / 2; tipText.Y = tipimage.Y + tipimage.Height + tipText.Height + 10; tipText.FontSize = 20; var restBtn = new ElementModel(); restBtn.Type = Project1.UI.Controls.Enums.DesignItemType.Button; restBtn.Width = 110; restBtn.Height = 45; restBtn.FontSize = 14; restBtn.Text = "好的"; restBtn.Opacity = 1; restBtn.Command = "rest"; restBtn.X = screenSize.Width / 2 - (restBtn.Width * 2 + 10) / 2; restBtn.Y = tipText.Y + tipText.Height + 20; var breakBtn = new ElementModel(); breakBtn.Type = Project1.UI.Controls.Enums.DesignItemType.Button; breakBtn.Width = 110; breakBtn.Height = 45; breakBtn.FontSize = 14; breakBtn.Text = "暂时不"; breakBtn.Style = "basic"; breakBtn.Command = "break"; breakBtn.Opacity = 1; breakBtn.X = screenSize.Width / 2 - (restBtn.Width * 2 + 10) / 2 + (restBtn.Width + 10); breakBtn.Y = tipText.Y + tipText.Height + 20; var countDownText = new ElementModel(); countDownText.Text = "{countdown}"; countDownText.FontSize = 50; countDownText.IsTextBold = true; countDownText.Type = Project1.UI.Controls.Enums.DesignItemType.Text; countDownText.TextColor = Brushes.Black; countDownText.Opacity = 1; countDownText.Width = 100; countDownText.Height = 60; countDownText.X = screenSize.Width / 2 - countDownText.Width / 2; countDownText.Y = restBtn.Y + restBtn.Height; if (themeName == "Dark") { //深色主题的样式 data.ContainerAttr.Background = Project1UIColor.Get("#1A1B1C"); tipText.TextColor = Project1UIColor.Get("#D9D9D9"); countDownText.TextColor = Project1UIColor.Get("#D9D9D9"); } elements.Add(tipimage); elements.Add(tipText); elements.Add(restBtn); elements.Add(breakBtn); elements.Add(countDownText); data.Elements = elements; return(data); }
public override void onCreate() { base.onCreate(); mWindowManager = (WindowManager)getSystemService(Context.WINDOW_SERVICE); mNotificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); //mLayoutInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); startedForeground = false; }
// Use this for initialization void Start() { window = GameObject.Find ("Window").GetComponent<WindowManager> (); }
public async void TestMainWindowThenModalBoxThenBackgroundModal() { LoggerResult loggerResult; const string messageBoxName = nameof(TestMainWindowThenModalBoxThenBackgroundModal); var dispatcher = await WindowManagerHelper.CreateUIThread(); using (WindowManagerHelper.InitWindowManager(dispatcher, out loggerResult)) { var window = dispatcher.Invoke(() => new StandardWindow()); // Open the main window var shown = WindowManagerHelper.NextMainWindowChanged(window); dispatcher.Invoke(() => WindowManager.ShowMainWindow(window)); await WindowManagerHelper.TaskWithTimeout(shown); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowsStatus(window); }); // Open a first modal window var modalWindow1 = dispatcher.Invoke(() => new StandardWindow { Title = messageBoxName }); var modalWindow1Opened = WindowManagerHelper.NextModalWindowOpened(modalWindow1); dispatcher.InvokeAsync(() => WindowManager.ShowModal(modalWindow1)); await WindowManagerHelper.TaskWithTimeout(modalWindow1Opened); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowsStatus(window, modalWindow1); }); // Open a second modal window in background var modalWindow2 = dispatcher.Invoke(() => new StandardWindow { Title = messageBoxName }); var modalWindow2Opened = WindowManagerHelper.NextModalWindowOpened(modalWindow2); dispatcher.InvokeAsync(() => WindowManager.ShowModal(modalWindow2, WindowOwner.MainWindow)); await WindowManagerHelper.TaskWithTimeout(modalWindow2Opened); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowsStatus(window, modalWindow2, modalWindow1); }); // Close the first modal window var modalWindow1Info = WindowManager.ModalWindows[1]; var modalWindow1Closed = WindowManagerHelper.NextModalWindowClosed(modalWindow1); dispatcher.Invoke(() => modalWindow1.Close()); await WindowManagerHelper.TaskWithTimeout(modalWindow1Closed); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowClosed(modalWindow1Info); WindowManagerHelper.AssertWindowsStatus(window, modalWindow2); }); // Close the second modal window var modalWindow2Info = WindowManager.ModalWindows[0]; var modalWindow2Closed = WindowManagerHelper.NextModalWindowClosed(modalWindow2); dispatcher.Invoke(() => modalWindow2.Close()); await WindowManagerHelper.TaskWithTimeout(modalWindow2Closed); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowClosed(modalWindow2Info); WindowManagerHelper.AssertWindowsStatus(window); }); // Close the main window var mainWindow = WindowManager.MainWindow; var hidden = WindowManagerHelper.NextMainWindowChanged(null); dispatcher.Invoke(() => window.Close()); await WindowManagerHelper.TaskWithTimeout(hidden); dispatcher.Invoke(() => { WindowManagerHelper.AssertWindowClosed(mainWindow); WindowManagerHelper.AssertWindowsStatus(null); }); } Assert.AreEqual(false, loggerResult.HasErrors); dispatcher.InvokeShutdown(); }
public MenuState(WindowManager WM) : base(WM) { WM.AddWindow(new Windows.MainMenu(WM,this, 100, 100, 250, 200)); }
public async void TestSameModalTwice() { LoggerResult loggerResult; const string messageBoxName = nameof(TestMainWindowThenModalBoxCloseMain); var dispatcher = await WindowManagerHelper.CreateUIThread(); using (WindowManagerHelper.InitWindowManager(dispatcher, out loggerResult)) { // Open a modal window var modalWindow = dispatcher.Invoke(() => new StandardWindow { Title = messageBoxName }); var modalWindowOpened = WindowManagerHelper.NextModalWindowOpened(modalWindow); dispatcher.InvokeAsync(() => WindowManager.ShowModal(modalWindow)); await WindowManagerHelper.TaskWithTimeout(modalWindowOpened); dispatcher.Invoke(() => WindowManagerHelper.AssertWindowsStatus(null, modalWindow)); // Try to open it again without having closed it Assert.Throws <InvalidOperationException>(() => dispatcher.Invoke(() => WindowManager.ShowModal(modalWindow))); } Assert.AreEqual(false, loggerResult.HasErrors); dispatcher.InvokeShutdown(); }
public LoadingScreen(WindowManager windowManager) : base(windowManager) { }
public SplashView() { InitializeComponent(); WindowManager.SetSplashView(this); }
private void Awake() { _instance = this; }
public virtual void SetServiceProvider(IServiceProvider serviceProvider) { _windowManager = (WindowManager)serviceProvider.GetService(typeof(IWindowManager)); _lookup = new LookupHelper(_windowManager); }
public RecentPlayerTable(WindowManager windowManager, CnCNetManager connectionManager) : base(windowManager) { this.connectionManager = connectionManager; }
public CnCNetOptionsPanel(WindowManager windowManager, UserINISettings iniSettings, GameCollection gameCollection) : base(windowManager, iniSettings) { this.gameCollection = gameCollection; }
/// <summary> /// When the Window Manager is loaded, /// it registers itself into the GameInstance with this method. /// </summary> /// <param name="pWindowManager">Current level Game Manager</param> public static void SetCurrentWindowManager(WindowManager pWindowManager) { _currentWindowManager = pWindowManager; }
private void Restart() { WindowManager.CloseWindow(); StateMachine.Restart(); }
public DarkeningPanel(WindowManager windowManager) : base(windowManager) { }
public CampaignSelector(WindowManager windowManager) : base(windowManager) { }