/// <summary>
        /// Erzeugt eine neue Verwaltungsinstanz.
        /// </summary>
        /// <param name="server">Die primäre VCR.NET Instanz.</param>
        internal ProfileStateCollection(VCRServer server)
        {
            // Remember
            Server = server;

            // Profiles to use
            var profileNames = VCRProfiles.ProfileNames.ToArray();
            var nameReport   = string.Join(", ", profileNames);

            // Log
            VCRServer.Log(LoggingLevel.Full, Properties.Resources.LoadProfiles, nameReport);

            // Report
            Tools.ExtendedLogging("Loading Profile Collection: {0}", nameReport);

            // Load current profiles
            m_profiles = profileNames.ToDictionary(profileName => profileName, profileName => new ProfileState(this, profileName), ProfileManager.ProfileNameComparer);

            // Now we can create the planner
            m_planner    = RecordingPlanner.Create(this);
            m_planThread = new Thread(PlanThread)
            {
                Name = "Recording Planner", IsBackground = true
            };

            // Configure timer
            m_timer.OnTimerExpired += BeginNewPlan;

            // Start planner
            m_planThread.Start();
        }
Ejemplo n.º 2
0
 public void FullValidation()
 {
     // Create component under Test
     using (var cfg = TestConfigurationProvider.Create(Properties.Resources.AllSchedulers))
         using (var cut = RecordingPlanner.Create(this))
             for (int i = 250; i-- > 0;)
             {
                 cut.DispatchNextActivity(m_planTime);
             }
 }
Ejemplo n.º 3
0
 public void ShowPlan()
 {
     // Create component under Test
     using (var cfg = TestConfigurationProvider.Create(Properties.Resources.AllSchedulers))
         using (var cut = RecordingPlanner.Create(this))
             foreach (var plan in cut.GetPlan(m_now).Take(250))
             {
                 Debug.WriteLine(string.Format
                                 (
                                     "{0:dd.MM.yyyy HH:mm}-{5:HH:mm}{1} on {2} [{3}] {4}",
                                     plan.Time.LocalStart,
                                     plan.StartsLate ? " [late]" : string.Empty,
                                     (plan.Resource == null) ? string.Format("[{0}]", string.Join(", ", plan.Definition.Resources.Select(r => r.Name))) : (object)plan.Resource,
                                     plan.Definition.UniqueIdentifier,
                                     plan.Definition.Name,
                                     plan.Time.LocalEnd
                                 ));
             }
 }