Esempio n. 1
0
        public OptimizationSession FinishCurrentSession()
        {
            var tmpRef = optimizationSession;

            optimizationSession = null;
            ChangeSessionState(SessionState.None);
            return(tmpRef);
        }
Esempio n. 2
0
        public static OptimizationSession GenerateDefault()
        {
            var session = new OptimizationSession();

            session.WindowsUpdateSessionState = new WindowsUpdateSessionState();
            session.WindowsUpdateSessionState.RestartBehavior = WindowsUpdateSessionState.RestartBehaviors.Automatic;

            session.OSOTSessionState = new OSOTSessionState();
            session.OSOTSessionState.StepsChoiceOption    = OSOTSessionState.StepsChoice.Default;
            session.OSOTSessionState.OSOTTemplateMetadata = ConfigurationManager.Instance.OSOTTemplatesData.Where((otmd) => otmd.Type == Configuration.OSOTTemplateType.System).FirstOrDefault();

            session.CleanupSessionState = new CleanupSessionState();
            session.CleanupSessionState.RunDiskCleanmgr = true;
            session.CleanupSessionState.RunSDelete      = true;
            session.CleanupSessionState.RunDefrag       = true;
            session.CleanupSessionState.RunDism         = false;

            return(session);
        }
Esempio n. 3
0
 public void StartOptimizationSession(OptimizationSession optimizationSession)
 {
     this.optimizationSession = optimizationSession;
     ChangeSessionState(SessionState.Active);
 }