Example #1
0
 public SyncService(
     IUserService userService,
     IApiService apiService,
     ISettingsService settingsService,
     IFolderService folderService,
     ICipherService cipherService,
     ICryptoService cryptoService,
     ICollectionService collectionService,
     IStorageService storageService,
     IMessagingService messagingService,
     IPolicyService policyService,
     ISendService sendService,
     IKeyConnectorService keyConnectorService,
     Func <bool, Task> logoutCallbackAsync)
 {
     _userService         = userService;
     _apiService          = apiService;
     _settingsService     = settingsService;
     _folderService       = folderService;
     _cipherService       = cipherService;
     _cryptoService       = cryptoService;
     _collectionService   = collectionService;
     _storageService      = storageService;
     _messagingService    = messagingService;
     _policyService       = policyService;
     _sendService         = sendService;
     _keyConnectorService = keyConnectorService;
     _logoutCallbackAsync = logoutCallbackAsync;
 }
Example #2
0
        public SendGroupingsPage(bool mainPage, SendType?type  = null, string pageTitle = null,
                                 PreviousPageInfo previousPage = null)
        {
            _pageName = string.Concat(nameof(GroupingsPage), "_", DateTime.UtcNow.Ticks);
            InitializeComponent();
            ListView             = _listView;
            _broadcasterService  = ServiceContainer.Resolve <IBroadcasterService>("broadcasterService");
            _syncService         = ServiceContainer.Resolve <ISyncService>("syncService");
            _vaultTimeoutService = ServiceContainer.Resolve <IVaultTimeoutService>("vaultTimeoutService");
            _sendService         = ServiceContainer.Resolve <ISendService>("sendService");
            _vm           = BindingContext as SendGroupingsPageViewModel;
            _vm.Page      = this;
            _vm.MainPage  = mainPage;
            _vm.Type      = type;
            _previousPage = previousPage;
            if (pageTitle != null)
            {
                _vm.PageTitle = pageTitle;
            }

            if (Device.RuntimePlatform == Device.iOS)
            {
                _absLayout.Children.Remove(_fab);
                ToolbarItems.Add(_aboutIconItem);
                ToolbarItems.Add(_addItem);
            }
            else
            {
                ToolbarItems.Add(_syncItem);
                ToolbarItems.Add(_lockItem);
                ToolbarItems.Add(_aboutTextItem);
            }
        }
Example #3
0
        public Send ToSend(Send existingSend, ISendService sendService)
        {
            existingSend = ToSendBase(existingSend, sendService);
            switch (existingSend.Type)
            {
            case SendType.File:
                var fileData = JsonConvert.DeserializeObject <SendFileData>(existingSend.Data);
                fileData.Name     = Name;
                fileData.Notes    = Notes;
                existingSend.Data = JsonConvert.SerializeObject(fileData,
                                                                new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                });
                break;

            case SendType.Text:
                existingSend.Data = JsonConvert.SerializeObject(new SendTextData(this),
                                                                new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                });
                break;

            default:
                throw new ArgumentException("Unsupported type: " + nameof(Type) + ".");
            }
            return(existingSend);
        }
        public async Task <object> CallService(ISendService service, EnumTipoSendService tipoService, IBaseViewModel model = null)
        {
            var result = await service.SendService(model);

            OperacaoValida(tipoService);
            return(result);
        }
Example #5
0
        public SendAddEditPageViewModel()
        {
            _deviceActionService  = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _sendService          = ServiceContainer.Resolve <ISendService>("sendService");
            TogglePasswordCommand = new Command(TogglePassword);

            TypeOptions = new List <KeyValuePair <string, SendType> >
            {
                new KeyValuePair <string, SendType>(AppResources.TypeText, SendType.Text),
                new KeyValuePair <string, SendType>(AppResources.TypeFile, SendType.File),
            };
            DeletionTypeOptions = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>(AppResources.OneHour, AppResources.OneHour),
                new KeyValuePair <string, string>(AppResources.OneDay, AppResources.OneDay),
                new KeyValuePair <string, string>(AppResources.TwoDays, AppResources.TwoDays),
                new KeyValuePair <string, string>(AppResources.ThreeDays, AppResources.ThreeDays),
                new KeyValuePair <string, string>(AppResources.SevenDays, AppResources.SevenDays),
                new KeyValuePair <string, string>(AppResources.ThirtyDays, AppResources.ThirtyDays),
                new KeyValuePair <string, string>(AppResources.Custom, AppResources.Custom),
            };
            ExpirationTypeOptions = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>(AppResources.Never, AppResources.Never),
                new KeyValuePair <string, string>(AppResources.OneHour, AppResources.OneHour),
                new KeyValuePair <string, string>(AppResources.OneDay, AppResources.OneDay),
                new KeyValuePair <string, string>(AppResources.TwoDays, AppResources.TwoDays),
                new KeyValuePair <string, string>(AppResources.ThreeDays, AppResources.ThreeDays),
                new KeyValuePair <string, string>(AppResources.SevenDays, AppResources.SevenDays),
                new KeyValuePair <string, string>(AppResources.ThirtyDays, AppResources.ThirtyDays),
                new KeyValuePair <string, string>(AppResources.Custom, AppResources.Custom),
            };
        }
Example #6
0
 public SearchService(
     ICipherService cipherService,
     ISendService sendService)
 {
     _cipherService = cipherService;
     _sendService   = sendService;
 }
Example #7
0
 public SyncService(
     IStateService stateService,
     IApiService apiService,
     ISettingsService settingsService,
     IFolderService folderService,
     ICipherService cipherService,
     ICryptoService cryptoService,
     ICollectionService collectionService,
     IOrganizationService organizationService,
     IMessagingService messagingService,
     IPolicyService policyService,
     ISendService sendService,
     IKeyConnectorService keyConnectorService,
     Func <Tuple <string, bool, bool>, Task> logoutCallbackAsync)
 {
     _stateService        = stateService;
     _apiService          = apiService;
     _settingsService     = settingsService;
     _folderService       = folderService;
     _cipherService       = cipherService;
     _cryptoService       = cryptoService;
     _collectionService   = collectionService;
     _organizationService = organizationService;
     _messagingService    = messagingService;
     _policyService       = policyService;
     _sendService         = sendService;
     _keyConnectorService = keyConnectorService;
     _logoutCallbackAsync = logoutCallbackAsync;
 }
 public AccountsControllerTests()
 {
     _userService                = Substitute.For <IUserService>();
     _userRepository             = Substitute.For <IUserRepository>();
     _cipherRepository           = Substitute.For <ICipherRepository>();
     _folderRepository           = Substitute.For <IFolderRepository>();
     _organizationService        = Substitute.For <IOrganizationService>();
     _organizationUserRepository = Substitute.For <IOrganizationUserRepository>();
     _providerUserRepository     = Substitute.For <IProviderUserRepository>();
     _paymentService             = Substitute.For <IPaymentService>();
     _globalSettings             = new GlobalSettings();
     _sendRepository             = Substitute.For <ISendRepository>();
     _sendService                = Substitute.For <ISendService>();
     _sut = new AccountsController(
         _globalSettings,
         _cipherRepository,
         _folderRepository,
         _organizationService,
         _organizationUserRepository,
         _providerUserRepository,
         _paymentService,
         _userRepository,
         _userService,
         _sendRepository,
         _sendService
         );
 }
Example #9
0
 public AccountsController(
     GlobalSettings globalSettings,
     ICipherRepository cipherRepository,
     IFolderRepository folderRepository,
     IOrganizationService organizationService,
     IOrganizationUserRepository organizationUserRepository,
     IProviderUserRepository providerUserRepository,
     IPaymentService paymentService,
     IUserRepository userRepository,
     IUserService userService,
     ISendRepository sendRepository,
     ISendService sendService)
 {
     _cipherRepository           = cipherRepository;
     _folderRepository           = folderRepository;
     _globalSettings             = globalSettings;
     _organizationService        = organizationService;
     _organizationUserRepository = organizationUserRepository;
     _providerUserRepository     = providerUserRepository;
     _paymentService             = paymentService;
     _userRepository             = userRepository;
     _userService    = userService;
     _sendRepository = sendRepository;
     _sendService    = sendService;
 }
Example #10
0
 public DocSendService(IDocumentService documentService, IChartEmployeeService chartEmployeeService, ISendService sendService, IChartService chartService, IDocTitleService titleService)
 {
     _documentService      = documentService;
     _chartEmployeeService = chartEmployeeService;
     _sendService          = sendService;
     _chartService         = chartService;
     _titleService         = titleService;
 }
 public FidelitySimsolService(IOrchardServices orchardServices, IEncryptionService encryptionService,
                              IAuthenticationService authenticationService, IMembershipService membershipService,
                              ISendService sendService, IRepository <ActionInCampaignRecord> repository, IWorkflowManager workfloManager)
     : base(orchardServices, encryptionService,
            authenticationService, membershipService,
            sendService, repository, workfloManager)
 {
 }
Example #12
0
 public MainController(ISendService _sendService, IMetaMessageService _metaMessageService, IChatMessageService _chatMessageService, IUserPermissionService _userPermissionService)
 {
     sendService           = _sendService;
     chatMessageService    = _chatMessageService;
     metaMessageService    = _metaMessageService;
     userPermissionService = _userPermissionService;
     serverThread.Start(this);
 }
 /// <summary>
 /// 注入
 /// </summary>
 /// <param name="TestService"></param>
 /// <param name="httpContext"></param>
 /// <param name="sendService"></param>
 /// <param name="BaseService"></param>
 /// <param name="excelService"></param>
 public LoginController(ITestService TestService, IHttpContextAccessor httpContext, ISendService sendService, IEFBaseService BaseService, IExcelService excelService)
 {
     this._TestService  = TestService;
     this._httpContext  = httpContext;
     this._SendService  = sendService;
     this._BaseService  = BaseService;
     this._excelService = excelService;
 }
Example #14
0
 // For Testing
 public EntryViewModel(ISendService sService)
 {
     ConfirmOneCommand          = new Command(async() => await SaveEntry(), () => ValidEntry());
     this.sendService           = sService;
     this.cars                  = new ObservableCollection <CarModel>();
     this.stations              = new ObservableCollection <StationModel>();
     title                      = "Nýtt verk";
     this.selectedHladbaerColas = false;
 }
Example #15
0
 public SendsController(
     ISendRepository sendRepository,
     IUserService userService,
     ISendService sendService,
     GlobalSettings globalSettings)
 {
     _sendRepository = sendRepository;
     _userService    = userService;
     _sendService    = sendService;
     _globalSettings = globalSettings;
 }
Example #16
0
        public Send ToSend(Guid userId, ISendService sendService)
        {
            var send = new Send
            {
                Type   = Type,
                UserId = (Guid?)userId
            };

            ToSend(send, sendService);
            return(send);
        }
Example #17
0
        public (Send, SendFileData) ToSend(Guid userId, string fileName, ISendService sendService)
        {
            var send = ToSendBase(new Send
            {
                Type   = Type,
                UserId = (Guid?)userId
            }, sendService);
            var data = new SendFileData(Name, Notes, fileName);

            return(send, data);
        }
Example #18
0
 public EntryViewModel(INavigation navigation, ISendService sService, DateTime start, DateTime end)
 {
     ConfirmOneCommand          = new Command(async() => await SaveEntry(), () => ValidEntry());
     this.sendService           = sService;
     this.navigation            = navigation;
     this.startTime             = start;
     this.endTime               = end;
     this.cars                  = new ObservableCollection <CarModel>(DataService.GetCars());
     this.stations              = new ObservableCollection <StationModel>(DataService.GetStations());
     title                      = "Nýtt verk";
     this.selectedHladbaerColas = false;
 }
Example #19
0
 public FidelityBaseServices(IOrchardServices orchardServices, IEncryptionService encryptionService,
                             IAuthenticationService authenticationService, IMembershipService membershipService,
                             ISendService sendService, IRepository <ActionInCampaignRecord> repository, IWorkflowManager workfloManager)
 {
     _orchardServices       = orchardServices;
     _encryptionService     = encryptionService;
     _authenticationService = authenticationService;
     _membershipService     = membershipService;
     _sendService           = sendService;
     _actionInCampaign      = repository;
     settingsPart           = _orchardServices.WorkContext.CurrentSite.As <FidelitySettingsPart>();
     _workflowManager       = workfloManager;
 }
Example #20
0
 private Send ToSendBase(Send existingSend, ISendService sendService)
 {
     existingSend.Key            = Key;
     existingSend.ExpirationDate = ExpirationDate;
     existingSend.DeletionDate   = DeletionDate.Value;
     existingSend.MaxAccessCount = MaxAccessCount;
     if (!string.IsNullOrWhiteSpace(Password))
     {
         existingSend.Password = sendService.HashPassword(Password);
     }
     existingSend.Disabled = Disabled.GetValueOrDefault();
     return(existingSend);
 }
 public SendsController(
     ISendRepository sendRepository,
     IUserService userService,
     ISendService sendService,
     ISendFileStorageService sendFileStorageService,
     ILogger <SendsController> logger,
     GlobalSettings globalSettings)
 {
     _sendRepository         = sendRepository;
     _userService            = userService;
     _sendService            = sendService;
     _sendFileStorageService = sendFileStorageService;
     _logger         = logger;
     _globalSettings = globalSettings;
 }
Example #22
0
        public GameController(ISendService sendService, List <User> users, List <IClientConnectionController> clientControllers, int tableID, string name, string password, bool hidden, User foundingUser, RuleSet ruleSet)
        {
            this.sendService       = sendService;
            this.users             = users;
            this.clientControllers = clientControllers;
            TableID  = tableID;
            Name     = name;
            Password = password;
            Hidden   = hidden;
            state    = State.Pause;
            Administrators.Add(foundingUser);
            playerToActQueue = new PlayerToActQueue(players);
            this.ruleSet     = ruleSet;

            initializeAllCards();
        }
Example #23
0
        public SendsControllerTests()
        {
            _userService            = Substitute.For <IUserService>();
            _sendRepository         = Substitute.For <ISendRepository>();
            _sendService            = Substitute.For <ISendService>();
            _sendFileStorageService = Substitute.For <ISendFileStorageService>();
            _globalSettings         = new GlobalSettings();
            _logger = Substitute.For <ILogger <SendsController> >();

            _sut = new SendsController(
                _sendRepository,
                _userService,
                _sendService,
                _sendFileStorageService,
                _logger,
                _globalSettings
                );
        }
Example #24
0
 public EntryListViewModel(ISendService sService, INavigation navigation)
 {
     this.sendService           = sService;
     this.navigation            = navigation;
     allEntries                 = new ObservableCollection <EntryModel>(DataService.GetEntries());
     Entries                    = AllEntries;
     sentEntries                = new ObservableCollection <EntryModel>();
     unSentEntries              = new ObservableCollection <EntryModel>();
     this.cars                  = new ObservableCollection <CarModel>(DataService.GetCars());
     this.stations              = new ObservableCollection <StationModel>(DataService.GetStations());
     SendAllEntriesCommand      = new Command(async() => await SendAllEntries());
     ModifySelectedEntryCommand = new Command(async() => await ModifySelectedEntry());
     DeleteSelectedEntryCommand = new Command(async() => await DeleteSelectedEntry());
     CloseCommand               = new Command(() => Close());
     DeleteAllCommand           = new Command(async() => await DeleteAll());
     SendEntryCommand           = new Command(async() => await SendEntry());
     ButtonColor                = "#d0cccc";
     selectedEntry              = null;
 }
Example #25
0
        public SendGroupingsPageViewModel()
        {
            _sendService          = ServiceContainer.Resolve <ISendService>("sendService");
            _syncService          = ServiceContainer.Resolve <ISyncService>("syncService");
            _stateService         = ServiceContainer.Resolve <IStateService>("stateService");
            _vaultTimeoutService  = ServiceContainer.Resolve <IVaultTimeoutService>("vaultTimeoutService");
            _deviceActionService  = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");

            Loading        = true;
            PageTitle      = AppResources.Send;
            GroupedSends   = new ObservableRangeCollection <ISendGroupingsPageListItem>();
            RefreshCommand = new Command(async() =>
            {
                Refreshing = true;
                await LoadAsync();
            });
            SendOptionsCommand = new Command <SendView>(SendOptionsAsync);
        }
Example #26
0
 public FidelityLoyalzooService(IOrchardServices orchardServices, IEncryptionService encryptionService,
                                IAuthenticationService authenticationService, IMembershipService membershipService,
                                ISendService sendService, IRepository <ActionInCampaignRecord> repository, IWorkflowManager workfloManager)
     : base(orchardServices, encryptionService,
            authenticationService, membershipService,
            sendService, repository, workfloManager)
 {
     if (settingsPart.AccountID == null || settingsPart.DefaultCampaign == null)
     {
         try
         {
             otherSettings();
         }
         catch
         {
             //TODO ??
         }
     }
 }
        public DataProvider(ISessionFactory sessionFactory, INotifier notifier, IRetrieveService retrieveService,
                            ISendService sendService, ICurrentDateTimeProvider currentDateTimeProvider, bool enabled, string accountNumber, int dayOfMonthToSend)
        {
            if (sessionFactory == null)
            {
                throw new ArgumentNullException(nameof(sessionFactory));
            }

            if (notifier == null)
            {
                throw new ArgumentNullException(nameof(notifier));
            }

            if (retrieveService == null)
            {
                throw new ArgumentNullException(nameof(retrieveService));
            }

            if (sendService == null)
            {
                throw new ArgumentNullException(nameof(sendService));
            }

            if (currentDateTimeProvider == null)
            {
                throw new ArgumentNullException(nameof(currentDateTimeProvider));
            }

            if (accountNumber == null)
            {
                throw new ArgumentNullException(nameof(accountNumber));
            }

            _Enabled                 = enabled;
            _AccountNumber           = accountNumber;
            _RetrieveService         = retrieveService;
            _Notifier                = notifier;
            _SendService             = sendService;
            _CurrentDateTimeProvider = currentDateTimeProvider;
            _SessionFactory          = sessionFactory;
            _DayOfMonthToSend        = dayOfMonthToSend;
        }
Example #28
0
        /// <summary>
        /// Ctor
        /// </summary>
        public MainViewModel()
        {
            svcPath = Path.Combine(Environment.CurrentDirectory, "DS4ToolService.exe");

            el = new EventLog("Application", Environment.MachineName, Constants.SERVICE_NAME);
            el.EntryWritten += new EntryWrittenEventHandler(LogWritten);
            el.EnableRaisingEvents = true;

            si = new ServiceInstaller();
            si.InstallService(svcPath, Constants.SERVICE_NAME);

            DuplexChannelFactory<ISendService> pipeFactory = new DuplexChannelFactory<ISendService>(new PushService(),
                new NetNamedPipeBinding(), new EndpointAddress(Constants.PIPE_ADDRESS + "tester"));
            sp = pipeFactory.CreateChannel();

            sc = new ServiceController(Constants.SERVICE_NAME, Environment.MachineName);
            new ServiceControllerPermission(ServiceControllerPermissionAccess.Browse, Environment.MachineName, Constants.SERVICE_NAME).Assert();
            sc.Refresh();
            sc.WaitForStatus(ServiceControllerStatus.Running);
        }
Example #29
0
        public ControllerViewModel(ISendService sendService, ServiceInstaller serviceInstaller, string controllerId, string controllerName, ConnectionTypes connection)
        {
            this.sp = sendService;
            this.si = serviceInstaller;

            this.BatteryValue = -1;
            this.ControllerId = controllerId;
            this.ControllerName = controllerName;
            this.ControllerUsbChecked = connection == ConnectionTypes.USB;
            this.ControllerBtChecked = connection == ConnectionTypes.Bluetooth;

            if (ControllerUsbChecked)
            {
                ExecuteUsbChange();
            }
            else
            {
                ExecuteBtChange();
            }
        }
Example #30
0
        public Send ToSend(Send existingSend, ISendService sendService)
        {
            existingSend = ToSendBase(existingSend, sendService);
            switch (existingSend.Type)
            {
            case SendType.File:
                var fileData = JsonSerializer.Deserialize <SendFileData>(existingSend.Data);
                fileData.Name     = Name;
                fileData.Notes    = Notes;
                existingSend.Data = JsonSerializer.Serialize(fileData, JsonHelpers.IgnoreWritingNull);
                break;

            case SendType.Text:
                existingSend.Data = JsonSerializer.Serialize(ToSendTextData(), JsonHelpers.IgnoreWritingNull);
                break;

            default:
                throw new ArgumentException("Unsupported type: " + nameof(Type) + ".");
            }
            return(existingSend);
        }
Example #31
0
 public EntryViewModel(INavigation navigation, ISendService sService, EntryModel m)
 {
     ConfirmOneCommand = new Command(async() => await SaveEntry(), () => ValidEntry());
     this.sendService  = sService;
     this.navigation   = navigation;
     this.cars         = new ObservableCollection <CarModel>(DataService.GetCars());
     this.stations     = new ObservableCollection <StationModel>(DataService.GetStations());
     title             = "Breyta færslu";
     foreach (var c in cars)
     {
         if (c.Num == m.Car)
         {
             car = c;
         }
     }
     foreach (var s in stations)
     {
         if (s.Name == m.Station)
         {
             station = s;
         }
     }
     ID         = m.ID;
     jobNo      = m.JobNo;
     no         = m.No;
     roadWidth  = m.RoadWidth;
     roadLength = m.RoadLength;
     roadArea   = m.RoadArea;
     tarQty     = m.TarQty;
     rate       = m.Rate;
     degrees    = m.Degrees;
     comment    = m.Comment;
     startTime  = m.StartTime;
     endTime    = m.EndTime;
     this.selectedHladbaerColas = false;
 }
 public DeliveryService(IDatabaseAccess databaseAccess, ISendService sendService)
 {
     _deliveryRepository = databaseAccess.Repository<Delivery>();
     _sendService = sendService;
 }
Example #33
0
 public SendController(ISendService sendService)
 {
     _sendService = sendService;
 }
Example #34
0
 public DraftController(ISendService sendService)
 {
     _sendService = sendService;
 }