Ejemplo n.º 1
0
        public ProcessInfo(uint processId, DateTime startTime, string applicationName, string serviceShortName, ApplicationType appType, ApplicationStatus appStatus, uint sessionId, bool restartable)
        {
            if (string.IsNullOrWhiteSpace(applicationName))
            {
                throw new ArgumentNullException(nameof(applicationName));
            }

            if (!appType.IsValid())
            {
                throw new ArgumentException($"The { nameof(ApplicationType) } provided must be a valid enum.", nameof(appType));
            }
            if (!appStatus.IsValid())
            {
                throw new ArgumentException($"The { nameof(ApplicationStatus) } provided must be a valid enum.", nameof(appStatus));
            }

            ProcessId                 = processId;
            StartTime                 = startTime;
            ApplicationName           = applicationName;
            ServiceShortName          = serviceShortName;
            ApplicationType           = appType;
            ApplicationStatus         = appStatus;
            TerminalServicesSessionId = sessionId;
            Restartable               = restartable;
        }