private void SetDisaplyInfo() { if (_DisplayInfo != null) { return; } if (_ItemConstruct.ItemType2.Count == 0) { return; } if (string.IsNullOrEmpty(_Value)) { return; } if (_ItemConstruct.ItemType1 == ConstructConfig.CONSTRUCT_ITEM_TYPE_ENUM) { EnumInfo enumInfo = EnumManager.Instance.GetEnum(_ItemConstruct.ItemType2[0].Name) as EnumInfo; if (enumInfo == null) { return; } _DisplayInfo = enumInfo.GetEnumItemByValue(_Value) as ITableDisplay; } else if (_ItemConstruct.ItemType1 == ConstructConfig.CONSTRUCT_ITEM_TYPE_TABLE_ID) { } }
private void ItemIDSingleValue_SelectionChanged_1(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count == 0) { return; } ITableDisplay displayItem = e.AddedItems[0] as ITableDisplay; if (displayItem != null) { _ContentItem.Value = displayItem.WriteValue; ItemIDSingleValue.Text = displayItem.DisplayName; } else { _ContentItem.Value = ""; ItemIDSingleValue.Text = ""; } }
//private void ItemIDMultiValue1_SelectionChanged_1(object sender, SelectionChangedEventArgs e) //{ // if (e.AddedItems.Count == 0) // return; // string selectedTable = e.AddedItems[0] as string; // if (string.IsNullOrEmpty(selectedTable)) // return; // ContentFile contentFile = TableContentManager.Instance.GetFileByName(selectedTable); // if (contentFile == null) // return; // ItemIDMultiValue2.Items.Clear(); // foreach (ContentRow contentRow in contentFile.ContentRow) // { // if (ContentConfig.IsContentIDInvalid(contentRow.ID)) // { // ItemIDMultiValue2.Items.Add(contentRow.ID); // } // } //} //private void ItemIDMultiValue2_SelectionChanged_1(object sender, SelectionChangedEventArgs e) //{ // if (e.AddedItems.Count == 0) // return; // string selectedID = e.AddedItems[0] as string; // _ContentItem.SetSplitValue(ItemIDMultiValue1.Text, 0); // _ContentItem.SetSplitValue(selectedID, 1); // _ContentItem.CombineSplitValue(); //} private void ItemEnmuValue_SelectionChanged_1(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count == 0) { return; } ITableDisplay selectedTable = e.AddedItems[0] as ITableDisplay; if (selectedTable == null) { return; } _ContentItem.DisplayInfo = selectedTable; //_ContentItem.SetSplitValue(ItemIDMultiValue1.Text, 0); //_ContentItem.SetSplitValue("-1", 1); //_ContentItem.CombineSplitValue(); }
private void InitEnumType() { ItemTextValue.Visibility = System.Windows.Visibility.Collapsed; //ItemEnmuValue.Visibility = System.Windows.Visibility.Collapsed; ItemIDSingleValue.Visibility = System.Windows.Visibility.Collapsed; ItemIDMultiValue.Visibility = System.Windows.Visibility.Collapsed; ItemBoolValue.Visibility = System.Windows.Visibility.Collapsed; ItemVector3Value.Visibility = System.Windows.Visibility.Collapsed; ItemEnmuValue.Visibility = System.Windows.Visibility.Visible; //ItemEnmuValue.Items.Clear(); EnumInfo enumInfo = EnumManager.Instance.GetEnum(_ContentItem.ItemConstruct.ItemType2[0].Name); if (enumInfo == null) { return; } foreach (TableBaseItem tableItem in enumInfo._EnumItemCollection) { ITableDisplay enumItem = tableItem as ITableDisplay; if (enumItem != null) { if (ItemEnmuValue.Items.Contains(enumItem)) { continue; } ItemEnmuValue.Items.Add(enumItem); } } ItemEnmuValue.SelectedValuePath = "WriteValue"; ItemEnmuValue.DisplayMemberPath = "DisplayName"; }
private void SetDisaplyInfo() { if (_DisplayInfo != null) return; if (_ItemConstruct.ItemType2.Count == 0) return; if (string.IsNullOrEmpty(_Value)) return; if (_ItemConstruct.ItemType1 == ConstructConfig.CONSTRUCT_ITEM_TYPE_ENUM) { EnumInfo enumInfo = EnumManager.Instance.GetEnum(_ItemConstruct.ItemType2[0].Name) as EnumInfo; if (enumInfo == null) return; _DisplayInfo = enumInfo.GetEnumItemByValue(_Value) as ITableDisplay; } else if (_ItemConstruct.ItemType1 == ConstructConfig.CONSTRUCT_ITEM_TYPE_TABLE_ID) { } }