Ejemplo n.º 1
0
        public void UpdateCharacterNode(M2SceneNode node)
        {
            _propertyGrid.SelectedObject = null;

            App app = Application.Current as App;

            if (app.Language == Languages.Chinese)
            {
                characterProperty.FromM2SceneNode(node);
                _propertyGrid.SelectedObject = characterProperty;

                CategoryItem item = _propertyGrid.Categories[CharacterProperty.cateHead];
                if (item != null)
                {
                    item.IsBrowsable = node.HeadSceneNode != null;
                }
                item = _propertyGrid.Categories[CharacterProperty.cateLeftShoulder];
                if (item != null)
                {
                    item.IsBrowsable = node.LeftShoulderSceneNode != null;
                }
                item = _propertyGrid.Categories[CharacterProperty.cateRightShoulder];
                if (item != null)
                {
                    item.IsBrowsable = node.RightShoulderSceneNode != null;
                }
                item = _propertyGrid.Categories[CharacterProperty.cateLeftHand];
                if (item != null)
                {
                    item.IsBrowsable = node.LeftHandSceneNode != null;
                }
                item = _propertyGrid.Categories[CharacterProperty.cateRightHand];
                if (item != null)
                {
                    item.IsBrowsable = node.RightHandSceneNode != null;
                }
            }
            else
            {
                characterPropertyEnglish.FromM2SceneNode(node);
                _propertyGrid.SelectedObject = characterPropertyEnglish;

                CategoryItem item = _propertyGrid.Categories[CharacterPropertyEnglish.cateHead];
                if (item != null)
                {
                    item.IsBrowsable = node.HeadSceneNode != null;
                }
                item = _propertyGrid.Categories[CharacterPropertyEnglish.cateLeftShoulder];
                if (item != null)
                {
                    item.IsBrowsable = node.LeftShoulderSceneNode != null;
                }
                item = _propertyGrid.Categories[CharacterPropertyEnglish.cateRightShoulder];
                if (item != null)
                {
                    item.IsBrowsable = node.RightShoulderSceneNode != null;
                }
                item = _propertyGrid.Categories[CharacterPropertyEnglish.cateLeftHand];
                if (item != null)
                {
                    item.IsBrowsable = node.LeftHandSceneNode != null;
                }
                item = _propertyGrid.Categories[CharacterPropertyEnglish.cateRightHand];
                if (item != null)
                {
                    item.IsBrowsable = node.RightHandSceneNode != null;
                }
            }
        }