/// <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); }
/// <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); }
private void save(StepRepl s) { s.file = ftbReplFile.FileName; s.pattern = tbReplPattern.Text; s.prefix = tbReplPrefix.Text; s.postfix = tbReplPostfix.Text; s.rtype = s.TypeList[cbReplType.SelectedIndex].Key; s.source = s.SourceList[cbReplSource.SelectedIndex].Key; }
private void render(StepRepl s) { ftbReplFile.FileName = s.file; tbReplPattern.Text = s.pattern; tbReplPrefix.Text = s.prefix; tbReplPostfix.Text = s.postfix; cbReplType.Items.Clear(); cbReplType.Items.AddRange(s.TypeList.Select(i => i.Value).ToArray()); cbReplType.SelectedIndex = s.TypeList.FindIndex(i => i.Key == s.rtype); cbReplSource.Items.Clear(); cbReplSource.Items.AddRange(s.SourceList.Select(i => i.Value).ToArray()); cbReplSource.SelectedIndex = s.SourceList.FindIndex(i => i.Key == s.source); }