Ejemplo n.º 1
0
 public PageViewService(ILinkService linkService, IDownloadUtil downloadUtil, IStreamUtil streamUtil, IPrintService printService)
 {
     _linkService  = linkService;
     _downloadUtil = downloadUtil;
     _streamUtil   = streamUtil;
     _printService = printService;
 }
Ejemplo n.º 2
0
        // 請使用 ObservableRangeCollection 來取代 ObservableCollection,
        // 主要是在實作refresh data 這功能時,使用此類別的ReplaceRange method可以避免DataGrid 跳動
        //private ObservableRangeCollection<Device> _devicesCollection;
        //private static object _lock = new object();

        // TODO: BUG...DateTime always 以 en-US 呈現
        public AlarmsViewModel(
            ICollectionModel <eventwarn> dataModel,
            IDeviceDataService deviceDataService,
            IDialogService dialogService,
            IPrintService printService)
        {
            this._dialogService     = dialogService;
            this._deviceDataService = deviceDataService;
            this._dataModel         = dataModel;
            this._printService      = printService;
            //this._dataModel.Data.CollectionChanged += _dataCollection_CollectionChanged;
            Alarms = (ListCollectionView)CollectionViewSource.GetDefaultView((IList)_dataModel.Data);
            Alarms.CurrentChanged += Alarms_CurrentChanged;
            Messenger.Default.Register <ReceivedAlarm>(this, (msg) =>
            {
                if (msg.Alarms != null)
                {
                    var seriousAlarmEvents = (from alarm in msg.Alarms
                                              where alarm.action == "trig"
                                              select alarm).ToList();
                    if (seriousAlarmEvents.Count() > 0)
                    {
                        this._dialogService.ShowAlarmDialog(/*seriousAlarmEvents*/);
                    }
                }
            });

            RefreshCommand.Execute(null);
        }
Ejemplo n.º 3
0
 public MainForm(ICopyFilesService copyFileService, IPrintService printService, IProcessImagesService processImagesService)
 {
     _copyFileService      = copyFileService ?? throw new ArgumentNullException(nameof(copyFileService));
     _printService         = printService ?? throw new ArgumentNullException(nameof(printService));
     _processImagesService = processImagesService ?? throw new ArgumentNullException(nameof(processImagesService));
     InitializeComponent();
 }
Ejemplo n.º 4
0
        //private IMessageService _messageService;

        public ViewSwitchViewModel(IRegionManager regionManager,
                                   //IMessageService messageService,
                                   IDataRepositoryService dataRepositoryService,
                                   INetworkTasks networkTasks,
                                   IEventAggregator ea,
                                   IPrintService printService) : base(regionManager)
        {
            _ea = ea;
            _dataRepositoryService = dataRepositoryService;
            _networkTasks          = networkTasks;
            _printerService        = printService;

            _ea.GetEvent <MessageSentEvent>().Subscribe(MessageReceived);

            SwitchList = new ObservableCollection <EthernetSwitch>();

            CheckedCommand   = new DelegateCommand(async() => await StartCommandExecuteAsync(), StartCommandCanExecute);
            UncheckedCommand = new DelegateCommand(StopCommandExecute, StopCommandCanExecute);

            Title = "Switch"; // Заголовок вкладки

            _dispatcher = Dispatcher.CurrentDispatcher;

            // Fill ComboBox with available printers
            foreach (string item in _printerService.CommonGetAvailablePrinters())
            {
                Printers.Add(item);
            }

            //Message = messageService.GetMessage();
        }
        public MainPageViewModel(INavigationService navigationService, IDeviceService deviceService, IPageDialogService pageDialogService, IDependencyService dependencyService)
            : base(navigationService, deviceService, pageDialogService, dependencyService)
        {
            Title = "Main Page";

            _printService = _dependencyService.Get <IPrintService>();
        }
 public McBurgerRestaurant(ICalculatorService calculatorService, IPaymentService paymentService, ICookingService cookingService, IPrintService printService)
 {
     this.calculatorService = calculatorService;
     this.paymentService    = paymentService;
     this.cookingService    = cookingService;
     this.printService      = printService;
 }
Ejemplo n.º 7
0
 public HomeViewModel()
 {
     adService         = DependencyService.Get <IAdService>();
     dataService       = DependencyService.Get <IDataService>();
     imageService      = DependencyService.Get <IImageService>();
     printService      = DependencyService.Get <IPrintService>();
     permissionService = DependencyService.Get <IPermissionService>();
 }
Ejemplo n.º 8
0
 public ProgramDirectorController(IRepository<Survey> surveyRepository, IRepository<PrintedSurvey> printedSurveyRepository, IRepository<Photo> photoRepository, IPrintService printService, IBlobStoargeService blobStoargeService)
 {
     _surveyRepository = surveyRepository;
     _printedSurveyRepository = printedSurveyRepository;
     _photoRepository = photoRepository;
     _printService = printService;
     _blobStoargeService = blobStoargeService;
 }
Ejemplo n.º 9
0
    public Facade()
    {
        //construct all the instances of relevant external libraries / systems / etc.
        scanner = new RandomScanService(0);
        printer = new ConsolePrintService();

        scanner.onRead += LevelRead;
    }
Ejemplo n.º 10
0
 /// <summary>
 /// Print HTML string
 /// </summary>
 /// <param name="html"></param>
 /// <param name="jobName"></param>
 /// <param name="failAction">What to do if there is a failure.</param>
 public static Task PrintAsync(this string html, string jobName, FailAction failAction = FailAction.ShowAlert)
 {
     _service = _service ?? DependencyService.Get <IPrintService>();
     if (_service == null)
     {
         throw new NotSupportedException("Cannot get IWebViewService: must not be supported on this platform.");
     }
     return(_service.PrintAsync(html, jobName ?? ApplicationInfoService.Name, failAction));
 }
Ejemplo n.º 11
0
 public GameSetupService(ICharacterService characterService, IDrawingRepository drawingRepository, IPrintService printService,
                         IDrawingService drawingService, IGameRepository gameRepository)
 {
     _characterService  = characterService;
     _printService      = printService;
     _drawingRepository = drawingRepository;
     _drawingService    = drawingService;
     _gameRepository    = gameRepository;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Print HTML string
 /// </summary>
 /// <param name="html"></param>
 /// <param name="jobName"></param>
 public static void Print(this string html, string jobName)
 {
     _service = _service ?? DependencyService.Get <IPrintService>();
     if (_service == null)
     {
         throw new NotSupportedException("Cannot get IWebViewService: must not be supported on this platform.");
     }
     _service.Print(html, jobName ?? ApplicationInfoService.Name);
 }
Ejemplo n.º 13
0
 public PrintOrderAsPDF(IOrderService orderservice, IWriter writer,
                        IPramaterValidator validator, IReader reader, IPrintService print)
 {
     this.orderservice = orderservice ?? throw new ArgumentNullException(nameof(orderservice));
     this.writer       = writer ?? throw new ArgumentNullException(nameof(writer));
     this.validator    = validator ?? throw new ArgumentNullException(nameof(validator));
     this.reader       = reader ?? throw new ArgumentNullException(nameof(reader));
     this.print        = print ?? throw new ArgumentNullException(nameof(print));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Print the specified webview and jobName.
 /// </summary>
 /// <param name="webview">Webview.</param>
 /// <param name="jobName">Job name.</param>
 public static Task PrintAsync(this WebView webview, string jobName)
 {
     _service = _service ?? DependencyService.Get <IPrintService>();
     if (_service == null)
     {
         throw new NotSupportedException("Cannot get IWebViewService: must not be supported on this platform.");
     }
     return(_service.PrintAsync(webview, jobName ?? ApplicationInfoService.Name));
 }
Ejemplo n.º 15
0
 public void SetUp()
 {
     Instance.Bind <IXMachine>().To <XMachineMock>();
     Instance.Load(new KonturPrintServiceModule(Instance.Get <IXMachine>()));
     KonturPrintService = Instance.Get <IPrintService>();
     TestDirectory      = TestContext.CurrentContext.TestDirectory;
     tmpPath            = System.IO.Path.Combine(TestDirectory, @"../../TestTemplate/TestResult.docx");
     templatePath       = System.IO.Path.Combine(TestDirectory, @"../../TestTemplate/TestTemplate.docx");
 }
        public MainPageViewModel(IMedia media, IPermissions permissions, IPageDialogService pageDialogService, IPrintService printService)
        {
            _mediaService      = media;
            _permissionService = permissions;
            _pageDialogService = pageDialogService;
            _printService      = printService;

            OnPrintImageCommand = new DelegateCommand(PrintImage);
            OnPrintPDFCommand   = new DelegateCommand(PrintPDF);
        }
 /// <summary>
 /// Initialize a new reference of Application Service Class
 /// </summary>
 /// <param name="logger"></param>
 /// <param name="numberService"></param>
 /// <param name="operatorService"></param>
 /// <param name="printService"></param>
 public ApplicationService(ILogger <ApplicationService> logger,
                           INumberService numberService,
                           IOperatorService operatorService,
                           IPrintService printService)
 {
     _logger          = logger;
     _numberService   = numberService;
     _operatorService = operatorService;
     _printService    = printService;
 }
Ejemplo n.º 18
0
        public TopMenuViewVM(IFileService fileService, IDialogService dialogService, IExportToImageService exportToImageService,
                             IPrintService printService, IApplicationCommands applicationCommands)
        {
            _fileService          = fileService;
            _dialogService        = dialogService;
            _exportToImageService = exportToImageService;
            _printService         = printService;

            ApplicationCommands = applicationCommands;
        }
Ejemplo n.º 19
0
 public void SetUp()
 {
     fixture              = new Fixture();
     calculatorService    = new CalculatorService();
     fakePaymentProcessor = new FakePaymentProcessor();
     paymentService       = new PaymentService(fakePaymentProcessor);
     cookingService       = new CookingService();
     printService         = new PrintService();
     restaurant           = new McBurgerRestaurant(calculatorService, paymentService, cookingService, printService);
 }
Ejemplo n.º 20
0
 public LabelPrintEditorViewModel(ILabelPrintViewProvider viewProvider, IPrintService printService)
 {
     _viewProvider     = viewProvider;
     _printService     = printService;
     PrintItems        = Bag.Empty <LabelPrintViewModel>();
     AddToPrintCommand = new RelayCommand(AddToPrint);
     ClearCollectionItemsFilterCommand = new RelayCommand(ClearSourceFilterText);
     ClearPrintItemsFilterCommand      = new RelayCommand(() => PrintItems.ClearFilterText());
     DeleteCurrentPrintItemCommand     = new RelayCommand(DeleteSelectedPrintItem);
     PrintCommand = new RelayCommand(Print, CanPrint);
 }
Ejemplo n.º 21
0
        public KsiClient(IKsiSettingsService ksiSettingsService, IPrintService printer)
        {
            var settings = ksiSettingsService?.GetSettings() ?? throw new ArgumentNullException(nameof(ksiSettingsService));

            _printer = printer ?? throw new ArgumentNullException(nameof(printer));

            _client = new TcpClient(settings.Host, settings.Port);
            _stream = _client.GetStream();

            ReadAsync(_stream).Wait();
        }
Ejemplo n.º 22
0
 public CharacterService(ILoggerFactory loggerFactory, IPrintService printService, IGlobalItemsProvider globalItemsProvider,
                         IDrawingRepository drawingRepository, IDrawingService drawingService, IClassRepository classRepository,
                         IPlayerRepository playerRepository)
 {
     _logger              = loggerFactory.CreateLogger <CharacterService>();
     _printService        = printService;
     _globalItemsProvider = globalItemsProvider;
     _drawingRepository   = drawingRepository;
     _drawingService      = drawingService;
     _classRepository     = classRepository;
     _playerRepository    = playerRepository;
 }
Ejemplo n.º 23
0
        internal DispanserizationControl(PatientViewModel patient)
        {
            _patient = patient;

            var app = System.Windows.Application.Current as App;

            _mainWindow = app.MainWindow as MainWindow;

            _mediator     = app.ServiceProvider.GetService <IMediator>();
            _printService = app.ServiceProvider.GetService <IPrintService>();

            InitializeComponent();
        }
Ejemplo n.º 24
0
 public Dashboard()
 {
     InitializeComponent();
     _context              = new LTIContext();
     PrintService          = new PrintService();
     StudentsService       = new StudentsService();
     SubjectsService       = new SubjectsService();
     TeachersService       = new TeachersService();
     TrimestresService     = new TrimestresService();
     HistoryStudentService = new HistoryStudentsService();
     PdfService            = new PdfService();
     FileService           = new FileService();
 }
Ejemplo n.º 25
0
        // 請使用 ObservableRangeCollection 來取代 ObservableCollection,
        // 主要是在實作refresh data 這功能時,使用此類別的ReplaceRange method可以避免DataGrid 跳動
        //private ObservableRangeCollection<Device> _devicesCollection;
        //private static object _lock = new object();

        // TODO: BUG...DateTime always 以 en-US 呈現
        public CallOutEventsViewModel(
            ICollectionModel <eventcallout> dataModel,
            IDialogService dialogService,
            IPrintService printService)
        {
            this._dataModel               = dataModel;
            this._dialogService           = dialogService;
            this._printService            = printService;
            CallOutEvents                 = (ListCollectionView)CollectionViewSource.GetDefaultView((IList)_dataModel.Data);
            CallOutEvents.CurrentChanged += CallOutEvents_CurrentChanged;

            RefreshCommand.Execute(null);
        }
Ejemplo n.º 26
0
 public MasterService(
     IWorldService worldService,
     ICharacterService characterService,
     ILanguageService languageService,
     IParserService parserService,
     IPrintService printService
     )
 {
     this.worldService     = worldService;
     this.characterService = characterService;
     this.languageService  = languageService;
     this.parserService    = parserService;
     this.printService     = printService;
 }
Ejemplo n.º 27
0
        internal TimeItemsControl(PatientViewModel patient, ResourceViewModel resource)
        {
            _patient  = patient;
            _resource = resource;

            var app = System.Windows.Application.Current as App;

            _mediator     = app.ServiceProvider.GetService <IMediator>();
            _printService = app.ServiceProvider.GetService <IPrintService>();

            _mainWindow = app.MainWindow as MainWindow;

            InitializeComponent();
        }
        // 請使用 ObservableRangeCollection 來取代 ObservableCollection,
        // 主要是在實作refresh data 這功能時,使用此類別的ReplaceRange method可以避免DataGrid 跳動
        //private ObservableRangeCollection<Device> _devicesCollection;
        //private static object _lock = new object();

        // TODO: BUG...DateTime always 以 en-US 呈現
        // TODO: 開門者要轉換為比較有意義的呈現文字
        public OpenDoorEventsViewModel(
            ICollectionModel <eventopendoor> dataModel,
            IDataService <photograph> dataServiceSnapshot,
            IDialogService dialogService,
            IPrintService printService)
        {
            this._dialogService            = dialogService;
            this._dataModel                = dataModel;
            this._dataServiceSnapshot      = dataServiceSnapshot;
            this._printService             = printService;
            OpenDoorEvents                 = (ListCollectionView)CollectionViewSource.GetDefaultView((IList)_dataModel.Data);
            OpenDoorEvents.CurrentChanged += OpenDoorEvents_CurrentChanged;

            RefreshCommand.Execute(null);
        }
Ejemplo n.º 29
0
 public void SetUp()
 {
     _musicContractService           = new MusicContractService();
     _partnerContractService         = new PartnerContractService();
     _contractService                = new ContractService();
     _musicContractFileReaderService = new Mock <ITextFileReaderService>();
     _partnerContrFileReaderService  = new Mock <ITextFileReaderService>();
     _printService = new PrintService();
     _musicContractFileReaderService.Setup(x => x.ReadTextFile(It.IsAny <string>()))
     .Returns(TestData.GetMusicContractData);
     _partnerContrFileReaderService.Setup(x => x.ReadTextFile(It.IsAny <string>()))
     .Returns(TestData.GetPartnerContractData);
     _musicContractService.ProcessContract(TestData.GetMusicContractData());
     _partnerContractService.ProcessContract(TestData.GetPartnerContractData());
 }
Ejemplo n.º 30
0
        public MainForm()
        {
            InitializeComponent();

            this.startPoint = new Point(0, 0);
            this.texts      = new List <BaseText>();

            this.printService = new PrintService(pictureBox1);

            this.serializationService = new SerializationService($"{AppDomain.CurrentDomain.BaseDirectory}data.xml");

            if (File.Exists($"{AppDomain.CurrentDomain.BaseDirectory}data.xml"))
            {
                this.texts.AddRange(this.serializationService.Deserialize <BaseText[]>());
            }
        }
Ejemplo n.º 31
0
 public GameService(ILoggerFactory loggerFactory, IPrintService printService, IGlobalItemsProvider globalItemsProvider,
                    IDrawingRepository drawingRepository, IDrawingService drawingService, IGameSetupService gameSetupService, IGameRepository gameRepository,
                    ICombatService combatService, IInputProcessingService inputProcessingService, IPlayerRepository playerRepository)
 {
     _logger                 = loggerFactory.CreateLogger <GameService>();
     _printService           = printService;
     _globalItemsProvider    = globalItemsProvider;
     _drawingRepository      = drawingRepository;
     _drawingService         = drawingService;
     _gameRepository         = gameRepository;
     _combatService          = combatService;
     _playerRepository       = playerRepository;
     _inputProcessingService = inputProcessingService;
     Player = gameSetupService.Setup();
     Game   = _gameRepository.LoadGame(Player.GameSaveName);
 }
		public AccountService(IOperationService operationService, IPrintService printService)
		{
			_operationService = operationService;
			_printService = printService;
		}
Ejemplo n.º 33
0
 public MainViewModel(IPrintService printService)
 {
     _printService = printService;
 }
Ejemplo n.º 34
0
 public void set_up()
 {
     //we are testing the console print service
     _printService = new ConsolePrintService();
 }
		public AccountService(ITransactionService transactionService, IPrintService printService)
		{
			_transactionService = transactionService;
			_printService = printService;
		}
		public void TestInitialize()
		{
			_operationService = A.Fake<IOperationService>();
			_printService = A.Fake<IPrintService>();
		}