public void Update()
        {
            if (mwTool.Instance.ParseCharacterArmoryInfo(filename, out charInfo))
            {
                CharacterSelect charSelect = ShellService.Instance.CharacterContent.CharacterSelect;

                _lblName.Text = charInfo.Name;
                _lblRace.Text = charSelect.GetRaceName(charInfo.Race);
                if (charInfo.Gender != 0)
                {
                    _lblGender.Text = Application.Current.FindResource("female") as string;
                }
                else
                {
                    _lblGender.Text = Application.Current.FindResource("male") as string;
                }
                _lblClass.Text = Engine.Instance.WowDatabase.GetClassName(charInfo.ClassShortName);
            }
            else
            {
                charInfo.Name = "";

                _lblName.Text   = charInfo.Name;
                _lblRace.Text   = "";
                _lblGender.Text = "";
                _lblClass.Text  = "";
            }
        }
        private void btLoad_Click(object sender, RoutedEventArgs e)
        {
            if (charInfo.Name == "")
            {
                return;
            }

            if (LoadCharacter())
            {
                CharacterSelect charSelect = ShellService.Instance.CharacterContent.CharacterSelect;
                charSelect.UpdateUI(charInfo.Race, charInfo.Gender != 0, charInfo.ClassShortName);
            }
        }
        private void btImport_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter           = "text|*.txt|All Files|*.*";
            dlg.InitialDirectory = Engine.Instance.GetBaseDirectory();
            bool?ret = dlg.ShowDialog(ShellService.Instance.MainWindow);

            if (ret.HasValue && ret.Value)
            {
                StreamReader reader = new StreamReader(dlg.FileName);

                string txt;
                txt    = reader.ReadLine();
                raceId = UInt32.Parse(txt);

                txt    = reader.ReadLine();
                female = Int32.Parse(txt) != 0;

                txt            = reader.ReadLine();
                classShortName = txt;

                txt = reader.ReadLine();
                charFeature.skinColor = UInt32.Parse(txt);

                txt = reader.ReadLine();
                charFeature.faceType = UInt32.Parse(txt);

                txt = reader.ReadLine();
                charFeature.hairStyle = UInt32.Parse(txt);

                txt = reader.ReadLine();
                charFeature.facialHair = UInt32.Parse(txt);

                txt = reader.ReadLine();
                charFeature.hairColor = UInt32.Parse(txt);

                reader.Dispose();

                if (LoadCharacter())
                {
                    CharacterSelect charSelect = ShellService.Instance.CharacterContent.CharacterSelect;
                    charSelect.UpdateUI(raceId, female, classShortName);

                    charSelect.UseStartOutfit(classShortName);

                    Update();
                }
            }
        }
        public void Update()
        {
            M2SceneNode node = ModelSceneService.Instance.MainM2SceneNode;

            if (node == null || node.Type != M2Type.MT_CHARACTER || node.IsNpc)
            {
                _lblRace.Text       = "";
                _lblGender.Text     = "";
                _lblClass.Text      = "";
                _lblSkinColor.Text  = "";
                _lblFaceType.Text   = "";
                _lblHairType.Text   = "";
                _lblFacialHair.Text = "";
                _lblHairColor.Text  = "";
                return;
            }

            CharacterSelect charSelect = ShellService.Instance.CharacterContent.CharacterSelect;

            raceId        = charSelect.RaceInfo.RaceId;
            _lblRace.Text = charSelect.GetRaceName(raceId);
            female        = charSelect.Female;
            if (female)
            {
                _lblGender.Text = Application.Current.FindResource("female") as string;
            }
            else
            {
                _lblGender.Text = Application.Current.FindResource("male") as string;
            }
            classShortName = charSelect.ClassShortName;
            _lblClass.Text = Engine.Instance.WowDatabase.GetClassName(classShortName);
            CharFeature feature = charSelect.CurrentCharFeature;

            feature.ToSCharFeature(out charFeature);

            _lblSkinColor.Text  = charFeature.skinColor.ToString();
            _lblFaceType.Text   = charFeature.faceType.ToString();
            _lblHairType.Text   = charFeature.hairStyle.ToString();
            _lblFacialHair.Text = charFeature.facialHair.ToString();
            _lblHairColor.Text  = charFeature.hairColor.ToString();
        }