Example #1
0
        /// <summary>
        /// Überträgt alle Aufträge in einen Ablaufplanung.
        /// </summary>
        /// <param name="scheduler">Die zu befüllende Ablaufplanung.</param>
        /// <param name="disabled">Alle deaktivierten Aufträge.</param>
        /// <param name="planner">Die zugehörige Aufzeichnungsplanung.</param>
        /// <param name="context">Detailinformationen zur Planung.</param>
        public void AddRegularJobs(RecordingScheduler scheduler, Func <Guid, bool> disabled, RecordingPlanner planner, PlanContext context)
        {
            // Retrieve all jobs related to this profile
            foreach (var job in m_jobs.Values)
            {
                foreach (var schedule in job.Schedules)
                {
                    // No longer in use
                    if (!schedule.IsActive)
                    {
                        continue;
                    }

                    // Resolve source
                    var source = schedule.Source ?? job.Source;
                    if (source == null)
                    {
                        continue;
                    }

                    // Resolve profile
                    var resource = planner.GetResourceForProfile(source.ProfileName);
                    if (resource == null)
                    {
                        continue;
                    }

                    // Register
                    schedule.AddToScheduler(scheduler, job, new[] { resource }, FindSource, disabled, context);

                    // Connect
                    context.RegisterSchedule(schedule, job);
                }
            }
        }
        /// <summary>
        /// Ergänzt alle bekannten Aufzeichnungen zu einer Planungsinstzanz.
        /// </summary>
        /// <param name="scheduler">Die Verwaltung der Aufzeichnungen.</param>
        /// <param name="disabled">Alle nicht zu verwendenden Aufzeichnungen.</param>
        /// <param name="planner">Die Gesamtplanung.</param>
        /// <param name="context">Zusätzliche Informationen zur aktuellen Planung.</param>
        void IRecordingPlannerSite.AddRegularJobs(RecordingScheduler scheduler, Func <Guid, bool> disabled, RecordingPlanner planner, PlanContext context)
        {
            // Retrieve all jobs related to this profile
            foreach (var job in Server.JobManager.GetActiveJobs())
            {
                foreach (var schedule in job.Schedules)
                {
                    // No longer in use
                    if (!schedule.IsActive)
                    {
                        continue;
                    }

                    // Resolve source
                    var source = schedule.Source ?? job.Source;
                    if (source == null)
                    {
                        continue;
                    }

                    // Resolve profile
                    var resource = planner.GetResourceForProfile(source.ProfileName);
                    if (resource == null)
                    {
                        continue;
                    }

                    // Register single item
                    schedule.AddToScheduler(scheduler, job, new[] { resource }, VCRProfiles.FindSource, disabled, context);

                    // Remember - even if we skipped it
                    context.RegisterSchedule(schedule, job);
                }
            }
        }
        /// <summary>
        /// Überträgt alle Aufträge in einen Ablaufplanung.
        /// </summary>
        /// <param name="scheduler">Die zu befüllende Ablaufplanung.</param>
        /// <param name="disabled">Alle deaktivierten Aufträge.</param>
        /// <param name="planner">Die zugehörige Aufzeichnungsplanung.</param>
        /// <param name="context">Detailinformationen zur Planung.</param>
        public void AddRegularJobs( RecordingScheduler scheduler, Func<Guid, bool> disabled, RecordingPlanner planner, PlanContext context )
        {
            // Retrieve all jobs related to this profile
            foreach (var job in m_jobs.Values)
                foreach (var schedule in job.Schedules)
                {
                    // No longer in use
                    if (!schedule.IsActive)
                        continue;

                    // Resolve source
                    var source = schedule.Source ?? job.Source;
                    if (source == null)
                        continue;

                    // Resolve profile
                    var resource = planner.GetResourceForProfile( source.ProfileName );
                    if (resource == null)
                        continue;

                    // Register
                    schedule.AddToScheduler( scheduler, job, new[] { resource }, FindSource, disabled, context );

                    // Connect
                    context.RegisterSchedule( schedule, job );
                }
        }