public static void RunUpdate() { while (IsCleaning) { ; } try { using (Stream stream = Application.GetResourceStream(new Uri(UpdaterUri, UriKind.Relative)).Stream) { using (FileStream fileStream = new FileStream(UpdaterPath, FileMode.OpenOrCreate, FileAccess.Write)) { stream.CopyTo(fileStream); } } Process.Start(UpdaterPath, string.Format("\"{0}\"", Process.GetCurrentProcess().MainModule.FileName)); } catch (UnauthorizedAccessException) { ProcessStartInfo processStartInfo = new ProcessStartInfo(Process.GetCurrentProcess().MainModule.FileName, "-update") { Verb = "runas" }; Process.Start(processStartInfo); } Quit?.Invoke(); }
/* 서버 연결 해제 */ public void Disconnect() { if (!_isConnect) { return; } _isConnect = false; Quit quit = new Quit(); quit.Type = (int)PacketType.QUIT; Packet.Serialize(quit).CopyTo(_sendBuffer, 0); Send(); _client.Close(); _networkstream.Close(); _thClient.Abort(); _isLogin = false; btnLogin.Text = "로그인"; btnLogin.ForeColor = Color.Black; picHome.BackColor = System.Drawing.SystemColors.Control; pnlHome.Visible = false; picSearch.BackColor = System.Drawing.SystemColors.Control; pnlSearch.Visible = false; picUpload.BackColor = System.Drawing.SystemColors.Control; pnlUpload.Visible = false; picMypage.BackColor = System.Drawing.SystemColors.Control; pnlMypage.Visible = false; }
public void GameOver() { killed.text = "You Killed: " + killenemy + " enemy!"; Restart.SetActive(true); Quit.SetActive(true); FindObjectOfType <AudioManager>().Play("End"); }
private void Internal_Open(string displayedText, Mark markAction, Quit quitAction) { this.displayedText.text = displayedText; OnMark = markAction; OnQuit = quitAction; Show(true); }
public override void Update() { base.Update(); Menu.Update(); if (Menu.Press()) { SceneManager.ChangeScene(SceneManager.menuScene); SceneManager.started = false; } Quit.Update(); if (Quit.Press()) { Game1.Quit(); } if (Globals.Randomizer.Next(0, 101) < 3 && timer < 0) { timer = 15; fireworksPosition = new Vector2(Globals.Randomizer.Next(100, Globals.ScreenSize.X - 100), Globals.Randomizer.Next(100, Globals.ScreenSize.Y - 100)); SoundManager.victory.Play(); } timer--; if (timer > 0) { for (int i = 0; i < Globals.Randomizer.Next(30, 50); i++) { SceneManager.GameObjects.Add(new Firework(fireworksPosition)); } } }
protected virtual void OnQuit() { if (Quit != null) { Quit.Invoke(this, EventArgs.Empty); } }
/// <summary> /// Sleep up to <paramref name="milliSeconds"/> milliseconds, waking to process events /// </summary> /// <param name="milliSeconds"></param> public void SleepUntilInput(int milliSeconds) { InputSystem.ProcessEvents(milliSeconds); var snapshot = InputSystem.Snapshot; for (var i = 0; i < snapshot.Events.Count; ++i) { var sdlEvent = snapshot.Events[i]; switch (sdlEvent.type) { case SDL.SDL_EventType.SDL_WINDOWEVENT: { Window.ProcessEvent(ref sdlEvent); break; } case SDL.SDL_EventType.SDL_QUIT: { Quit?.Invoke(); break; } } } }
public void Execute_OfQuit_Converts() { var quit = new Quit(); var actual = quit.ToString(); Assert.AreEqual("QUIT", actual); }
public void options() { Play.SetActive(false); Options.SetActive(false); Quit.SetActive(false); Replay.SetActive(true); MainMenu.SetActive(true); }
public string Quit() { ValidateNotDisposed(); using var connection = new RedisConnection(_connectionSettings); var command = new Quit(connection.GetStream()); return(command.Execute()); }
/// <summary> /// 退出会话 /// </summary> /// <param name="accessToken"></param> /// <param name="body"></param> /// <param name="requestUrl"></param> /// <returns></returns> public ResponseResult Quit(string accessToken, Quit body, string requestUrl = "https://qyapi.weixin.qq.com/cgi-bin/chat/quit") { using (WebClient client = new WebClient()) { client.Headers.Add(HttpRequestHeader.ContentType, "application/json"); byte[] bytes = client.UploadData($"{requestUrl}?access_token={accessToken}", "POST", body.ToBytes()); return(bytes.ConvertTo <ResponseResult>()); } }
void CreateMenuToolBar() { var newgame = new NewGame(_gameVM); var loadgame = new LoadGame(_gameVM); var quit = new Quit(_gameVM); var playerOptions = new PlayerOptionsCMD(_gameVM); savegame = new SaveGame(_gameVM); sysMap = new SystemMap(_gameVM); colView = new ColonyView(_gameVM); componentDesign = new ComponentDesignViewCMD(_gameVM); shipDesign = new ShipDesignViewCMD(_gameVM); missileDesign = new MissileDesignCMD(_gameVM); componentTemplateDesign = new ComponentTemplateViewCMD(_gameVM); shipView = new ShipViewCMD(_gameVM); sysInfoView = new SystemInfoCMD(_gameVM); logView = new LogViewCMD(_gameVM); if (Platform.Supports <MenuBar>()) { Menu = new MenuBar { ApplicationItems = { newgame, new SeparatorMenuItem(), savegame, loadgame, new SeparatorMenuItem(), playerOptions, new SeparatorMenuItem(), quit }, HelpItems = { new Command { MenuText = "Help Command" } } }; } if (Platform.Supports <ToolBar>()) { // create and set the toolbar ToolBar = new ToolBar(); ToolBar.Items.Add(sysMap); ToolBar.Items.Add(colView); ToolBar.Items.Add(componentDesign); ToolBar.Items.Add(shipDesign); ToolBar.Items.Add(missileDesign); ToolBar.Items.Add(componentTemplateDesign); ToolBar.Items.Add(shipView); ToolBar.Items.Add(sysInfoView); ToolBar.Items.Add(logView); } }
public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); spriteBatch.DrawString(TextureManager.SpriteFont20, "Victory!", new Vector2(Globals.ScreenSize.X / 2 - 70, 20), new Color(0, 255, 255), 0f, Vector2.Zero, 1.5f, SpriteEffects.None, 0f); Menu.Draw(spriteBatch); Quit.Draw(spriteBatch); }
void Start() { Button BeginBtn = Begin.GetComponent <Button>(); BeginBtn.onClick.AddListener(BeginClick); Button QuitBtn = Quit.GetComponent <Button>(); QuitBtn.onClick.AddListener(QuitClick); }
private Quit DataRowToQuit(DataRow dr) { Quit quit = new Quit(); quit.Id = Convert.ToInt32(dr["id"]); quit.Quit_date = Convert.ToDateTime(dr["quit_date"]); quit.Quit_reason = Convert.ToString(dr["quit_reason"]); return(quit); }
public async Task <string> QuitAsync() { ValidateNotDisposed(); using var connection = new RedisConnection(_connectionSettings); var command = new Quit(connection.GetStream()); return(await command.ExecuteAsync()); }
public void Execute_OfQuit_ClosesRunTimeEnvironment() { var rte = MakeRunTimeEnvironment(); var quit = new Quit(); quit.Execute(rte); Assert.IsTrue(rte.IsClosed); }
private void Menu_Paint(object sender, PaintEventArgs e) { Play.Draw(e.Graphics); Achiev.Draw(e.Graphics); Quit.Draw(e.Graphics); Leaderboards.Draw(e.Graphics); Easy.Draw(e.Graphics); Medium.Draw(e.Graphics); Hard.Draw(e.Graphics); }
public void play() { Play.SetActive(false); Options.SetActive(false); Quit.SetActive(false); Standard.SetActive(true); TimeTrial.SetActive(true); Hatefest.SetActive(true); MainMenu.SetActive(true); }
public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); spriteBatch.DrawString(TextureManager.SpriteFont20, "Game Over", new Vector2(400, 60), Color.Red, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); SceneManager.mapScene.KilledPlayer.DrawGameOver(spriteBatch); SceneManager.mapScene.KilledPlayer.Direction = SceneManager.mapScene.KilledPlayer.StandardDirection; Quit.Draw(spriteBatch); Menu.Draw(spriteBatch); }
// Update is called once per frame private void Start() { PlayerPrefs.SetInt("EnemyAmount", 0); buffOn = false; bufftime = 0f; hp = maxhp; killenemy = 0; Restart.SetActive(false); Quit.SetActive(false); //FindObjectOfType<AudioManager>().Play("Start"); }
private void Menu_MouseMove(object sender, MouseEventArgs e) { Play.isHit(e.X, e.Y); Achiev.isHit(e.X, e.Y); Leaderboards.isHit(e.X, e.Y); Quit.isHit(e.X, e.Y); Easy.isHit(e.X, e.Y); Medium.isHit(e.X, e.Y); Hard.isHit(e.X, e.Y); Invalidate(); }
public Pop3CommandResult ExecuteQuit() { Quit cm = new Quit(); Pop3CommandResult rs = null; String s = ""; this.EnsureOpen(); s = this.Execute(cm); rs = new Pop3CommandResult(s); return(rs); }
private void CheckBattleOver() { Debug.Log("Allies : " + allyCount + ", Ennemies : " + ennemyCount); if (allyCount <= 0) { Quit.DoQuit(); } if (ennemyCount <= 0) { SceneManager.LoadScene(GlobalContext.precSceneName); } }
void AllOff() { New.SetActive(false); Load.SetActive(false); Setting.SetActive(false); About.SetActive(false); Quit.SetActive(false); _AboutClicked.SetActive(false); _SettingClicked.SetActive(false); _SettingClicked2.SetActive(false); _LoadClicked.SetActive(false); }
public Task Execute(Quit c) { var quitTime = c.QuitTimestamp ?? c.Timestamp; var scanInfo = new ScanInfo( c.HappeningId, c.CheckpointId, c.PersonId, c.Id, c.Timestamp, quitTime, c.Context.User); return(this.repository.Execute(c.HappeningId, h => h.Quit( scanInfo, c.WalkedSinceLast, c.Description))); }
void Start() { health = 4; Heart1.SetActive(true); Heart2.SetActive(true); Heart3.SetActive(true); Heart4.SetActive(true); gameOver.SetActive(false); Restart.SetActive(false); MainMenu.SetActive(false); Quit.SetActive(false); }
private void Awake() { if (instance) { Destroy(gameObject); } else { instance = this; } words = GetComponent <Words>(); makeWalls = GetComponent <DungeonGenerator>(); quit = GetComponent <Quit>(); if (players.Length == 0) { players = new GameObject[4]; players[0] = GameObject.Find("Player1"); players[1] = GameObject.Find("Player2"); players[2] = GameObject.Find("Player3"); players[3] = GameObject.Find("Player4"); } if (textOverlayHandlers.Length == 0) { textOverlayHandlers = new TextOverlayHandler[4]; textOverlayHandlers[0] = GameObject.Find("PlayerUI1").transform.Find("WordList").GetComponent <TextOverlayHandler>(); textOverlayHandlers[1] = GameObject.Find("PlayerUI2").transform.Find("WordList").GetComponent <TextOverlayHandler>(); textOverlayHandlers[2] = GameObject.Find("PlayerUI3").transform.Find("WordList").GetComponent <TextOverlayHandler>(); textOverlayHandlers[3] = GameObject.Find("PlayerUI4").transform.Find("WordList").GetComponent <TextOverlayHandler>(); } if (cameras.Length == 0) { cameras = new Camera[4]; cameras[0] = GameObject.Find("Camera1").GetComponent <Camera>(); cameras[1] = GameObject.Find("Camera2").GetComponent <Camera>(); cameras[2] = GameObject.Find("Camera3").GetComponent <Camera>(); cameras[3] = GameObject.Find("Camera4").GetComponent <Camera>(); } SceneManager.sceneLoaded += FindPauseMenu; sfx = new Dictionary <string, AudioSource>(); GameObject sfxContainer = GameObject.Find("SFX"); foreach (Transform child in sfxContainer.transform) { if (child.gameObject.GetComponent <AudioSource>()) { sfx.Add(child.gameObject.name, child.gameObject.GetComponent <AudioSource>()); } } }
private void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + Id.GetHashCode(); hash = hash * 23 + Success.GetHashCode(); hash = hash * 23 + Fail.GetHashCode(); hash = hash * 23 + Quit.GetHashCode(); hash = hash * 23 + Level.GetHashCode(); return(hash); } }
void Start() { selectables = new SelectableItem[InspectorSelects.Length]; selectables[0] = new Start(InspectorSelects[0]); selectables[1] = new Quit(InspectorSelects[1]); selectables[currentSelected].Hover(); }