/// <param name="type">The type of step.</param>
        /// <returns></returns>
        protected IStep getStep(StepsType type)
        {
            if (steps.ContainsKey(type))
            {
                return(steps[type]);
            }

            switch (type)
            {
            case StepsType.Gen: {
                steps[type] = new StepGen();
                return(steps[type]);
            }

            case StepsType.Struct: {
                steps[type] = new StepStruct(new MSBuild.Parser(env))
                {
                    fnumber = StepStruct.NumberType.NativeStruct
                };
                return(steps[type]);
            }

            case StepsType.DirectRepl: {
                steps[type] = new StepRepl();
                return(steps[type]);
            }

            case StepsType.CfgData: {
                steps[type] = new StepCfgData();
                return(steps[type]);
            }

            case StepsType.Fields: {
                steps[type] = new StepFields();
                return(steps[type]);
            }

            case StepsType.Final:
            {
                steps[type] = new StepFinal(this);
                return(steps[type]);
            }
            }
            throw new NotFoundException("getStep: the type - `{0}` is not found.", type);
        }
Esempio n. 2
0
        /// <param name="type">The type of step.</param>
        /// <returns></returns>
        protected IStep getStep(StepsType type)
        {
            if(steps.ContainsKey(type)) {
                return steps[type];
            }

            switch(type)
            {
                case StepsType.Gen: {
                    steps[type] = new StepGen();
                    return steps[type];
                }
                case StepsType.Struct: {
                    steps[type] = new StepStruct(new MSBuild.Parser(env)) {
                        fnumber = StepStruct.NumberType.NativeStruct
                    };
                    return steps[type];
                }
                case StepsType.DirectRepl: {
                    steps[type] = new StepRepl();
                    return steps[type];
                }
                case StepsType.CfgData: {
                    steps[type] = new StepCfgData();
                    return steps[type];
                }
                case StepsType.Fields: {
                    steps[type] = new StepFields();
                    return steps[type];
                }
                case StepsType.Final:
                {
                    steps[type] = new StepFinal(this);
                    return steps[type];
                }
            }
            throw new NotFoundException("getStep: the type - `{0}` is not found.", type);
        }
Esempio n. 3
0
 private void save(StepFields s)
 {
     foreach(DataGridViewRow row in dgvFields.Rows) {
         s.items[row.Index].disabled = !Convert.ToBoolean(row.Cells[dgvFieldsEnabled.Name].Value);
         s.items[row.Index].newname  = (string)row.Cells[dgvFieldsNameNew.Name].Value;
     }
 }
Esempio n. 4
0
        private void render(StepFields s)
        {
            var cfg = manager.StepCfgData;

            dgvFields.Rows.Clear();
            foreach(StepFields.Items i in s.items)
            {
                string origin;
                if(manager.StepGen.gtype == GenType.CppDefinitions) {
                    origin = i.originConst;
                }
                else{
                    origin = (manager.StepStruct.upperCase)? i.originUpperCase : i.origin;
                }
                int idx = dgvFields.Rows.Add(!i.disabled, origin, i.newname, i.description);

                if(!s.isAllow(i.type, cfg.scm)
                    || !s.isAllow(i.type, cfg.revType)
                    || !s.isAllow(i.type, manager.StepGen.gtype))
                {
                    dgvFields.Rows[idx].ReadOnly = true;
                    dgvFields.Rows[idx].DefaultCellStyle.BackColor = Color.FromArgb(240, 240, 240);
                    dgvFields.Rows[idx].Cells[0] = new DataGridViewCheckBoxCell() {
                                                                                    Style = {
                                                                                        ForeColor = Color.Transparent,
                                                                                        SelectionForeColor = Color.Transparent
                                                                                    }};
                }
            }
        }