예제 #1
0
 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();
 }
예제 #2
0
        /* 서버 연결 해제 */
        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");
 }
예제 #4
0
 private void Internal_Open(string displayedText, Mark markAction, Quit quitAction)
 {
     this.displayedText.text = displayedText;
     OnMark = markAction;
     OnQuit = quitAction;
     Show(true);
 }
예제 #5
0
        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));
                }
            }
        }
예제 #6
0
 protected virtual void OnQuit()
 {
     if (Quit != null)
     {
         Quit.Invoke(this, EventArgs.Empty);
     }
 }
예제 #7
0
        /// <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;
                }
                }
            }
        }
예제 #8
0
        public void Execute_OfQuit_Converts()
        {
            var quit = new Quit();

            var actual = quit.ToString();

            Assert.AreEqual("QUIT", actual);
        }
예제 #9
0
파일: Menu.cs 프로젝트: x3lq/imge2016
 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());
        }
예제 #11
0
 /// <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>());
     }
 }
예제 #12
0
        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);
            }
        }
예제 #13
0
        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);
        }
예제 #14
0
    void Start()
    {
        Button BeginBtn = Begin.GetComponent <Button>();

        BeginBtn.onClick.AddListener(BeginClick);
        Button QuitBtn = Quit.GetComponent <Button>();

        QuitBtn.onClick.AddListener(QuitClick);
    }
예제 #15
0
        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());
        }
예제 #17
0
        public void Execute_OfQuit_ClosesRunTimeEnvironment()
        {
            var rte  = MakeRunTimeEnvironment();
            var quit = new Quit();

            quit.Execute(rte);

            Assert.IsTrue(rte.IsClosed);
        }
예제 #18
0
 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);
 }
예제 #19
0
파일: Menu.cs 프로젝트: x3lq/imge2016
 public void play()
 {
     Play.SetActive(false);
     Options.SetActive(false);
     Quit.SetActive(false);
     Standard.SetActive(true);
     TimeTrial.SetActive(true);
     Hatefest.SetActive(true);
     MainMenu.SetActive(true);
 }
예제 #20
0
        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");
 }
예제 #22
0
 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();
 }
예제 #23
0
        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);
     }
 }
예제 #25
0
 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);
 }
예제 #26
0
        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)));
        }
예제 #27
0
 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);
 }
예제 #28
0
    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);
     }
 }
예제 #30
0
 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);
     }
 }
예제 #31
0
    void Start()
    {
        selectables = new SelectableItem[InspectorSelects.Length];
        selectables[0] = new Start(InspectorSelects[0]);
        selectables[1] = new Quit(InspectorSelects[1]);

        selectables[currentSelected].Hover();
    }