コード例 #1
0
 public CurrentSessionViewModel(
     IViewModelNavigator navigator,
     SessionService sessionService,
     ImagePrinter printer,
     SettingsProvider settings
     )
 {
     _navigator = navigator;
     _sessionService = sessionService;
     _printer = printer;
     AppSettingsDto appSettings = settings.GetAppSettings();
     if (appSettings != null)
         _printerName = appSettings.PrinterName;
 }
コード例 #2
0
 public PrinterActivityViewerViewModel(
     IViewModelNavigator navigator,
     PrinterMessageProvider messageProvider,
     ImagePrinter imagePrinter,
     SettingsProvider settingsProvider
     )
 {
     _navigator = navigator;
     _messageProvider = messageProvider;
     _imagePrinter = imagePrinter;
     _copiesCount = 1;
     AppSettingsDto appSettings = settingsProvider.GetAppSettings();
     if (appSettings != null)
     {
         HashTag = appSettings.HashTag;
         _printerName = appSettings.PrinterName;
     }
 }
コード例 #3
0
 public CameraResultViewModel(
     IViewModelNavigator navigator, 
     ImagePrinter printer, 
     SettingsProvider settingsProvider,
     ImageService imageService,
     CompositionProcessingResult result)
 {
     _navigator = navigator;
     _printer = printer;
     _imageService = imageService;
     Image = result.ImageResult;
     _copiesCount = 1;
     var appSettings = settingsProvider.GetAppSettings();
     if (appSettings != null)
     {
         _maxCopies = appSettings.MaxPrinterCopies;
         _printerName = appSettings.PrinterName;
     }
 }
コード例 #4
0
        public MonitoringService(
            SettingsProvider settingsProvider,
            MessageAdapter messageAdapter,
            InstagramExplorer instagramExplorer,
            ImageUtils imageUtils,
            IImageRepository imageRep)
        {
            _messageAdapter = messageAdapter;
            _instagramExplorer = instagramExplorer;
            _imageUtils = imageUtils;
            _imageRep = imageRep;
            AppSettingsDto settings = settingsProvider.GetAppSettings();
            if (settings == null)
                throw new InvalidOperationException();

            _hashTag = settings.HashTag;
            var startSessionTime = imageRep.GetActiveSession(includeImages: false);
            if (startSessionTime == null)
                imageRep.StartSession();
            _startTime = startSessionTime?.StartTime ?? DateTime.Now;
            _endTime = settings.DateEnd;
            _printerName = settings.PrinterName;
        }
コード例 #5
0
        public InstagramExplorerViewModel(
            IViewModelNavigator navigator,
            InstagramExplorer instagramExplorer,
            SettingsProvider settings,
            ImagePrinter printer, PatternViewModelProvider patternVMProvider,
            ImageUtils imageUtils, IMappingEngine mappingEngine)
        {
            _navigator = navigator;
            _printer = printer;
            _patternVmProvider = patternVMProvider;
            _imageUtils = imageUtils;
            _mappingEngine = mappingEngine;
            _instagramExplorer = instagramExplorer;
            AppSettingsDto appSettings = settings.GetAppSettings();
            if (appSettings != null)
                _printerName = appSettings.PrinterName;

            IsHashTag = true;
            SearchAsyncOperation= new NotifyTaskCompletion<ImageResponse>(Task.FromResult(default(ImageResponse)));
            _searchTokenSource= new CancellationTokenSource();
        }