private static void CopySchedules(IBuildDefinition source, IBuildDefinition target)
 {
     foreach (var schedule in source.Schedules)
     {
         var newSchedule = target.AddSchedule();
         newSchedule.DaysToBuild = schedule.DaysToBuild;
         newSchedule.StartTime   = schedule.StartTime;
         newSchedule.TimeZone    = schedule.TimeZone;
     }
 }
 private static void CloneBuildSchedule(IBuildDefinition bd, IBuildDefinition newBuildDefinition)
 {
     foreach (var sched in bd.Schedules)
     {
         var newSched = newBuildDefinition.AddSchedule();
         newSched.DaysToBuild = sched.DaysToBuild;
         newSched.StartTime   = sched.StartTime;
         newSched.TimeZone    = sched.TimeZone;
     }
 }
        private void ConfigMainBuildDefinitionSettings(LabWorkflowManager.TFS.Common.WorkflowConfig.LabBuildDefinitionDetails buildDefinitionDetails, IBuildDefinition buildDefinition)
        {
            buildDefinition.Name = buildDefinitionDetails.Name;
            buildDefinition.Description = buildDefinitionDetails.Description;
            buildDefinition.ContinuousIntegrationType = (ContinuousIntegrationType)buildDefinitionDetails.ContinuousIntegrationType;
            if (buildDefinition.ContinuousIntegrationType == ContinuousIntegrationType.Schedule || buildDefinition.ContinuousIntegrationType == ContinuousIntegrationType.ScheduleForced)
            {
                var schedule = buildDefinition.AddSchedule();
                schedule.DaysToBuild = (ScheduleDays)buildDefinitionDetails.ScheduledDays;
                schedule.StartTime = buildDefinitionDetails.StartTime;
            }
            else if (buildDefinition.ContinuousIntegrationType == ContinuousIntegrationType.Batch)
            {
                buildDefinition.ContinuousIntegrationQuietPeriod = buildDefinitionDetails.QuietPeriod;
            }
            buildDefinition.BuildController = this.BuildServer.GetBuildController(string.Format("*{0}*", buildDefinitionDetails.ControllerName));

            var buildDefinitionProcessTemplate = this.BuildServer.QueryProcessTemplates(this.connectivity.TeamProjects.First().Name).Where(t => t.ServerPath.Contains(buildDefinitionDetails.ProcessTemplateFilename)).First();
            buildDefinition.Process = buildDefinitionProcessTemplate;
        }
 private static void CloneBuildSchedule(IBuildDefinition bd, IBuildDefinition newBuildDefinition)
 {
     foreach (var sched in bd.Schedules)
     {
         var newSched = newBuildDefinition.AddSchedule();
         newSched.DaysToBuild = sched.DaysToBuild;
         newSched.StartTime = sched.StartTime;
         newSched.TimeZone = sched.TimeZone;
     }
 }
 private void CopySchedules(IBuildDefinition source, IBuildDefinition target)
 {
     foreach (var schedule in source.Schedules)
     {
         var newSchedule = target.AddSchedule();
         newSchedule.DaysToBuild = schedule.DaysToBuild;
         newSchedule.StartTime = schedule.StartTime;
         newSchedule.TimeZone = schedule.TimeZone;
     }
 }