コード例 #1
0
        public RvSofOperation(string serverMessage) : base(serverMessage)
        {
            Applications               = new List <Application>();
            InstallUpdateDataList      = new List <InstallUpdateData>();
            InstallSupportedDataList   = new List <InstallSupportedData>();
            InstallCustomDataList      = new List <InstallCustomData>();
            InstallAgentUpdateDataList = new List <InstallAgentUpdatedData>();
            RawUninstallData           = new List <string>();
            Restores    = new List <WindowsRestore.WindowsRestoreData>();
            CpuThrottle = SetCpuThrottle();

            //switch (Type)
            //{
            //    case RvOperationValue.InstallWindowsUpdate:
            //        Operations.SaveOperationsToDisk(serverMessage, Operations.OperationType.InstallOsUpdate);
            //        break;

            //    case RvOperationValue.InstallSupportedApp:
            //        Operations.SaveOperationsToDisk(serverMessage, Operations.OperationType.InstallSupportedApp);
            //        break;

            //    case RvOperationValue.InstallCustomApp:
            //        Operations.SaveOperationsToDisk(serverMessage, Operations.OperationType.InstallCustomApp);
            //        break;

            //    case RvOperationValue.InstallAgentUpdate:
            //        Operations.SaveOperationsToDisk(serverMessage, Operations.OperationType.InstallAgentUpdate);
            //        break;

            //    case RvOperationValue.Uninstall:
            //        Operations.SaveOperationsToDisk(serverMessage, Operations.OperationType.UninstallApplication);
            //        break;
            //}
        }
コード例 #2
0
 public RvSofOperation()
 {
     Applications               = new List <Application>();
     InstallSupportedDataList   = new List <InstallSupportedData>();
     InstallCustomDataList      = new List <InstallCustomData>();
     InstallAgentUpdateDataList = new List <InstallAgentUpdatedData>();
     RawUninstallData           = new List <string>();
     Restores    = new List <WindowsRestore.WindowsRestoreData>();
     CpuThrottle = CpuThrottleValue.Normal;
 }
コード例 #3
0
        public static void ThrottleCpu(CpuThrottleValue throttleValue)
        {
            var priority = ProcessPriorityClass.Normal;

            switch (throttleValue)
            {
            case CpuThrottleValue.Idle:
                priority = ProcessPriorityClass.Idle;
                break;

            case CpuThrottleValue.Normal:
                priority = ProcessPriorityClass.Normal;
                break;

            case CpuThrottleValue.AboveNormal:
                priority = ProcessPriorityClass.AboveNormal;
                break;

            case CpuThrottleValue.BelowNormal:
                priority = ProcessPriorityClass.BelowNormal;
                break;

            case CpuThrottleValue.High:
                priority = ProcessPriorityClass.High;
                break;

            default:
                priority = ProcessPriorityClass.Normal;
                break;
            }

            foreach (Process proc in Process.GetProcesses())
            {
                if (proc.ProcessName.Equals("TrustedInstaller"))
                {
                    Logger.Log("Found TrustedInstaller running.", LogLevel.Debug);
                    Logger.Log("Priority Before Change: {0}", LogLevel.Debug, proc.PriorityClass);
                    proc.PriorityClass = priority;
                    Logger.Log("Priority After Change: {0}", LogLevel.Debug, proc.PriorityClass);
                    return;
                }
            }
            Logger.Log("Could not find the TrustedInstaller service/process running.", LogLevel.Error);
        }
コード例 #4
0
        public static void ThrottleCpu(CpuThrottleValue throttleValue)
        {
            var priority = ProcessPriorityClass.Normal;

            switch (throttleValue)
            {
                case CpuThrottleValue.Idle:
                    priority = ProcessPriorityClass.Idle;
                    break;
                case CpuThrottleValue.Normal:
                    priority = ProcessPriorityClass.Normal;
                    break;
                case CpuThrottleValue.AboveNormal:
                    priority = ProcessPriorityClass.AboveNormal;
                    break;
                case CpuThrottleValue.BelowNormal:
                    priority = ProcessPriorityClass.BelowNormal;
                    break;
                case CpuThrottleValue.High:
                    priority = ProcessPriorityClass.High;
                    break;
                default:
                    priority = ProcessPriorityClass.Normal;
                    break;
            }

            foreach (Process proc in Process.GetProcesses())
            {
                if (proc.ProcessName.Equals("TrustedInstaller"))
                {
                    Logger.Log("Found TrustedInstaller running.", LogLevel.Debug);
                    Logger.Log("Priority Before Change: {0}", LogLevel.Debug, proc.PriorityClass);
                    proc.PriorityClass = priority;
                    Logger.Log("Priority After Change: {0}", LogLevel.Debug, proc.PriorityClass);
                    return;
                }
            }
            Logger.Log("Could not find the TrustedInstaller service/process running.", LogLevel.Error);
        }