private void create_Click(object sender, RoutedEventArgs e)
        {
            string methodType = type.Text;
            string methodName = name.Text;

            Unit_Method.access_Modifier methodAccessModifier = new Unit_Method.access_Modifier();
            string methodParam  = param.Text;
            bool   methodStatic = (bool)checkStatic.IsChecked;
            bool   methodFinal  = (bool)checkAbstract.IsChecked;

            switch (accessModifier.SelectedIndex)
            {
            case 0:
                methodAccessModifier = Unit_Method.access_Modifier.PUBLIC;
                break;

            case 1:
                methodAccessModifier = Unit_Method.access_Modifier.PRIVATE;
                break;

            case 2:
                methodAccessModifier = Unit_Method.access_Modifier.PROTECTED;
                break;

            default:
                methodAccessModifier = Unit_Method.access_Modifier.PRIVATE;
                break;
            }
            Unit_Method method = new Unit_Method(methodName, methodType, methodParam, methodAccessModifier, methodStatic, methodFinal);

            unit.add_Unit_Method(method);
        }
Exemple #2
0
 private void save_Unit_Method(StreamWriter SW, Unit_Method 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.abstract_Modifier);
     SW.WriteLine(cur_data.parameter);
 }
Exemple #3
0
        private void load_Unit_Method(StreamReader SR, List <Unit_Method> list)
        {
            Unit_Method tmp = new Unit_Method();

            tmp.name              = SR.ReadLine();
            tmp.type              = SR.ReadLine();
            tmp.modifier          = (MC2017.Unit_Method.access_Modifier)(int.Parse(SR.ReadLine()));
            tmp.static_Modifier   = bool.Parse(SR.ReadLine());
            tmp.abstract_Modifier = bool.Parse(SR.ReadLine());
            tmp.parameter         = SR.ReadLine();
            list.Add(tmp);
        }
 public void delete_Unit_Method(Unit_Method method)
 {
     this.method.Remove(method);
 }
 public void add_Unit_Method(Unit_Method method)
 {
     this.method.Add(method);
 }