Exemplo n.º 1
0
        internal static BlobContainerDeleteForecastWorker[] GetBlobContainerDeleteForecastWorkers()
        {
            IConfigurationSource configurationSource = GetConfigurationSource();
            ArrayList            list = new ArrayList();

            foreach (BlobContainerDeleteConfiguration blobContainerDeleteConfiguration in configurationSource.GetWindowsAzureBlobContainerDeleteConfigurations())
            {
                BlobService blobService = new BlobService(blobContainerDeleteConfiguration.StorageAccountName, blobContainerDeleteConfiguration.StorageAccountKey);
                foreach (ScheduleDefinitionConfiguration scheduleDefinitionConfiguration in blobContainerDeleteConfiguration.Schedules)
                {
                    ScheduleDay[] scheduleDays = GetScheduleDaysFromScheduleConfiguration(scheduleDefinitionConfiguration);
                    BlobContainerDeleteForecastWorker blobContainerDeleteForecastWorker = new BlobContainerDeleteForecastWorker(
                        blobService,
                        blobContainerDeleteConfiguration.StorageAccountName,
                        blobContainerDeleteConfiguration.BlobContainerNames.ToArray(),
                        scheduleDays,
                        blobContainerDeleteConfiguration.PollingIntervalInMinutes);
                    list.Add(blobContainerDeleteForecastWorker);
                }
            }

            return((BlobContainerDeleteForecastWorker[])list.ToArray(typeof(BlobContainerDeleteForecastWorker)));
        }