private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
 {
     try
     {
         string path = Configer.Instance.ScriptRootMenu + "\\Scripts\\project.xml";
         GameProject.LoadGameProject(path);
         this.Refresh();
         CurrentProjectText.Text = path;
     }
     catch (Exception ex)
     {
         MessageBox.Show("游戏工程载入错误" + ex.ToString());
     }
 }
        private void OpenProjectButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter           = "游戏工程文件(project.xml)|*.xml";
            dialog.InitialDirectory = (Configer.Instance.ScriptRootMenu + "\\Scripts\\");
            dialog.ShowDialog();

            try
            {
                GameProject.LoadGameProject(dialog.File.FullName);
                this.Refresh();
                CurrentProjectText.Text = dialog.File.FullName;
            }
            catch (Exception ex)
            {
                MessageBox.Show("游戏工程载入错误" + ex.ToString());
            }
        }
        public void GameInit()
        {
            //if (Configer.Instance.Debug)
            //{
            //    Application.Current.Host.Settings.EnableFrameRateCounter = true;
            //}

            //this.TouchHostPage();

            if (!GameProject.IsLoaded)
            {
                GameProject.LoadGameProject();
            }

            GameServerManager.Instance.Init();
            BattleNetManager.Instance.SetConnectArgs("www.jy-x.com", 4502, this.Dispatcher);
            //BattleNetManager.Instance.SetConnectArgs("211.100.49.136", 4502, this.Dispatcher);
            //BattleNetManager.Instance.SetConnectArgs("127.0.0.1", 4502, this.Dispatcher);
            if (!Configer.Instance.Debug)
            {
                uiHost.battleFieldContainer.debugPanel.Visibility = System.Windows.Visibility.Collapsed;
            }
            else
            {
                uiHost.battleFieldContainer.debugPanel.Visibility = System.Windows.Visibility.Visible;
            }

            string rAssembly = Assembly.GetExecutingAssembly().FullName.Split(',')[1].Split('=')[1];

            uiHost.mainMenu.versionText.Text = rAssembly;
            uiHost.VersionInfoText.Text      = "金X " + rAssembly;

            height = this.LayoutRoot.Height;
            width  = this.LayoutRoot.Width;
            //Application.Current.Host.Content.Resized += new EventHandler(Content_Resized);
            Application.Current.Host.Content.FullScreenChanged += new EventHandler(Content_Resized);
        }