• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IServerApplicationPaths类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IServerApplicationPaths的典型用法代码示例。如果您正苦于以下问题:C# IServerApplicationPaths类的具体用法?C# IServerApplicationPaths怎么用?C# IServerApplicationPaths使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IServerApplicationPaths类属于命名空间,在下文中一共展示了IServerApplicationPaths类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SqliteUserRepository

        public SqliteUserRepository(ILogManager logManager, IServerApplicationPaths appPaths, IJsonSerializer jsonSerializer, IDbConnector dbConnector, IMemoryStreamProvider memoryStreamProvider) : base(logManager, dbConnector)
        {
            _jsonSerializer = jsonSerializer;
            _memoryStreamProvider = memoryStreamProvider;

            DbFilePath = Path.Combine(appPaths.DataPath, "users.db");
        }
开发者ID:t-andre,项目名称:Emby,代码行数:7,代码来源:SqliteUserRepository.cs


示例2: BifService

 public BifService(IServerApplicationPaths appPaths, ILibraryManager libraryManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem)
 {
     _appPaths = appPaths;
     _libraryManager = libraryManager;
     _mediaEncoder = mediaEncoder;
     _fileSystem = fileSystem;
 }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:7,代码来源:BifService.cs


示例3: AddMediaPath

        /// <summary>
        /// Adds an additional mediaPath to an existing virtual folder, within either the default view or a user view
        /// </summary>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="virtualFolderName">Name of the virtual folder.</param>
        /// <param name="path">The path.</param>
        /// <param name="user">The user.</param>
        /// <param name="appPaths">The app paths.</param>
        /// <exception cref="System.ArgumentException">The path is not valid.</exception>
        /// <exception cref="System.IO.DirectoryNotFoundException">The path does not exist.</exception>
        public static void AddMediaPath(IFileSystem fileSystem, string virtualFolderName, string path, User user, IServerApplicationPaths appPaths)
        {
            if (!Directory.Exists(path))
            {
                throw new DirectoryNotFoundException("The path does not exist.");
            }

            // Strip off trailing slash, but not on drives
            path = path.TrimEnd(Path.DirectorySeparatorChar);
            if (path.EndsWith(":", StringComparison.OrdinalIgnoreCase))
            {
                path += Path.DirectorySeparatorChar;
            }

            var rootFolderPath = user != null ? user.RootFolderPath : appPaths.DefaultUserViewsPath;
            var virtualFolderPath = Path.Combine(rootFolderPath, virtualFolderName);

            ValidateNewMediaPath(fileSystem, rootFolderPath, path, appPaths);

            var shortcutFilename = Path.GetFileNameWithoutExtension(path);

            var lnk = Path.Combine(virtualFolderPath, shortcutFilename + ShortcutFileExtension);

            while (File.Exists(lnk))
            {
                shortcutFilename += "1";
                lnk = Path.Combine(virtualFolderPath, shortcutFilename + ShortcutFileExtension);
            }

            fileSystem.CreateShortcut(lnk, path);
        }
开发者ID:RomanDengin,项目名称:MediaBrowser,代码行数:41,代码来源:LibraryHelpers.cs


示例4: ImageProcessor

        public ImageProcessor(ILogger logger, IServerApplicationPaths appPaths, IFileSystem fileSystem, IJsonSerializer jsonSerializer)
        {
            _logger = logger;
            _fileSystem = fileSystem;
            _jsonSerializer = jsonSerializer;
            _appPaths = appPaths;

            _saveImageSizeTimer = new Timer(SaveImageSizeCallback, null, Timeout.Infinite, Timeout.Infinite);

            Dictionary<Guid, ImageSize> sizeDictionary;

            try
            {
                sizeDictionary = jsonSerializer.DeserializeFromFile<Dictionary<Guid, ImageSize>>(ImageSizeFile) ?? 
                    new Dictionary<Guid, ImageSize>();
            }
            catch (FileNotFoundException)
            {
                // No biggie
                sizeDictionary = new Dictionary<Guid, ImageSize>();
            }
            catch (Exception ex)
            {
                logger.ErrorException("Error parsing image size cache file", ex);

                sizeDictionary = new Dictionary<Guid, ImageSize>();
            }

            _cachedImagedSizes = new ConcurrentDictionary<Guid, ImageSize>(sizeDictionary);
        }
开发者ID:Tensre,项目名称:MediaBrowser,代码行数:30,代码来源:ImageProcessor.cs


示例5: RenameVirtualFolder

        /// <summary>
        /// Renames the virtual folder.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="newName">The new name.</param>
        /// <param name="user">The user.</param>
        /// <param name="appPaths">The app paths.</param>
        /// <exception cref="System.IO.DirectoryNotFoundException">The media collection does not exist</exception>
        /// <exception cref="System.ArgumentException">There is already a media collection with the name  + newPath + .</exception>
        public static void RenameVirtualFolder(string name, string newName, User user, IServerApplicationPaths appPaths)
        {
            var rootFolderPath = user != null ? user.RootFolderPath : appPaths.DefaultUserViewsPath;

            var currentPath = Path.Combine(rootFolderPath, name);
            var newPath = Path.Combine(rootFolderPath, newName);

            if (!Directory.Exists(currentPath))
            {
                throw new DirectoryNotFoundException("The media collection does not exist");
            }

            if (!string.Equals(currentPath, newPath, StringComparison.OrdinalIgnoreCase) && Directory.Exists(newPath))
            {
                throw new ArgumentException("There is already a media collection with the name " + newPath + ".");
            }
            //Only make a two-phase move when changing capitalization
            if (string.Equals(currentPath, newPath, StringComparison.OrdinalIgnoreCase))
            {
                //Create an unique name
                var temporaryName = Guid.NewGuid().ToString();
                var temporaryPath = Path.Combine(rootFolderPath, temporaryName);
                Directory.Move(currentPath,temporaryPath);
                currentPath = temporaryPath;
            }

            Directory.Move(currentPath, newPath);
        }
开发者ID:0sm0,项目名称:MediaBrowser,代码行数:37,代码来源:LibraryHelpers.cs


示例6: ApiEntryPoint

        /// <summary>
        /// Initializes a new instance of the <see cref="ApiEntryPoint" /> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="appPaths">The application paths.</param>
        public ApiEntryPoint(ILogger logger, IServerApplicationPaths appPaths)
        {
            Logger = logger;
            AppPaths = appPaths;

            Instance = this;
        }
开发者ID:jscorrea,项目名称:MediaBrowser,代码行数:12,代码来源:ApiEntryPoint.cs


示例7: AddMediaPath

        /// <summary>
        /// Adds an additional mediaPath to an existing virtual folder, within either the default view or a user view
        /// </summary>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="virtualFolderName">Name of the virtual folder.</param>
        /// <param name="path">The path.</param>
        /// <param name="appPaths">The app paths.</param>
        public static void AddMediaPath(IFileSystem fileSystem, string virtualFolderName, string path, IServerApplicationPaths appPaths)
        {
            if (string.IsNullOrWhiteSpace(path))
            {
                throw new ArgumentNullException("path");
            }

			if (!fileSystem.DirectoryExists(path))
            {
                throw new DirectoryNotFoundException("The path does not exist.");
            }

            var rootFolderPath = appPaths.DefaultUserViewsPath;
            var virtualFolderPath = Path.Combine(rootFolderPath, virtualFolderName);

            var shortcutFilename = fileSystem.GetFileNameWithoutExtension(path);

            var lnk = Path.Combine(virtualFolderPath, shortcutFilename + ShortcutFileExtension);

			while (fileSystem.FileExists(lnk))
            {
                shortcutFilename += "1";
                lnk = Path.Combine(virtualFolderPath, shortcutFilename + ShortcutFileExtension);
            }

            fileSystem.CreateShortcut(lnk, path);
        }
开发者ID:rezafouladian,项目名称:Emby,代码行数:34,代码来源:LibraryHelpers.cs


示例8: AppThemeManager

 public AppThemeManager(IServerApplicationPaths appPaths, IFileSystem fileSystem, IJsonSerializer json, ILogger logger)
 {
     _appPaths = appPaths;
     _fileSystem = fileSystem;
     _json = json;
     _logger = logger;
 }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:7,代码来源:AppThemeManager.cs


示例9: BaseStreamingService

 /// <summary>
 /// Initializes a new instance of the <see cref="BaseStreamingService" /> class.
 /// </summary>
 /// <param name="appPaths">The app paths.</param>
 /// <param name="userManager">The user manager.</param>
 /// <param name="libraryManager">The library manager.</param>
 /// <param name="isoManager">The iso manager.</param>
 /// <param name="mediaEncoder">The media encoder.</param>
 protected BaseStreamingService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder)
 {
     ApplicationPaths = appPaths;
     UserManager = userManager;
     LibraryManager = libraryManager;
     IsoManager = isoManager;
     MediaEncoder = mediaEncoder;
 }
开发者ID:0sm0,项目名称:MediaBrowser,代码行数:16,代码来源:BaseStreamingService.cs


示例10: ImageCleanupTask

 /// <summary>
 /// Initializes a new instance of the <see cref="ImageCleanupTask" /> class.
 /// </summary>
 /// <param name="kernel">The kernel.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="libraryManager">The library manager.</param>
 /// <param name="appPaths">The app paths.</param>
 public ImageCleanupTask(Kernel kernel, ILogger logger, ILibraryManager libraryManager, IServerApplicationPaths appPaths, IItemRepository itemRepo)
 {
     _kernel = kernel;
     _logger = logger;
     _libraryManager = libraryManager;
     _appPaths = appPaths;
     _itemRepo = itemRepo;
 }
开发者ID:snap608,项目名称:MediaBrowser,代码行数:15,代码来源:ImageCleanupTask.cs


示例11: ApiEntryPoint

        /// <summary>
        /// Initializes a new instance of the <see cref="ApiEntryPoint" /> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="appPaths">The application paths.</param>
        /// <param name="sessionManager">The session manager.</param>
        public ApiEntryPoint(ILogger logger, IServerApplicationPaths appPaths, ISessionManager sessionManager)
        {
            Logger = logger;
            _appPaths = appPaths;
            _sessionManager = sessionManager;

            Instance = this;
        }
开发者ID:jmarsh0507,项目名称:MediaBrowser,代码行数:14,代码来源:ApiEntryPoint.cs


示例12: LiveTvManager

 public LiveTvManager(IServerApplicationPaths appPaths, IFileSystem fileSystem, ILogger logger, IItemRepository itemRepo, IImageProcessor imageProcessor)
 {
     _appPaths = appPaths;
     _fileSystem = fileSystem;
     _logger = logger;
     _itemRepo = itemRepo;
     _imageProcessor = imageProcessor;
 }
开发者ID:kreeturez,项目名称:MediaBrowser,代码行数:8,代码来源:LiveTvManager.cs


示例13: LocalizedStrings

        /// <summary>
        /// Initializes a new instance of the <see cref="LocalizedStrings" /> class.
        /// </summary>
        public LocalizedStrings(IServerApplicationPaths appPaths)
        {
            _appPaths = appPaths;

            foreach (var stringObject in StringFiles)
            {
                AddStringData(LoadFromFile(GetFileName(stringObject),stringObject.GetType()));
            }
        }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:12,代码来源:LocalizedStrings.cs


示例14: ImageManager

        /// <summary>
        /// Initializes a new instance of the <see cref="ImageManager" /> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="appPaths">The app paths.</param>
        /// <param name="itemRepo">The item repo.</param>
        public ImageManager(ILogger logger, IServerApplicationPaths appPaths, IItemRepository itemRepo)
        {
            _logger = logger;
            _itemRepo = itemRepo;

            ImageSizeCache = new FileSystemRepository(Path.Combine(appPaths.ImageCachePath, "image-sizes"));
            ResizedImageCache = new FileSystemRepository(Path.Combine(appPaths.ImageCachePath, "resized-images"));
            CroppedImageCache = new FileSystemRepository(Path.Combine(appPaths.ImageCachePath, "cropped-images"));
            EnhancedImageCache = new FileSystemRepository(Path.Combine(appPaths.ImageCachePath, "enhanced-images"));
        }
开发者ID:JasoonJ,项目名称:MediaBrowser,代码行数:16,代码来源:ImageManager.cs


示例15: ImageProcessor

        public ImageProcessor(ILogger logger, IServerApplicationPaths appPaths)
        {
            _logger = logger;
            _appPaths = appPaths;

            _imageSizeCachePath = Path.Combine(_appPaths.ImageCachePath, "image-sizes");
            _croppedWhitespaceImageCachePath = Path.Combine(_appPaths.ImageCachePath, "cropped-images");
            _enhancedImageCachePath = Path.Combine(_appPaths.ImageCachePath, "enhanced-images");
            _resizedImageCachePath = Path.Combine(_appPaths.ImageCachePath, "resized-images");
        }
开发者ID:Kampari,项目名称:MediaBrowser,代码行数:10,代码来源:ImageProcessor.cs


示例16: FFMpegManager

        /// <summary>
        /// Initializes a new instance of the <see cref="FFMpegManager" /> class.
        /// </summary>
        /// <param name="appPaths">The app paths.</param>
        /// <param name="encoder">The encoder.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="itemRepo">The item repo.</param>
        /// <exception cref="System.ArgumentNullException">zipClient</exception>
        public FFMpegManager(IServerApplicationPaths appPaths, IMediaEncoder encoder, ILogger logger, IItemRepository itemRepo)
        {
            _appPaths = appPaths;
            _encoder = encoder;
            _logger = logger;
            _itemRepo = itemRepo;

            VideoImageCache = new FileSystemRepository(VideoImagesDataPath);
            SubtitleCache = new FileSystemRepository(SubtitleCachePath);
        }
开发者ID:Kampari,项目名称:MediaBrowser,代码行数:18,代码来源:FFMpegManager.cs


示例17: EncodedRecorder

 public EncodedRecorder(ILogger logger, IFileSystem fileSystem, IMediaEncoder mediaEncoder, IServerApplicationPaths appPaths, IJsonSerializer json, LiveTvOptions liveTvOptions, IHttpClient httpClient)
 {
     _logger = logger;
     _fileSystem = fileSystem;
     _mediaEncoder = mediaEncoder;
     _appPaths = appPaths;
     _json = json;
     _liveTvOptions = liveTvOptions;
     _httpClient = httpClient;
 }
开发者ID:softworkz,项目名称:Emby,代码行数:10,代码来源:EncodedRecorder.cs


示例18: BaseStreamingService

 /// <summary>
 /// Initializes a new instance of the <see cref="BaseStreamingService" /> class.
 /// </summary>
 /// <param name="appPaths">The app paths.</param>
 /// <param name="userManager">The user manager.</param>
 /// <param name="libraryManager">The library manager.</param>
 /// <param name="isoManager">The iso manager.</param>
 /// <param name="mediaEncoder">The media encoder.</param>
 protected BaseStreamingService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IDtoService dtoService, IFileSystem fileSystem)
 {
     FileSystem = fileSystem;
     DtoService = dtoService;
     ApplicationPaths = appPaths;
     UserManager = userManager;
     LibraryManager = libraryManager;
     IsoManager = isoManager;
     MediaEncoder = mediaEncoder;
 }
开发者ID:Jon-theHTPC,项目名称:MediaBrowser,代码行数:18,代码来源:BaseStreamingService.cs


示例19: LiveTvManager

        public LiveTvManager(IServerApplicationPaths appPaths, IFileSystem fileSystem, ILogger logger, IItemRepository itemRepo, IImageProcessor imageProcessor, ILocalizationManager localization, IUserDataManager userDataManager, IDtoService dtoService, IUserManager userManager)
        {
            _appPaths = appPaths;
            _fileSystem = fileSystem;
            _logger = logger;
            _itemRepo = itemRepo;
            _localization = localization;
            _userManager = userManager;

            _tvDtoService = new LiveTvDtoService(dtoService, userDataManager, imageProcessor, logger);
        }
开发者ID:RomanDengin,项目名称:MediaBrowser,代码行数:11,代码来源:LiveTvManager.cs


示例20: UserViewManager

 public UserViewManager(ILibraryManager libraryManager, ILocalizationManager localizationManager, IFileSystem fileSystem, IUserManager userManager, IChannelManager channelManager, ILiveTvManager liveTvManager, IServerApplicationPaths appPaths, IPlaylistManager playlists)
 {
     _libraryManager = libraryManager;
     _localizationManager = localizationManager;
     _fileSystem = fileSystem;
     _userManager = userManager;
     _channelManager = channelManager;
     _liveTvManager = liveTvManager;
     _appPaths = appPaths;
     _playlists = playlists;
 }
开发者ID:Sile626,项目名称:MediaBrowser,代码行数:11,代码来源:UserViewManager.cs



注:本文中的IServerApplicationPaths类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IServerChannelSink类代码示例发布时间:2022-05-24
下一篇:
C# IServerApplicationHost类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap