예제 #1
0
        /// <summary>
        /// Constructor. Instantiates the event handlers and the database connection.
        /// </summary>
        /// <param name="m_Current_Name"> The old name of the profile. </param>
        public frm_Renaming(string m_Current_Name)
        {
            InitializeComponent();

            db_Link = new DB_Connect();

            current_Name = m_Current_Name;

            //Sound cues
            pic_Renaming_Confirm.MouseEnter += new System.EventHandler(this.play_Sound_Enter);
            pic_Renaming_Cancel.MouseEnter  += new System.EventHandler(this.play_Sound_Enter);
        }
예제 #2
0
        /// <summary>
        /// Constructor. Instantiates the database connection and the event handlers.
        /// Instantiates the music player aswell and gets the sounds location then launch the first music.
        /// </summary>
        public frm_Tablut()
        {
            InitializeComponent();

            db_Link = new DB_Connect();


            //Background sound
            is_In_Game               = false;
            music_Player             = new System.Windows.Media.MediaPlayer();
            music_Player.MediaEnded += new System.EventHandler(this.sound_Ended);
            sound_Path               = System.IO.Path.Combine(root_Location, @"Content\Menu_Fantasy.WAV");
            music_Player.Open(new Uri(sound_Path));

            music_Player.Play();

            //Initializing event

            //Sound cues
            //menu
            pic_Menu_Create_Profile.MouseEnter += new System.EventHandler(this.play_Sound_Enter);
            pic_Menu_Manage_Profile.MouseEnter += new System.EventHandler(this.play_Sound_Enter);
            pic_Menu_Play.MouseEnter           += new System.EventHandler(this.play_Sound_Enter);
            pic_Menu_Close.MouseEnter          += new System.EventHandler(this.play_Sound_Enter);

            //profile creation
            pic_Create_Profile_Create.MouseEnter += new System.EventHandler(this.play_Sound_Enter);
            pic_Create_Profile_Cancel.MouseEnter += new System.EventHandler(this.play_Sound_Enter);

            //profile managment
            pic_Manage_Profile_Menu.MouseEnter   += new System.EventHandler(this.play_Sound_Enter);
            pic_Manage_Profile_Rename.MouseEnter += new System.EventHandler(this.play_Sound_Enter);
            pic_Manage_Profile_Reset.MouseEnter  += new System.EventHandler(this.play_Sound_Enter);
            pic_Manage_Profile_Delete.MouseEnter += new System.EventHandler(this.play_Sound_Enter);

            //Player selection
            pic_Player_Selection_Start.MouseEnter  += new System.EventHandler(this.play_Sound_Enter);
            pic_Player_Selection_Cancel.MouseEnter += new System.EventHandler(this.play_Sound_Enter);

            //Game
            pic_Game_Menu.MouseEnter  += new System.EventHandler(this.play_Sound_Enter);
            pic_Game_Close.MouseEnter += new System.EventHandler(this.play_Sound_Enter);

            //Game over
            pic_Game_Over_Menu.MouseEnter += new System.EventHandler(this.play_Sound_Enter);

            //Sound control
            pic_Speaker.MouseEnter += new System.EventHandler(this.play_Sound_Enter);
        }