private void create_Click(object sender, RoutedEventArgs e) { string valType = type.Text; string valName = name.Text; Unit_Value.access_Modifier valAccessModifier = new Unit_Value.access_Modifier(); bool valStatic = (bool)checkStatic.IsChecked; bool valFinal = (bool)checkFinal.IsChecked; switch (accessModifier.SelectedIndex) { case 0: valAccessModifier = Unit_Value.access_Modifier.PUBLIC; break; case 1: valAccessModifier = Unit_Value.access_Modifier.PRIVATE; break; case 2: valAccessModifier = Unit_Value.access_Modifier.PROTECTED; break; default: valAccessModifier = Unit_Value.access_Modifier.PRIVATE; break; } Unit_Value val = new Unit_Value(valName, valType, valAccessModifier, valStatic, valFinal); unit.add_Unit_Value(val); }
private void save_Unit_Value(StreamWriter SW, Unit_Value cur_data) { SW.WriteLine(cur_data.name); SW.WriteLine(cur_data.type); SW.WriteLine(cur_data.modifier); SW.WriteLine(cur_data.static_Modifier); SW.WriteLine(cur_data.final_Modifier); }
private void load_Unit_Value(StreamReader SR, List <Unit_Value> list) { Unit_Value tmp = new Unit_Value(); tmp.name = SR.ReadLine(); tmp.type = SR.ReadLine(); tmp.modifier = (MC2017.Unit_Value.access_Modifier)(int.Parse(SR.ReadLine())); tmp.static_Modifier = bool.Parse(SR.ReadLine()); tmp.final_Modifier = bool.Parse(SR.ReadLine()); list.Add(tmp); }
public void delete_Unit_Value(Unit_Value val) { this.val.Remove(val); }
public void add_Unit_Value(Unit_Value val) { this.val.Add(val); }