public ArgumentWindow() { MethodWindow parent = Application.Current.Windows.OfType <MethodWindow>().FirstOrDefault(); var accessMod = new BasicDataCollection(); InitializeComponent(); this._TypeArg.ItemsSource = accessMod.DataTypes; if (parent._Arguments.SelectedIndex != -1) { NewArgument = parent.Method.Arguments[parent._Arguments.SelectedIndex]; this._Name.Text = NewArgument.Name; this._TypeArg.SelectedItem = NewArgument.Type; foreach (string keyword in NewArgument.Keywords) { foreach (CheckBox chk in _Keywords.Children) { if (keyword == chk.Content.ToString()) { chk.IsChecked = true; } } } } else { NewArgument = new ArgumentObject(); this._TypeArg.SelectedIndex = 0; } }
public PropertyWindow() { ClassWindow parent = Application.Current.Windows.OfType <ClassWindow>().FirstOrDefault(); var accessMod = new BasicDataCollection(); InitializeComponent(); this.AccessModifier.ItemsSource = accessMod.Modifiers; this.Type.ItemsSource = accessMod.DataTypes; if (parent.Class_Pole_List.SelectedIndex != -1) { pole = parent.MainClassObject.Properties[parent.Class_Pole_List.SelectedIndex]; this._Name.Text = pole.Name; this.AccessModifier.SelectedItem = pole.AccessModifier; this.Type.SelectedItem = pole.Type; foreach (string keyword in pole.Keywords) { foreach (CheckBox chk in Keywords.Children) { if (keyword == chk.Content.ToString()) { chk.IsChecked = true; } } } } else { pole = new PropertyObject(); this.AccessModifier.SelectedIndex = 0; this.Type.SelectedIndex = 0; } }
public MethodWindow() { ClassWindow parent = Application.Current.Windows.OfType <ClassWindow>().FirstOrDefault(); var accessMod = new BasicDataCollection(); InitializeComponent(); _Access.ItemsSource = accessMod.Modifiers; _Type.ItemsSource = accessMod.DataTypes; if (parent._Method_List.SelectedIndex != -1) { Method = parent.MainClassObject.Methods[parent._Method_List.SelectedIndex]; this._Name.Text = Method.Name; _Arguments.ItemsSource = Method.Arguments; _Access.SelectedItem = Method.AccessModifier; _Type.SelectedItem = Method.ReturnType; foreach (string keyword in Method.Keywords) { foreach (CheckBox chk in _KeyWord.Children) { if (keyword == chk.Content.ToString()) { chk.IsChecked = true; } } } } else { Method = new MethodObject(); _Arguments.ItemsSource = Method.Arguments; _Access.SelectedIndex = 0; _Type.SelectedIndex = 0; } }
public ClassWindow() { var accessMod = new BasicDataCollection(); InitializeComponent(); if (main._Class_List.SelectedIndex != -1) { MainClassObject = main.Classes[main._Class_List.SelectedIndex]; _Name.Text = MainClassObject.Name; _InheritanceCheckBox.IsChecked = true; _InheritanceTextBox.Text = MainClassObject.Inheritance; _AccessModifier.ItemsSource = accessMod.Modifiers; _AccessModifier.SelectedItem = MainClassObject.AccessModifier; foreach (string keyword in MainClassObject.Keywords) { foreach (CheckBox chk in _KeyWords.Children) { if (keyword == chk.Content.ToString()) { chk.IsChecked = true; } } } foreach (RadioButton type in _ClassOrInterface.Children) { if (MainClassObject.Type == "class" && type.Content.ToString() == "class") { type.IsChecked = true; } else if (MainClassObject.Type == "interface" && type.Content.ToString() == "interface") { type.IsChecked = true; } } if (MainClassObject.Interfaces.Count != 0) { _InterfaceCheckBox.IsChecked = true; } } else { MainClassObject = new ClassObject(); _AccessModifier.ItemsSource = accessMod.Modifiers; _AccessModifier.SelectedIndex = 0; } Class_Pole_List.ItemsSource = MainClassObject.Properties; _Method_List.ItemsSource = MainClassObject.Methods; _ImplementedInterfaces.ItemsSource = MainClassObject.Interfaces; }