Beispiel #1
0
        public AzureTentQueues(IGeneralConfiguration configuration, 
            IJsonHelpers jsonHelpers,
            ITaskHelpers taskHelpers,
            ILoggingService loggingService)
        {
            Ensure.Argument.IsNotNull(configuration, nameof(configuration));
            Ensure.Argument.IsNotNull(jsonHelpers, nameof(jsonHelpers));
            Ensure.Argument.IsNotNull(taskHelpers, nameof(taskHelpers));
            Ensure.Argument.IsNotNull(loggingService, nameof(loggingService));

            this.taskHelpers = taskHelpers;
            this.loggingService = loggingService;

            // Create the storage account from the connection string, and the corresponding client.
            var queuesStorageAccount = CloudStorageAccount.Parse(configuration.AzureQueuesConnectionString);
            var queuesClient = queuesStorageAccount.CreateCloudQueueClient();

            // Create the queues references.
            this.mentionsQueue = queuesClient.GetQueueReference("mentions");
            this.subscriptionsQueue = queuesClient.GetQueueReference("subscriptions");
            this.appNotificationQueue = queuesClient.GetQueueReference("appnotifications");
            this.metaSubscriptionQueue = queuesClient.GetQueueReference("metasubscriptions");
            this.retryQueue = queuesClient.GetQueueReference("retries");

            // Create the IQueue objects.
            this.Mentions = new AzureQueue<QueueMentionMessage>(this.mentionsQueue, jsonHelpers);
            this.Subscriptions = new AzureQueue<QueueSubscriptionMessage>(this.subscriptionsQueue, jsonHelpers);
            this.AppNotifications = new AzureQueue<QueueAppNotificationMessage>(this.appNotificationQueue, jsonHelpers);
            this.MetaSubscriptions = new AzureQueue<QueueMetaSubscriptionMessage>(this.metaSubscriptionQueue, jsonHelpers);
            this.Retries = new AzureQueue<QueueRetryMessage>(this.retryQueue, jsonHelpers);

            // Create the initializer for this component.
            this.initializer = new TaskRunner(this.InitializeOnceAsync);
        }
Beispiel #2
0
        public UserLoader(
            IInternalUserLoader internalUserLoader,
            IExternalUserLoader externalUserLoader,
            ITaskHelpers taskHelpers,
            IUriHelpers uriHelpers)
        {
            Ensure.Argument.IsNotNull(internalUserLoader, nameof(internalUserLoader));
            Ensure.Argument.IsNotNull(externalUserLoader, nameof(externalUserLoader));
            Ensure.Argument.IsNotNull(taskHelpers, nameof(taskHelpers));
            Ensure.Argument.IsNotNull(uriHelpers, nameof(uriHelpers));

            this.internalUserLoader = internalUserLoader;
            this.externalUserLoader = externalUserLoader;
            this.taskHelpers        = taskHelpers;
            this.uriHelpers         = uriHelpers;
        }
        public ConsoleViewModel(
            IConsoleService consoleService,
            ISerialPortService serialPortService,
            ISettingsService settingsService,
            IClipboardService clipboardService,
            IDialogService dialogService,
            IApplicationServices applicationServices,
            IWindowService windowService,
            IPrinterService printerService,
            ITaskHelpers taskHelpers)
        {
            // Services

            ConsoleService      = consoleService;
            SerialPortService   = serialPortService;
            SettingsService     = settingsService;
            ClipboardService    = clipboardService;
            DialogService       = dialogService;
            ApplicationServices = applicationServices;
            WindowService       = windowService;
            PrinterService      = printerService;
            TaskHelpers         = taskHelpers;


            // Commands

            NewSessionCommand        = new AsyncRelayCommand(NewSessionCommandImpl);
            EndSessionCommand        = new RelayCommand(EndSessionCommandImpl);
            SaveCommand              = new AsyncRelayCommand(SaveCommandImpl);
            PrintCommand             = new RelayCommand(PrintCommandImpl);
            ClearCommand             = new RelayCommand(ClearCommandImpl);
            CopyCommand              = new RelayCommand(CopyCommandImpl);
            PasteCommand             = new AsyncRelayCommand(PasteCommandImpl);
            PasteAndSendCommand      = new AsyncRelayCommand(PasteAndSendCommandImpl);
            PasteAndSendLinesCommand = new AsyncRelayCommand(PasteAndSendLinesCommandImpl);
            CutCommand       = new AsyncRelayCommand(CutCommandImpl);
            SelectAllCommand = new RelayCommand(SelectAllCommandImpl);
            QuitCommand      = new RelayCommand(QuitCommandImpl);
            SettingsCommand  = new RelayCommand(SettingsCommandImpl);

            Title = "Serial Port Utility";
        }
Beispiel #4
0
        public AzureTentBlobs(IGeneralConfiguration configuration,
            ITaskHelpers taskHelpers,
            ILoggingService loggingService)
        {
            Ensure.Argument.IsNotNull(configuration, nameof(configuration));
            Ensure.Argument.IsNotNull(taskHelpers, nameof(taskHelpers));
            Ensure.Argument.IsNotNull(loggingService, nameof(loggingService));

            this.taskHelpers = taskHelpers;
            this.loggingService = loggingService;

            // Create the storage account from the connection stirng, and the corresponding client.
            var blobsStorageAccount = CloudStorageAccount.Parse(configuration.AzureBlobsConnectionString);
            var blobsClient = blobsStorageAccount.CreateCloudBlobClient();

            // Create the blob container references.
            this.attachmentsContainer = blobsClient.GetContainerReference("attachments");

            // Create IBlobContainer objects.
            this.Attachments = new AzureBlobContainer(this.attachmentsContainer);

            // Create the initializer for this component.
            this.initializer = new TaskRunner(this.InitializeOnceAsync);
        }