private void method_3(string string_0, ref BinFileValue binFileValue_0) { if (binFileValue_0.Value is float[] | binFileValue_0.Value is byte[] | binFileValue_0.Value is ushort[]) { string_0 = string_0.Remove(0, 1); string_0 = string_0.Remove(checked (string_0.Length - 1), 1); string[] array = string_0.Split(','); if (Operators.ConditionalCompareObjectNotEqual(NewLateBinding.LateGet(binFileValue_0.Value, null, "Length", new object[0], null, null, null), array.Length, false)) { throw new Exception("The specified array doesn't have the correct dimension."); } if (binFileValue_0.Value is float[]) { object obj = new object(); object loopObj = new object(); if (ObjectFlowControl.ForLoopControl.ForLoopInitObj(obj, 0, Operators.SubtractObject(NewLateBinding.LateGet(binFileValue_0.Value, null, "Length", new object[0], null, null, null), 1), 1, ref loopObj, ref obj)) { do { NewLateBinding.LateIndexSet(binFileValue_0.Value, new object[] { obj, this.method_1(array[Convert.ToInt32(obj)]) }, null); }while (ObjectFlowControl.ForLoopControl.ForNextCheckObj(obj, loopObj, ref obj)); } } else { object obj2 = new object(); object loopObj2 = new object(); if (ObjectFlowControl.ForLoopControl.ForLoopInitObj(obj2, 0, Operators.SubtractObject(NewLateBinding.LateGet(binFileValue_0.Value, null, "Length", new object[0], null, null, null), 1), 1, ref loopObj2, ref obj2)) { do { NewLateBinding.LateIndexSet(binFileValue_0.Value, new object[] { obj2, array[Convert.ToInt32(obj2)] }, null); }while (ObjectFlowControl.ForLoopControl.ForNextCheckObj(obj2, loopObj2, ref obj2)); } } } else { if (binFileValue_0.Value is float) { binFileValue_0.Value = this.method_1(string_0); } else { binFileValue_0.Value = string_0; } } }
private TreeViewItem method_4(ref BinFileValue binFileValue_0) { TreeViewItem treeViewItem = new TreeViewItem { Tag = binFileValue_0 }; BinFileValueList binFileValueList = (BinFileValueList)binFileValue_0.Value; treeViewItem.IsExpanded = true; StackPanel stackPanel = new StackPanel { Orientation = Orientation.Horizontal }; string str = ""; if (binFileValue_0.Prop != null) { str = Convert.ToString(binFileValue_0.Prop.Hash); if (binFileValue_0.Prop.Prop != null) { str = binFileValue_0.Prop.Prop; } } string str2 = ""; if (binFileValueList.Prop != null) { str2 = Convert.ToString(binFileValueList.Prop.Hash); if (binFileValueList.Prop.Prop != null) { str2 = binFileValueList.Prop.Prop; } } stackPanel.Children.Add(new TextBlock { Text = str + " List " + str2, FontSize = 15.0, FontWeight = FontWeights.Medium, Foreground = new SolidColorBrush(Colors.Gray) }); treeViewItem.Header = stackPanel; this.method_6(ref binFileValueList.Entries, ref treeViewItem); return(treeViewItem); }
private void SelectChange(object sender, RoutedPropertyChangedEventArgs <object> e) { checked { if (this.selectedItem.Tag is BinFileValue) { try { string arg_3C_1 = this.textBoxValue.Text; TreeViewItem treeViewItem; BinFileValue tag = (BinFileValue)(treeViewItem = this.selectedItem).Tag; this.method_3(arg_3C_1, ref tag); treeViewItem.Tag = tag; } catch (Exception expr_4C) { MessageBox.Show(expr_4C.Message); return; } TreeViewItem treeViewItem2 = this.selectedItem; StackPanel stackPanel = (StackPanel)treeViewItem2.Header; TextBlock textBlock = (TextBlock)stackPanel.Children[stackPanel.Children.Count - 1]; textBlock.Text = this.method_2(RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(this.selectedItem.Tag, null, "Value", new object[0], null, null, null))); } else { if (this.selectedItem.Tag is BinFileEntry) { BinFileEntry binFileEntry = (BinFileEntry)this.selectedItem.Tag; binFileEntry.Prop = binFileEntry.PropertiesTable.GetProp(Convert.ToUInt32(this.textBoxValue.Text)); TreeViewItem treeViewItem3 = this.selectedItem; StackPanel stackPanel2 = (StackPanel)treeViewItem3.Header; string str = Convert.ToString(binFileEntry.Prop.Hash); if (binFileEntry.Prop.Prop != null) { str = binFileEntry.Prop.Prop; } TextBlock textBlock2 = (TextBlock)stackPanel2.Children[stackPanel2.Children.Count - 1]; textBlock2.Text = "Entry " + str; } } this.buttonApply.IsEnabled = false; } }
private TreeViewItem method_5(ref BinFileValue binFileValue_0) { TreeViewItem treeViewItem = new TreeViewItem { Tag = binFileValue_0 }; StackPanel stackPanel = new StackPanel { Orientation = Orientation.Horizontal }; if (binFileValue_0.Prop != null) { string text = Convert.ToString(binFileValue_0.Prop.Hash); if (binFileValue_0.Prop.Prop != null) { text = binFileValue_0.Prop.Prop; } stackPanel.Children.Add(new TextBlock { Text = text, FontSize = 13.0, FontWeight = FontWeights.Normal, Foreground = new SolidColorBrush(Colors.Gray) }); } stackPanel.Children.Add(new TextBlock { Text = this.method_2(RuntimeHelpers.GetObjectValue(binFileValue_0.Value)), FontSize = 13.0, FontWeight = FontWeights.Normal, Foreground = new SolidColorBrush(Colors.Black), Margin = new Thickness(5.0, 0.0, 0.0, 0.0) }); treeViewItem.Header = stackPanel; return(treeViewItem); }
private void method_6(ref List <BinFileValue> list_0, ref TreeViewItem treeViewItem_0) { try { List <BinFileValue> .Enumerator enumerator = list_0.GetEnumerator(); while (enumerator.MoveNext()) { BinFileValue current = enumerator.Current; TreeViewItem newItem; if (current.Value is BinFileValueList) { newItem = this.method_4(ref current); } else { newItem = this.method_5(ref current); } treeViewItem_0.Items.Add(newItem); } } finally { } }