public CodeReviewPolicyForm(CodeReviewPolicyConfig config, VersionControlServer vcServer) { InitializeComponent(); Config = config; VCServer = vcServer; chkFailAnyBad.Checked = Config.FailIfAnyResponseIsNeedsWork; chkRequireClose.Checked = Config.RequireReviewToBeClosed; cmbPassLevel.SelectedItem = "With Comments"; if (Config.MinPassLevel == PassLevel.LooksGood) { cmbPassLevel.SelectedItem = "Looks Good"; } lstPaths.Items.Clear(); config.Paths.ForEach(p => lstPaths.Items.Add(p)); chkFailAnyBad.CheckedChanged += chkFailAnyBad_CheckedChanged; chkRequireClose.CheckedChanged += chkRequireClose_CheckedChanged; cmbPassLevel.SelectedIndexChanged += cmbPassLevel_SelectedIndexChanged; }
public override bool Edit(IPolicyEditArgs policyEditArgs) { if (Config == null) { Config = new CodeReviewPolicyConfig() { FailIfAnyResponseIsNeedsWork = true, RequireReviewToBeClosed = true, MinPassLevel = PassLevel.LooksGood }; } using (var form = new CodeReviewPolicyForm(Config, policyEditArgs.TeamProject.TeamProjectCollection.GetService<VersionControlServer>())) { var res = form.ShowDialog(policyEditArgs.Parent); if (res == DialogResult.OK) { Config = form.Config; return true; } return false; } }
public override bool Edit(IPolicyEditArgs policyEditArgs) { if (Config == null) { Config = new CodeReviewPolicyConfig() { FailIfAnyResponseIsNeedsWork = true, RequireReviewToBeClosed = true, MinPassLevel = PassLevel.LooksGood }; } using (var form = new CodeReviewPolicyForm(Config, policyEditArgs.TeamProject.TeamProjectCollection.GetService <VersionControlServer>())) { var res = form.ShowDialog(policyEditArgs.Parent); if (res == DialogResult.OK) { Config = form.Config; return(true); } return(false); } }
public CodeReviewPolicyForm(CodeReviewPolicyConfig config, VersionControlServer vcServer) { InitializeComponent(); Config = config; VCServer = vcServer; chkFailAnyBad.Checked = Config.FailIfAnyResponseIsNeedsWork; chkRequireClose.Checked = Config.RequireReviewToBeClosed; cmbPassLevel.SelectedItem = "With Comments"; if (Config.MinPassLevel == PassLevel.LooksGood) { cmbPassLevel.SelectedItem = "Looks Good"; } else if (Config.MinPassLevel == PassLevel.None) { cmbPassLevel.SelectedItem = "None"; } lstPaths.Items.Clear(); config.Paths.ForEach(p => lstPaths.Items.Add(p)); chkFailAnyBad.CheckedChanged += chkFailAnyBad_CheckedChanged; chkRequireClose.CheckedChanged += chkRequireClose_CheckedChanged; cmbPassLevel.SelectedIndexChanged += cmbPassLevel_SelectedIndexChanged; }