Exemplo n.º 1
0
 public ServiceControlAuditInformation()
 {
     AuditForwardingOptions = new[]
     {
         new ForwardingOption
         {
             Name  = "On",
             Value = true
         },
         new ForwardingOption
         {
             Name  = "Off",
             Value = false
         }
     };
     AuditRetention                = SettingConstants.AuditRetentionPeriodDefaultInHoursForUI;
     Description                   = "ServiceControl Audit";
     HostName                      = "localhost";
     AuditQueueName                = "audit";
     AuditForwardingQueueName      = "audit.log";
     AuditForwarding               = AuditForwardingOptions.First(p => !p.Value); //Default to Off.
     UseSystemAccount              = true;
     PortNumber                    = "44444";
     DatabaseMaintenancePortNumber = "44445";
 }
Exemplo n.º 2
0
        public ServiceControlAddViewModel()
        {
            DisplayName = "ADD SERVICECONTROL INSTANCE";

            SelectDestinationPath = new SelectPathCommand(p => DestinationPath = p, isFolderPicker: true, defaultPath: DestinationPath);
            SelectDatabasePath    = new SelectPathCommand(p => DatabasePath = p, isFolderPicker: true, defaultPath: DatabasePath);
            SelectLogPath         = new SelectPathCommand(p => LogPath = p, isFolderPicker: true, defaultPath: LogPath);

            var serviceControlInstances = InstanceFinder.ServiceControlInstances();

            if (!serviceControlInstances.Any())
            {
                InstanceName = "Particular.ServiceControl";
                PortNumber   = "33333";
                DatabaseMaintenancePortNumber = "33334";
            }
            else
            {
                var i = 0;
                while (true)
                {
                    InstanceName = $"Particular.ServiceControl.{++i}";
                    if (!serviceControlInstances.Any(p => p.Name.Equals(InstanceName, StringComparison.OrdinalIgnoreCase)))
                    {
                        break;
                    }
                }
            }

            AuditRetention           = SettingConstants.AuditRetentionPeriodDefaultInHoursForUI;
            ErrorRetention           = SettingConstants.ErrorRetentionPeriodDefaultInDaysForUI;
            Description              = "A ServiceControl Instance";
            HostName                 = "localhost";
            AuditQueueName           = "audit";
            AuditForwardingQueueName = "audit.log";
            AuditForwarding          = AuditForwardingOptions.First(p => !p.Value); //Default to Off.
            ErrorQueueName           = "error";
            ErrorForwardingQueueName = "error.log";
            ErrorForwarding          = ErrorForwardingOptions.First(p => !p.Value); //Default to Off.
            UseSystemAccount         = true;
        }