Пример #1
0
 private SettingThatAreOverridableType SetSettings(SettingThatAreOverridableType global, SettingThatAreOverridableType current)
 {
     if (current == null)
     {
         return(global);
     }
     else
     {
         return(current);
     }
 }
Пример #2
0
        public VRASCopyConfiguration(GlobalSettings globals, BatchSettingsType settingsForBatch, SourceType source, List <DestinationType> destinations)
        {
            // source settings
            this.BaseFolderPath    = source.SourceFolderPath;
            this.CopyType          = source.CopyType;
            this.FileRegExFilter   = source.FileRegExFilter;
            this.FolderRegExFilter = source.FolderRegExFilter;

            // source folder overrides
            this.CopyThreadPerSource = System.Convert.ToInt32(source.SourceSettingOverrides.CopyThreadPerSource);
            this.CopyZeroByteFiles   = source.SourceSettingOverrides.CopyZeroByteFiles;
            this.DeleteAfterCopy     = source.SourceSettingOverrides.DeleteAfterCopy;
            this.NewFileDelaySeconds = System.Convert.ToInt32(source.SourceSettingOverrides.NewFileDelaySeconds);

            // figure out what settings overrides to use
            SettingThatAreOverridableType mySettings = new SettingThatAreOverridableType();

            if (source.SourceSettingOverrides != null)
            {
                mySettings = source.SourceSettingOverrides;
            }
            else
            {
                mySettings = settingsForBatch.BatchSettingOverrides;
            }

            // batch settings
            this.BatchName = settingsForBatch.BatchName;
            this.CopyFromFirstDestinationDir = mySettings.CopyFromFirstDestinationDir;
            this.CopyRetryCount        = System.Convert.ToInt32(mySettings.CopyRetryCount);
            this.RetrySleepMs          = System.Convert.ToInt32(mySettings.RetrySleepMs);
            this.SleepBetweenBatchesMs = System.Convert.ToInt32(settingsForBatch.BatchSettingOverrides.SleepBetweenBatchesMs);

            // golbal settings
            this.ErrorLogPath = globals.ErrorLogPath;
            this.EventSource  = globals.EventSource;
            this.RegExMatchNotFoundDefaultString = globals.RegExMatchNotFoundDefaultString;
            this.ServiceStopTimeOutSec           = System.Convert.ToInt32(globals.ServiceStopTimeOutSec);
            this.TempFileExt = "." + globals.TempFileExt.TrimStart('.');

            // destinations
            this.DestinationCollection = destinations;

            // prime the event log source.
            VRASLogEvent.EventSourceDefault = this.EventSource;
        }