Example #1
0
        public LogFileService(IFileSystemService fileSystemService, ISettingsService settingsService, IFolderService folderService)
        {
            _fileSystemService = fileSystemService ?? throw new ArgumentNullException(nameof(fileSystemService));
            _settingsService   = settingsService ?? throw new ArgumentNullException(nameof(settingsService));
            _folderService     = folderService ?? throw new ArgumentNullException(nameof(folderService));
            _logDirectory      = _settingsService.GetSettings().LogDirectory;

            if (!_fileSystemService.DirectoryExists(_logDirectory))
            {
                try
                {
                    _fileSystemService.CreateDirectory(_logDirectory);
                }
                catch (Exception e)
                {
                    throw new ArgumentException($"Could not create logpath from LogDirectory setting: \"{_logDirectory}\"", e);
                }
            }

            _folderContentStrategyBySize = new FolderContentStrategy
            {
                Path = _logDirectory,
                DetectionStrategy = DetectionStrategy.BySize,
                CleanUpStrategy   = CleanUpStrategy.ByDateAsc,
                Size = 1024 * 1024 * 20
            };

            _folderContentStrategyByCount = new FolderContentStrategy
            {
                Path = _logDirectory,
                DetectionStrategy = DetectionStrategy.ByCount,
                CleanUpStrategy   = CleanUpStrategy.ByDateAsc,
                Count             = 10
            };
        }
Example #2
0
 public MediaService(
     SmartDbContext db,
     IFolderService folderService,
     IMediaSearcher searcher,
     IMediaTypeResolver typeResolver,
     IMediaUrlGenerator urlGenerator,
     IEventPublisher eventPublisher,
     ILanguageService languageService,
     ILocalizedEntityService localizedEntityService,
     MediaSettings mediaSettings,
     IImageProcessor imageProcessor,
     IImageCache imageCache,
     MediaExceptionFactory exceptionFactory,
     Func <IMediaStorageProvider> storageProvider,
     MediaHelper helper)
 {
     _db                     = db;
     _folderService          = folderService;
     _searcher               = searcher;
     _typeResolver           = typeResolver;
     _urlGenerator           = urlGenerator;
     _eventPublisher         = eventPublisher;
     _languageService        = languageService;
     _localizedEntityService = localizedEntityService;
     _mediaSettings          = mediaSettings;
     _imageProcessor         = imageProcessor;
     _imageCache             = imageCache;
     _exceptionFactory       = exceptionFactory;
     _storageProvider        = storageProvider();
     _helper                 = helper;
 }
Example #3
0
 public FolderStreamWriter(IOrchardServices services, IContentItemDescriptorManager contentItemDescriptorManager, IFolderService folderService)
 {
     this.folderService = folderService;
     this.contentItemDescriptorManager = contentItemDescriptorManager;
     this.services = services;
     this.T        = NullLocalizer.Instance;
 }
Example #4
0
        /// <summary>
        /// Create Json for Grid view
        /// </summary>
        /// <param name="folder">folder where we will take files</param>
        /// <returns>Json string</returns>
        /// <exception cref="ArgumentNullException"></exception>
        public static string ToGridJson(this IFolderService service, DtoFolder folder)
        {
            if (ReferenceEquals(service, null) || ReferenceEquals(folder, null))
            {
                throw new ArgumentNullException();
            }

            var jsonObj = new { rows = new List <JsonGridObject>() };

            DtoFolder[] folders = service.GetNextLevelChildNodes(folder).ToArray();

            foreach (var chld in folders)
            {
                bool isPublic = chld.SharedToUsers.Any();

                if (service.GetNextLevelChildNodes(chld).Any() || chld.Files.Any())
                {
                    jsonObj.rows.Add(chld.ToGridObject("folder", isPublic));
                }
                else
                {
                    jsonObj.rows.Add(chld.ToGridObject("emptyfolder", isPublic));
                }
            }

            foreach (var file in folder.Files)
            {
                jsonObj.rows.Add(file.ToGridObject(file.FileTypes.First().TypeName));
            }

            return(new JavaScriptSerializer().Serialize(jsonObj));
        }
Example #5
0
        /// <summary>
        /// Create Json for Grid view
        /// </summary>
        /// <param name="enumeration">enumeration which to be converted</param>
        /// <param name="service">folder service</param>
        /// <returns>Json string</returns>
        public static string ToGridJson(this IEnumerable <IEntity> enumeration, IFolderService service)
        {
            var jsonObj = new { rows = new List <JsonGridObject>() };

            foreach (var folder in enumeration.OfType <DtoFolder>())
            {
                bool isPublic = folder.SharedToUsers.Any();

                if (service.GetNextLevelChildNodes(folder).Any() || folder.Files.Any())
                {
                    jsonObj.rows.Add(folder.ToGridObject("folder", isPublic));
                }
                else
                {
                    jsonObj.rows.Add(folder.ToGridObject("emptyfolder", isPublic));
                }
            }

            foreach (var file in enumeration.OfType <DtoFile>())
            {
                jsonObj.rows.Add(file.ToGridObject(file.FileTypes.First().TypeName));
            }

            return(new JavaScriptSerializer().Serialize(jsonObj));
        }
        public BookLayoutSelectViewVM(IFolderService folderService, IBookLayoutService bookLayoutService)
        {
            _folderService     = folderService;
            _bookLayoutService = bookLayoutService;

            _paperSize = null;
        }
Example #7
0
 public FoldersController(ILogger <FoldersController> logger, IFolderService folderService, IHttpContextAccessor httpContextAccessor, IMapper mapper)
 {
     _logger              = logger;
     _folderService       = folderService;
     _httpContextAccessor = httpContextAccessor;
     _mapper              = mapper;
 }
Example #8
0
 public BoxQuery(IFolderService folderService, IItemService itemService, IUserService userService)
 {
     Field <FolderType>("folder",
                        arguments: new QueryArguments(new QueryArgument <StringGraphType> {
         Name = "id"
     }),
                        resolve: context =>
     {
         string id = context.GetArgument <string>("id");
         return(folderService.GetFolderById(id));
     });
     Field <ListGraphType <ItemType> >("folderItems",
                                       arguments: new QueryArguments(new QueryArgument <StringGraphType> {
         Name = "folderId"
     }),
                                       resolve: context =>
     {
         string folderId = context.GetArgument <string>("folderId");
         return(itemService.GetItems(folderId));
     });
     Field <UserType>("user",
                      arguments: new QueryArguments(new QueryArgument <StringGraphType> {
         Name = "id"
     }),
                      resolve: context =>
     {
         string id = context.GetArgument <string>("id");
         return(userService.GetUserById(id));
     });
 }
Example #9
0
        public FoldersPageViewModel()
        {
            _folderService = ServiceContainer.Resolve <IFolderService>("folderService");

            PageTitle = AppResources.Folders;
            Folders   = new ExtendedObservableCollection <FolderView>();
        }
Example #10
0
 public CatalogService(
     IFolderService folder,
     DriveDbContext dbContext)
 {
     this.folderService = folder;
     this.dbContext     = dbContext;
 }
Example #11
0
 public PodcastController(ICommonService commonService, IPodcastService podcastService, IFolderService folderService, IFileService fileService)
 {
     this._commonService  = commonService;
     this._podcastService = podcastService;
     this._folderService  = folderService;
     this._fileService    = fileService;
 }
Example #12
0
 public VaultTimeoutService(
     ICryptoService cryptoService,
     IStateService stateService,
     IPlatformUtilsService platformUtilsService,
     IFolderService folderService,
     ICipherService cipherService,
     ICollectionService collectionService,
     ISearchService searchService,
     IMessagingService messagingService,
     ITokenService tokenService,
     IPolicyService policyService,
     IKeyConnectorService keyConnectorService,
     Func <Tuple <string, bool>, Task> lockedCallback,
     Func <Tuple <string, bool, bool>, Task> loggedOutCallback)
 {
     _cryptoService        = cryptoService;
     _stateService         = stateService;
     _platformUtilsService = platformUtilsService;
     _folderService        = folderService;
     _cipherService        = cipherService;
     _collectionService    = collectionService;
     _searchService        = searchService;
     _messagingService     = messagingService;
     _tokenService         = tokenService;
     _policyService        = policyService;
     _keyConnectorService  = keyConnectorService;
     _lockedCallback       = lockedCallback;
     _loggedOutCallback    = loggedOutCallback;
 }
Example #13
0
 public HomeController(IFeedService feedService, IFolderService folderService, IItemService itemService, FeedsDbEntities context)
 {
     _feedService = feedService;
     _folderService = folderService;
     _itemService = itemService;
     _context = context;
 }
Example #14
0
        public Player(
            ILogger Logger_,
            IFolderService FolderService_,
            ILocalization loc_,
            bool starttimer = true
            //,ISystemMessagePlatformSpecific isystemMessage_
            )
        {

            Logger = Logger_;
            FolderService = FolderService_;
            Loc = loc_;
            //SystemMessage = isystemMessage_;

            Logger.Write(this, LogMsgType.DeepTrace, "Player has been constructed");

            PreviousPosition = 0;
            ClearTargetPosition();

            if (starttimer)
            {
                timer = new TimerExt(20);
                //timer.Enabled = true;
                timer.Elapsed += timer_Elapsed;
                timer.AutoReset = false;
                //timer.Start();
            }
        }
Example #15
0
 public FolderController(IFolderService folderService, UserManager <AppUser> userManager, ILogger <FolderController> logger, IMapper mapper)
 {
     _folderService = folderService;
     _userManager   = userManager;
     _logger        = logger;
     _mapper        = mapper;
 }
Example #16
0
        public PreferencesService(IFolderService folderService, IEventAggregator eventAggregator)
        {
            this.folderService   = folderService;
            this.eventAggregator = eventAggregator;

            this.commandLockObject = new object();
        }
Example #17
0
        internal FacadeUpdateResult <FolderData> SaveFolder(FolderData dto)
        {
            ArgumentValidator.IsNotNull("dto", dto);

            FacadeUpdateResult <FolderData> result = new FacadeUpdateResult <FolderData>();
            IFolderService service  = UnitOfWork.GetService <IFolderService>();
            Folder         instance = RetrieveOrNew <FolderData, Folder, IFolderService>(result.ValidationResult, dto.Id);

            if (result.IsSuccessful)
            {
                instance.Name          = dto.Name;
                instance.Slug          = dto.Slug;
                instance.ParentId      = dto.ParentId;
                instance.FolderType    = dto.FolderType;
                instance.Sort          = dto.Sort;
                instance.IsPublished   = dto.IsPublished;
                instance.IsSubsiteRoot = dto.IsSubsiteRoot;

                var saveQuery = service.Save(instance);

                result.AttachResult(instance.RetrieveData <FolderData>());
                result.Merge(saveQuery);
            }

            return(result);
        }
Example #18
0
 public VaultTimeoutService(
     ICryptoService cryptoService,
     IUserService userService,
     IPlatformUtilsService platformUtilsService,
     IStorageService storageService,
     IFolderService folderService,
     ICipherService cipherService,
     ICollectionService collectionService,
     ISearchService searchService,
     IMessagingService messagingService,
     ITokenService tokenService,
     Action <bool> lockedCallback,
     Func <bool, Task> loggedOutCallback)
 {
     _cryptoService        = cryptoService;
     _userService          = userService;
     _platformUtilsService = platformUtilsService;
     _storageService       = storageService;
     _folderService        = folderService;
     _cipherService        = cipherService;
     _collectionService    = collectionService;
     _searchService        = searchService;
     _messagingService     = messagingService;
     _tokenService         = tokenService;
     _lockedCallback       = lockedCallback;
     _loggedOutCallback    = loggedOutCallback;
 }
Example #19
0
        public PageLayoutSelectViewVM(IBookPageLayoutService bookPageLayoutService, IFolderService folderService)
        {
            _bookPageLayoutService = bookPageLayoutService;
            _folderService         = folderService;

            Title = (string)Application.Current.Resources["Program_Name"];
        }
Example #20
0
        public SyncService(
            IUserService userService,
            IApiService apiService,
            ISettingsService settingsService,
            IFolderService folderService,
            ICipherService cipherService,
            ICryptoService cryptoService,
            ICollectionService collectionService,
            IStorageService storageService,
            IMessagingService messagingService,
            ICozyClientService cozyClientService,
            Func <bool, Task> logoutCallbackAsync)
        {
            _userService       = userService;
            _apiService        = apiService;
            _settingsService   = settingsService;
            _folderService     = folderService;
            _cipherService     = cipherService;
            _cryptoService     = cryptoService;
            _collectionService = collectionService;
            _storageService    = storageService;
            _messagingService  = messagingService;

            #region cozy
            _cozyClientService = cozyClientService;
            #endregion

            _logoutCallbackAsync = logoutCallbackAsync;
        }
Example #21
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 GroupingsPageViewModel()
        {
            _cipherService           = ServiceContainer.Resolve <ICipherService>("cipherService");
            _folderService           = ServiceContainer.Resolve <IFolderService>("folderService");
            _collectionService       = ServiceContainer.Resolve <ICollectionService>("collectionService");
            _syncService             = ServiceContainer.Resolve <ISyncService>("syncService");
            _vaultTimeoutService     = ServiceContainer.Resolve <IVaultTimeoutService>("vaultTimeoutService");
            _deviceActionService     = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _platformUtilsService    = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _messagingService        = ServiceContainer.Resolve <IMessagingService>("messagingService");
            _stateService            = ServiceContainer.Resolve <IStateService>("stateService");
            _passwordRepromptService = ServiceContainer.Resolve <IPasswordRepromptService>("passwordRepromptService");
            _organizationService     = ServiceContainer.Resolve <IOrganizationService>("organizationService");
            _policyService           = ServiceContainer.Resolve <IPolicyService>("policyService");
            _logger = ServiceContainer.Resolve <ILogger>("logger");

            Loading        = true;
            GroupedItems   = new ObservableRangeCollection <IGroupingsPageListItem>();
            RefreshCommand = new Command(async() =>
            {
                Refreshing = true;
                await LoadAsync();
            });
            CipherOptionsCommand = new Command <CipherView>(CipherOptionsAsync);

            AccountSwitchingOverlayViewModel = new AccountSwitchingOverlayViewModel(_stateService, _messagingService, _logger)
            {
                AllowAddAccountRow = true
            };
        }
        public DirectShowPlayer(
            ILogger Logger_,
            IFolderService folderService,
            ILocalization loc_) : base(Logger_,folderService,loc_)
        {

        }
Example #24
0
        public SettingsListFoldersPage()
        {
            _folderService = Resolver.Resolve <IFolderService>();
            _userDialogs   = Resolver.Resolve <IUserDialogs>();

            Init();
        }
 public BasketActivitiesController(IBasketBlockService userService, IFileService fileService,
                                   IFolderService folderService)
 {
     _blockService  = userService;
     _folderService = folderService;
     _fileService   = fileService;
 }
Example #26
0
        internal IFacadeUpdateResult <FolderData> SaveFolderLanguage(FolderData dto, object languageId)
        {
            ArgumentValidator.IsNotNull("dto", dto);
            ArgumentValidator.IsNotNull("languageId", languageId);

            FacadeUpdateResult <FolderData> result = new FacadeUpdateResult <FolderData>();
            IFolderService service  = UnitOfWork.GetService <IFolderService>();
            Folder         instance = RetrieveOrNew <FolderData, Folder, IFolderService>(result.ValidationResult, dto.Id);

            if (result.IsSuccessful)
            {
                // Check existence of current language
                FolderLanguage FolderLanguage = instance.FolderLanguages.FirstOrDefault(o => object.Equals(o.LanguageId, languageId));
                if (FolderLanguage == null)
                {
                    FolderLanguage            = instance.FolderLanguages.AddNewBo();
                    FolderLanguage.LanguageId = languageId;
                }
                FolderLanguage.Name = dto.Name;

                var saveQuery = service.Save(instance);

                result.AttachResult(instance.RetrieveData <FolderData>());
                result.Merge(saveQuery);
            }

            return(result);
        }
Example #27
0
 public HomeController(IFolderService fodlerService, IUserService userService, IFileTypeService fileTypeService, IFileService fileService)
 {
     this.folderService   = fodlerService;
     this.userService     = userService;
     this.fileService     = fileService;
     this.fileTypeService = fileTypeService;
 }
 public GraphQLController(IFolderService folderService, IItemService itemService, IUserService userService, ILogger <GraphQLController> logger)
 {
     FolderService = folderService ?? throw new ArgumentNullException(nameof(folderService), $"{nameof(IFolderService)} not configured.");
     ItemService   = itemService ?? throw new ArgumentNullException(nameof(itemService), $"{nameof(IItemService)} not configured.");
     UserService   = userService ?? throw new ArgumentNullException(nameof(userService), $"{nameof(IUserService)} not configured.");
     Logger        = logger ?? throw new ArgumentNullException(nameof(logger), $"{nameof(ILogger<GraphQLController>)} not configured.");
 }
Example #29
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;
 }
        public override void ViewDidLoad()
        {
            _siteService            = Resolver.Resolve <ISiteService>();
            _connectivity           = Resolver.Resolve <IConnectivity>();
            _folderService          = Resolver.Resolve <IFolderService>();
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();

            View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);

            NameCell.TextField.Text          = Context?.Url?.Host ?? string.Empty;
            NameCell.TextField.ReturnKeyType = UIReturnKeyType.Next;
            NameCell.TextField.ShouldReturn += (UITextField tf) =>
            {
                UriCell.TextField.BecomeFirstResponder();
                return(true);
            };

            UriCell.TextField.Text          = Context?.Url?.ToString() ?? string.Empty;
            UriCell.TextField.KeyboardType  = UIKeyboardType.Url;
            UriCell.TextField.ReturnKeyType = UIReturnKeyType.Next;
            UriCell.TextField.ShouldReturn += (UITextField tf) =>
            {
                UsernameCell.TextField.BecomeFirstResponder();
                return(true);
            };

            UsernameCell.TextField.AutocapitalizationType = UITextAutocapitalizationType.None;
            UsernameCell.TextField.AutocorrectionType     = UITextAutocorrectionType.No;
            UsernameCell.TextField.SpellCheckingType      = UITextSpellCheckingType.No;
            UsernameCell.TextField.ReturnKeyType          = UIReturnKeyType.Next;
            UsernameCell.TextField.ShouldReturn          += (UITextField tf) =>
            {
                PasswordCell.TextField.BecomeFirstResponder();
                return(true);
            };

            PasswordCell.TextField.SecureTextEntry = true;
            PasswordCell.TextField.ReturnKeyType   = UIReturnKeyType.Next;
            PasswordCell.TextField.ShouldReturn   += (UITextField tf) =>
            {
                NotesCell.TextView.BecomeFirstResponder();
                return(true);
            };

            GeneratePasswordCell.TextLabel.Text = AppResources.GeneratePassword;
            GeneratePasswordCell.Accessory      = UITableViewCellAccessory.DisclosureIndicator;

            _folders = _folderService.GetAllAsync().GetAwaiter().GetResult();
            var folderNames = _folders.Select(s => s.Name.Decrypt()).OrderBy(s => s).ToList();

            folderNames.Insert(0, AppResources.FolderNone);
            FolderCell.Items = folderNames;

            TableView.RowHeight          = UITableView.AutomaticDimension;
            TableView.EstimatedRowHeight = 70;
            TableView.Source             = new TableSource(this);
            TableView.AllowsSelection    = true;

            base.ViewDidLoad();
        }
Example #31
0
        public GroupingsPageViewModel()
        {
            _cipherService           = ServiceContainer.Resolve <ICipherService>("cipherService");
            _folderService           = ServiceContainer.Resolve <IFolderService>("folderService");
            _collectionService       = ServiceContainer.Resolve <ICollectionService>("collectionService");
            _syncService             = ServiceContainer.Resolve <ISyncService>("syncService");
            _userService             = ServiceContainer.Resolve <IUserService>("userService");
            _vaultTimeoutService     = ServiceContainer.Resolve <IVaultTimeoutService>("vaultTimeoutService");
            _deviceActionService     = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _platformUtilsService    = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _messagingService        = ServiceContainer.Resolve <IMessagingService>("messagingService");
            _stateService            = ServiceContainer.Resolve <IStateService>("stateService");
            _storageService          = ServiceContainer.Resolve <IStorageService>("storageService");
            _passwordRepromptService = ServiceContainer.Resolve <IPasswordRepromptService>("passwordRepromptService");

            Loading        = true;
            PageTitle      = AppResources.MyVault;
            GroupedItems   = new ExtendedObservableCollection <GroupingsPageListGroup>();
            RefreshCommand = new Command(async() =>
            {
                Refreshing = true;
                await LoadAsync();
            });
            CipherOptionsCommand = new Command <CipherView>(CipherOptionsAsync);
        }
Example #32
0
        /// <summary>
        /// Constructs a new instance of the <see cref="GroupFileController"/>.
        /// </summary>
        /// <param name="fileService"></param>
        /// <param name="membershipService"></param>
        /// <param name="folderService"></param>
        /// <param name="localizationService"></param>
        public GroupFileController(IFileService fileService, IMembershipService membershipService, IFolderService folderService, ILocalizationService localizationService, IFileServerService fileServerService, IConfigurationProvider configurationProvider)
        {
            if (fileService is null)
            {
                throw new ArgumentNullException(nameof(fileService));
            }
            if (membershipService is null)
            {
                throw new ArgumentNullException(nameof(membershipService));
            }
            if (folderService is null)
            {
                throw new ArgumentNullException(nameof(folderService));
            }
            if (localizationService is null)
            {
                throw new ArgumentNullException(nameof(localizationService));
            }
            if (fileServerService is null)
            {
                throw new ArgumentNullException(nameof(fileServerService));
            }
            if (configurationProvider is null)
            {
                throw new ArgumentNullException(nameof(configurationProvider));
            }

            _fileService           = fileService;
            _membershipService     = membershipService;
            _folderService         = folderService;
            _localizationService   = localizationService;
            _fileServerService     = fileServerService;
            _configurationProvider = configurationProvider;
        }
Example #33
0
 public ExportService(
     IFolderService folderService,
     ICipherService cipherService)
 {
     _folderService = folderService;
     _cipherService = cipherService;
 }
Example #34
0
 public PageService(IDocumentSession session, IFolderService folderService, ITemplateService templateService,
                    ICacheProvider cacheProvider)
     : base(session)
 {
     this.folderService = folderService;
     this.templateService = templateService;
     this.cacheProvider = cacheProvider;
 }
        public TraverseService(IFileService fileService, IFolderService folderService)
        {
            if (fileService == null) throw new ArgumentNullException("fileService");
            if (folderService == null) throw new ArgumentNullException("folderService");

            _fileService = fileService;
            _folderService = folderService;
        }
 public DefaultMediaManagerApiOperations(IMediaTreeService mediaTree, IImagesService images, IImageService image,
     IFilesService files, IFileService file, IFoldersService folders, IFolderService folder)
 {
     MediaTree = mediaTree;
     Folders = folders;
     Folder = folder;
     Images = images;
     Image = image;
     Files = files;
     File = file;
 }
Example #37
0
 public ApplicationService(IDocumentSession session, IPageService pageService, ITemplateService templateService,
                           IFolderService folderService,
                           IPluginService pluginService, IMembershipService membershipService,
                           IFormsAuthenticationService formsService)
     : base(session)
 {
     this.pageService = pageService;
     this.pluginService = pluginService;
     this.templateService = templateService;
     this.folderService = folderService;
     this.membershipService = membershipService;
     this.formsService = formsService;
 }
Example #38
0
 public ContentManager(IApplicationService applicationService, IPageService pageService,
                       IFolderService folderService, ITemplateService templateService,
                       IWidgetService widgetService, IResourceService resourceService,
                       IPluginService pluginService, IMediaService mediaService)
 {
     Application = applicationService;
     Page = pageService;
     Folder = folderService;
     Template = templateService;
     Widget = widgetService;
     Resources = resourceService;
     Plugin = pluginService;
     Media = mediaService;
 }
        public WordsTranslation_ViewModel_WPF(
            INavigationService NavigationService_,
            IDialogService DialogService_,
            AppSetting AppSetting_,
            IAudioAPI AudioAPI_,
            IFolderService FolderService_,
            IMvxMessenger MvxMessenger_,
            ILocalization loc_
            ) : base (NavigationService_,DialogService_,AppSetting_,AudioAPI_,FolderService_,MvxMessenger_,loc_)
        {

            MaxWidth = UserModeWidth;
            MaxHeight = UserModeHeight;

            RightPanel_Properties.PropertyChanged += RightPanel_Properties_PropertyChanged;

            if (IsInDesignModeNet())
            {
                RightPanel_Properties.IsChecked = true;
            }
        }
Example #40
0
 public HttpCacheService(IFolderService folderService_)
 {
     folderService = folderService_;
 }
Example #41
0
 public FolderController(IFolderService folderService, IFeedService feedService, FeedsDbEntities context)
     : base(context)
 {
     _folderService = folderService;
     _feedService = feedService;
 }
Example #42
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FoldersService" /> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 public FoldersService(IRepository repository, IFolderService folderService)
 {
     this.repository = repository;
     this.folderService = folderService;
 }
        public WordsTranslation_ViewModel(
            INavigationService NavigationService_,
            IDialogService DialogService_,
            AppSetting AppSetting_,
            IAudioAPI AudioAPI_,
            IFolderService FolderService_,
            IMvxMessenger MvxMessenger_,
            ILocalization Loc_
            )
        {
            
            // Design mode settings
            bool isButtonPressed = true;
            bool isPressedTrueButton = false;
            if (IsInDesignMode)
            {
                //mode = WordsTranslation_parameters.ViewMode.FoundNewWord;
                mode = WordsTranslation_parameters.ViewMode.Edit; // Subtitle editor
                //mode = WordsTranslation_parameters.ViewMode.Training; // Training mode
                //mode = WordsTranslation_parameters.ViewMode.WordTranslation; // Dictionary
                //mode = WordsTranslation_parameters.ViewMode.Training;
                //mode = WordsTranslation_parameters.ViewMode.DictionaryItem; 
            }
            
            if (!IsInDesignMode)
            {
                NavigationService = NavigationService_;
                DialogService = DialogService_;
                AppSetting = AppSetting_;
                AudioAPI = AudioAPI_;
                FolderService  = FolderService_;
                MvxMessenger = MvxMessenger_;
                Tx = Loc_;

                Statuses = new ObservableCollection<WordStatuses>(Enumeration.GetAll<WordStatuses>());

                CommandDispatcher = new MvxCommand<string>(CmdDispatcher);
                PressWordButton_Command = new MvxCommand<ButtonModel>(PressWordButton_Cmd);
                Command_SelectLanguageService = new MvxCommand<LanguageService>(PressLanguageServiceButton_Cmd);

                PropertyChanged += WordsTranslation_ViewModel_PropertyChanged;
            }
            
            WordsForSelection_Buttons = new ObservableCollection<ButtonModel>();
            LanguageServiceCollection = new ObservableCollection<LanguageService>();
            
            btnNextButton = new ButtonModel();
            btnPreviousButton = new ButtonModel();
            btnAddToDictionary = new ButtonModel();
            btnSkip = new ButtonModel();
            WordsCollection_ListModel = new List_Model();
            btnTrainingNext = new ButtonModel();
            btnOk = new ButtonModel();
            Header_LabelModel = new Label_Model();
            Header2_LabelModel = new Label_Model();
            btnAllWordsList = new ButtonModel();
            MergeButton = new ButtonModel { IsEnabled = false };

            RightPanel_TranslationButton = new ButtonModel();
            RightPanel_Properties = new ButtonModel();
            RightPanel_AllWordsButton = new ButtonModel();

            SpeechParts = new ObservableCollection<Domain.SpeechParts>(Domain.SpeechParts.GetAll<SpeechParts>());

            if (IsInDesignMode)
            {

                //Statuses = WordOfDictionary.WordStatuses.Statuses;

                Header_LabelModel.Text = "This is a Header";
                Header2_LabelModel.Text = "second header";
                Tx = new LocalizationForDesignMode();

                CurrentWord = new WordOfDictionary();
                CurrentWord.word_of_dictionary = "White";
                CurrentWord.translation_as_string = "Белый";
                CurrentWord.transcription = "[wʌɪt]";
                CurrentWord.commentary = "Белый цвет, не черный, не зеленый, а [b]именно белый[/b]. \nСовершенно белый.\nНу может с [i]желтоватым отливом[/i]";
                CurrentWord.pictures_url = "http://d144fqpiyasmrr.cloudfront.net/uploads/picture/295623.png";
                CurrentWord.context = "of the color of milk or fresh snow, due to the reflection of most wavelengths of visible light; the opposite of black.";
                CurrentWord.SpeechPart = Domain.SpeechParts.Pronoun;
                
                CurrentWord.translations.Add(new TranslationOfWord {Translation="белый",Votes=150 });
                CurrentWord.translations.Add(new TranslationOfWord {Translation="беловатый",Votes=50 });
                CurrentWord.translations.Add(new TranslationOfWord {Translation="беленький, беловатый, бледноватный, беловатенькая, серобуромалиновенькая, ярко белая в крапинку",Votes=15 });
                
                WordsForSelection_Buttons.Add(new ButtonModel { Text="Зелёный"});
                WordsForSelection_Buttons.Add(new ButtonModel { Text="Белый"});
                WordsForSelection_Buttons.Add(new ButtonModel { Text="Черный"});
                WordsForSelection_Buttons.Add(new ButtonModel { Text="Пурпурный"});
                WordsForSelection_Buttons.Add(new ButtonModel { Text="Фиолетовый"});

                WordsCollection = new ObservableCollection<WordOfDictionary>();
                WordsCollection.Add(new WordOfDictionary {word_of_dictionary = "everybody"});
                WordsCollection.Add(new WordOfDictionary {word_of_dictionary = "likes"});
                WordsCollection.Add(new WordOfDictionary {word_of_dictionary = "cakes"});
                
                LanguageServiceCollection.Add(new LanguageService { Name = "Google translate"});
                LanguageServiceCollection.Add(new LanguageService { Name = "Yandex translate"});
                LanguageServiceCollection.Add(new LanguageService { Name = "LinguaLeo"});
                LanguageServiceCollection.Add(new LanguageService { Name = "Macmillan dictionary"});
                
                SetCurrentWord(CurrentWord);

                MergeWithStr = "I am";
                FoundedWord = new WordOfDictionary { word_of_dictionary = MergeWithStr };

                SpeechParts = new ObservableCollection<SpeechParts>
                {
                    Domain.SpeechParts.Adverb,
                    Domain.SpeechParts.Article,
                    Domain.SpeechParts.Conjuction,
                    Domain.SpeechParts.Pronoun
                };


            }

            if (IsInDesignMode)
            {
                if (mode == WordsTranslation_parameters.ViewMode.Training || mode == WordsTranslation_parameters.ViewMode.FoundNewWord)
                {
                    if (isButtonPressed)
                    {
                        PressWordButton_Cmd(new ButtonModel { IsItTrue = isPressedTrueButton});
                    }
                }

            }

            
        }
Example #44
0
 public DefaultPresenter()
 {
     _folderService = ObjectFactory.GetInstance<IFolderService>();
     _userSession = ObjectFactory.GetInstance<IUserSession>();
 }
Example #45
0
 public WPFPlayer(ILogger Logger_,IFolderService folderService_,ILocalization loc_,bool starttimer = true) : base(Logger_,folderService_,loc_,starttimer)
 {
     MediaElement = new MediaElement();
 }
Example #46
0
    protected void Page_Load(object sender, EventArgs e)
    {
        i18n = new i18nHelper();
        this.Title = i18n.GetMessage("m261") + " @ " + i18n.GetMessage("m9");
        this.forwardSend.Text = i18n.GetMessage("m78");
        currentUser = WebUtility.GetCurrentKBUser();
        subjectid = currentUser.SubjectId;
        documentService = factory.GetDocumentService();
        categoryService = factory.GetCategoryService();
        ratingService = factory.GetRatingService();
        auditTrailService = factory.GetAuditTrailService();
        wfService = factory.GetWorkflowService();
        hitService = factory.GetHitService();
        documentClassService = factory.GetDocumentClassService();
        subscribeService = WebUtility.Repository.GetSubscribeService();
        docId = WebUtility.GetIntegerParameter("documentId");
        folderId = WebUtility.GetIntegerParameter("folderId", -1);
        ver = WebUtility.GetIntegerParameter("ver", 0);
        latestVersionNumber = buildVersionInfo();
        currentUserOutputConfig = WebUtility.GetUserOutputConfig(currentUser.SubjectId);
        attachMode = currentUserOutputConfig.AttachMode;
        showUsedTags = ConfigurationManager.AppSettings["ShowUsedTags"] != null ? ConfigurationManager.AppSettings["ShowUsedTags"] : "false";
        tagsAutoComplete = ConfigurationManager.AppSettings["TagsAutoComplete"] != null ? ConfigurationManager.AppSettings["TagsAutoComplete"] : "false";
        tagsSuggestListLen = ConfigurationManager.AppSettings["TagsSuggestListLen"] != null ? ConfigurationManager.AppSettings["TagsSuggestListLen"] : "10";
        subscriptionConfirm = Convert.ToBoolean(ConfigurationManager.AppSettings["SubscriptionConfirm"] != null ? ConfigurationManager.AppSettings["SubscriptionConfirm"].ToString() : "true");
        autoSubscription = Convert.ToBoolean(ConfigurationManager.AppSettings["AutoSubscription"] != null ? ConfigurationManager.AppSettings["AutoSubscription"].ToString() : "true");
        allowSendToNoPrivilegeUser = Convert.ToBoolean(ConfigurationManager.AppSettings["AllowSendToNoPrivilegeUser"] != null ? ConfigurationManager.AppSettings["AllowSendToNoPrivilegeUser"].ToString() : "true");
        TagMaxLength = ConfigurationManager.AppSettings["TagMaxLength"] != null ? ConfigurationManager.AppSettings["TagMaxLength"] : "30";
        IsSafari = (Request.Browser.Browser.ToLower().Equals("applemac-safari") && !Request.UserAgent.ToLower().Contains("chrome"));
        userHadSubscribeResource = subscribeService.UserHadSubscribedResource(currentUser.SubjectId, (int)currentUser.SubjectType, docId, (int)SubscribeRecord.ResourceType.Document);
        mailService = WebUtility.Repository.GetMailService();
        kbuserService = WebUtility.Repository.GetKBUserService();
        folderService = WebUtility.Repository.GetFolderService();
        forwardService = WebUtility.Repository.GetForwardService();
        if (ver == 0)
        {
            doc = documentService.GetDocument(currentUser, docId);
            ver = latestVersionNumber;
        }
        else
        {
            doc = documentService.GetDocument(currentUser, docId, ver);
        }
        readVersion.Text = ver.ToString();
        latestVersion.Text = latestVersionNumber.ToString();
        if (ver != latestVersionNumber)
        {
            Panel1.Visible = false;
        }
        if (folderId == -1)
        {
            FolderInfo f = documentService.GetParentFolders(currentUser, docId)[0];
            folderId = f.FolderId;
        }

        buildCategoriesList();
        buildDocumentView();

        #region For teamKube Xml Render
        if (IsACLiteSubjectProvider)
        {
            renderSpecXml = RenderSpecificXML(currentUser, doc.DocumentId, ver);
        }
        #endregion

        if(!doc.DocumentClass.ClassName.Trim().ToLower().Equals("filesystem"))
        {
            buildFileList();
        }

        buildRatingSummary();
        buildAuditTrailInfo();
        createHitInfo();
        buildRelatedTagList(20);
        buildRelatedDocumentList();
        checkWorkflowInvolved();
        isDiffDocClass = IsDiffDocumentClass();
        strDiffDocClass = String.Format(i18n.GetMessage("m801"), doc.DocumentClass.ClassName, i18n.GetMessage("m802"), i18n.GetMessage("m803"));

        isBuiltinDocumentClass = (doc.DocumentClass.IsBuiltIn == true) ? "true" : "false";
    }