/// <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(StepCfgData s, Version.RevNumber.Type type) { if(type == Version.RevNumber.Type.DeltaTime) { var rev = (Version.RevNumber.DeltaTime)s.revVal; rev.interval = rev.IntervalTypeList[cbRevTimeType.SelectedIndex].Key; rev.timeBase = dtRevTimeBase.Value; } }
private void save(StepCfgData s) { s.inputNumber = ftbInputNum.FileName; s.output = ftbOutputFile.FileName; s.inputNumberType = s.InputNumberTypeList[cbInputNum.SelectedIndex].Key; s.revType = s.RevTypeList[cbTypeRev.SelectedIndex].Key; s.scm = (cbSCM.SelectedIndex != -1)? s.SCMTypeList[cbSCM.SelectedIndex].Key : StepCfgData.SCMType.None; save(s, s.RevTypeList[cbTypeRev.SelectedIndex].Key); }
private void render(StepCfgData s, Version.RevNumber.Type type) { if(type == Version.RevNumber.Type.DeltaTime) { var rev = (Version.RevNumber.DeltaTime)s.revVal; cbRevTimeType.Items.Clear(); cbRevTimeType.Items.AddRange(rev.IntervalTypeList.Select(i => i.Value).ToArray()); cbRevTimeType.SelectedIndex = rev.IntervalTypeList.FindIndex(i => i.Key == rev.interval); dtRevTimeBase.Value = rev.timeBase; } }
private void render(StepCfgData s) { ftbInputNum.FileName = s.inputNumber; if(manager.StepGen.gtype == GenType.Direct) { ftbOutputFile.Enabled = false; ftbOutputFile.FileName = manager.StepRepl.file; } else { ftbOutputFile.Enabled = true; ftbOutputFile.FileName = s.output; } // Type of input number: cbInputNum.Items.Clear(); cbInputNum.Items.AddRange(s.InputNumberTypeList.Select(i => i.Value).ToArray()); if(manager.StepGen.gtype == GenType.Direct && manager.StepRepl.IsSourceNotRequiresInputNum) { cbInputNum.SelectedIndex = s.InputNumberTypeList.FindIndex(i => i.Key == StepCfgData.InputNumberType.MSBuildProp); } else { cbInputNum.SelectedIndex = s.InputNumberTypeList.FindIndex(i => i.Key == s.inputNumberType); } // Use SCM data: cbSCM.Items.Clear(); cbSCM.Items.AddRange(s.SCMTypeList.Select(i => i.Value).ToArray()); if(manager.StepGen.gtype == GenType.Direct) { if(manager.StepRepl.IsSourceSCM) { cbSCM.Enabled = true; cbSCM.SelectedIndex = s.SCMTypeList.FindIndex(i => i.Key != StepCfgData.SCMType.None); } else { cbSCM.Enabled = false; } } else { cbSCM.SelectedIndex = s.SCMTypeList.FindIndex(i => i.Key == s.scm); cbSCM.Enabled = true; } // Type of revision number: cbTypeRev.Items.Clear(); cbTypeRev.Items.AddRange(s.RevTypeList.Select(i => i.Value).ToArray()); cbTypeRev.SelectedIndex = s.RevTypeList.FindIndex(i => i.Key == s.revType); render(s, s.RevTypeList[cbTypeRev.SelectedIndex].Key); }
/// <summary> /// Checking of alowing field type for used scm type. /// </summary> /// <param name="type">The type of field.</param> /// <param name="scm">The type of SCM.</param> /// <returns></returns> public bool isAllow(Fields.Type type, StepCfgData.SCMType scm) { if((scm == StepCfgData.SCMType.None) && (type == Fields.Type.BranchName || type == Fields.Type.BranchRevCount || type == Fields.Type.BranchSha1 || type == Fields.Type.Informational || type == Fields.Type.InformationalFull)) { return false; } return true; }