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

C# IDirectoryService类代码示例

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

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



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

示例1: LoginViewModel

		public LoginViewModel (IDirectoryService service)
		{
			this.service = service;

			Username = "";
			Password = "";
		}
开发者ID:JeffHarms,项目名称:xamarin-forms-samples-1,代码行数:7,代码来源:LoginViewModel.cs


示例2: GetImages

        public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
        {
            var parentPath = Path.GetDirectoryName(item.Path);

            var parentPathFiles = directoryService.GetFileSystemEntries(parentPath)
                .ToList();

            var nameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(item.Path);

            var files = GetFilesFromParentFolder(nameWithoutExtension, parentPathFiles);

            if (files.Count > 0)
            {
                return files;
            }

            var metadataPath = Path.Combine(parentPath, "metadata");

            if (parentPathFiles.Any(i => string.Equals(i.FullName, metadataPath, StringComparison.OrdinalIgnoreCase)))
            {
                return GetFilesFromParentFolder(nameWithoutExtension, directoryService.GetFiles(metadataPath));
            }

            return new List<LocalImageInfo>();
        }
开发者ID:NickBolles,项目名称:Emby,代码行数:25,代码来源:EpisodeLocalImageProvider.cs


示例3: ImageRefreshOptions

        public ImageRefreshOptions(IDirectoryService directoryService)
        {
            ImageRefreshMode = ImageRefreshMode.Default;
            DirectoryService = directoryService;

            ReplaceImages = new List<ImageType>();
        }
开发者ID:Ceten,项目名称:MediaBrowser,代码行数:7,代码来源:MetadataRefreshOptions.cs


示例4: LoginViewModel

        public LoginViewModel(IDirectoryService service)
        {
            this.service = service;

            Username = string.Empty;
            Password = string.Empty;
        }
开发者ID:tranuydu,项目名称:prebuilt-apps,代码行数:7,代码来源:LoginViewModel.cs


示例5: SetInitialItemValues

        /// <summary>
        /// Sets the initial item values.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="parent">The parent.</param>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="libraryManager">The library manager.</param>
        /// <param name="directoryService">The directory service.</param>
        /// <exception cref="System.ArgumentException">Item must have a path</exception>
        public static void SetInitialItemValues(BaseItem item, Folder parent, IFileSystem fileSystem, ILibraryManager libraryManager, IDirectoryService directoryService)
        {
            // This version of the below method has no ItemResolveArgs, so we have to require the path already being set
            if (string.IsNullOrWhiteSpace(item.Path))
            {
                throw new ArgumentException("Item must have a Path");
            }

            // If the resolver didn't specify this
            if (parent != null)
            {
                item.Parent = parent;
            }

            item.Id = libraryManager.GetNewItemId(item.Path, item.GetType());

            item.IsLocked = item.Path.IndexOf("[dontfetchmeta]", StringComparison.OrdinalIgnoreCase) != -1 ||
                item.Parents.Any(i => i.IsLocked);

            // Make sure DateCreated and DateModified have values
            var fileInfo = directoryService.GetFile(item.Path);
            item.DateModified = fileSystem.GetLastWriteTimeUtc(fileInfo);
            SetDateCreated(item, fileSystem, fileInfo);

            EnsureName(item, fileInfo);
        }
开发者ID:jrags56,项目名称:MediaBrowser,代码行数:35,代码来源:ResolverHelper.cs


示例6: AppDataService

        public AppDataService(IMessageService messageService, ISaveFileService saveFileService, 
            IProcessService processService, IDirectoryService directoryService, IFileService fileService)
        {
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => saveFileService);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => directoryService);
            Argument.IsNotNull(() => fileService);

            _messageService = messageService;
            _saveFileService = saveFileService;
            _processService = processService;
            _directoryService = directoryService;
            _fileService = fileService;

            ExclusionFilters = new List<string>(new []
            {
                "licenseinfo.xml",
                "*.log"
            });

            var applicationDataDirectory = Catel.IO.Path.GetApplicationDataDirectory();

            _directoryService.Create(applicationDataDirectory);

            ApplicationDataDirectory = applicationDataDirectory;
        }
开发者ID:WildGums,项目名称:Orchestra,代码行数:27,代码来源:AppDataService.cs


示例7: RibbonViewModel

        public RibbonViewModel(INavigationService navigationService, IUIVisualizerService uiVisualizerService,
            ICommandManager commandManager, IRecentlyUsedItemsService recentlyUsedItemsService, IProcessService processService,
            IMessageService messageService, ISelectDirectoryService selectDirectoryService, IDirectoryService directoryService)
        {
            Argument.IsNotNull(() => navigationService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => commandManager);
            Argument.IsNotNull(() => recentlyUsedItemsService);
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => selectDirectoryService);
            Argument.IsNotNull(() => directoryService);

            _navigationService = navigationService;
            _uiVisualizerService = uiVisualizerService;
            _recentlyUsedItemsService = recentlyUsedItemsService;
            _processService = processService;
            _messageService = messageService;
            _selectDirectoryService = selectDirectoryService;
            _directoryService = directoryService;

            OpenProject = new Command(OnOpenProjectExecute);
            OpenRecentlyUsedItem = new Command<string>(OnOpenRecentlyUsedItemExecute);
            OpenInExplorer = new Command<string>(OnOpenInExplorerExecute);
            UnpinItem = new Command<string>(OnUnpinItemExecute);
            PinItem = new Command<string>(OnPinItemExecute);

            ShowKeyboardMappings = new Command(OnShowKeyboardMappingsExecute);

            commandManager.RegisterCommand("File.Open", OpenProject, this);

            var assembly = AssemblyHelper.GetEntryAssembly();
            Title = assembly.Title();
        }
开发者ID:WildGums,项目名称:Orchestra,代码行数:34,代码来源:RibbonViewModel.cs


示例8: EndpointResolverService

 public EndpointResolverService(IDirectoryService directoryService, IDefaultEndpointConfiguration defaultEndpointConfiguration, IUrlBuilder urlBuilder, IDirectoryRepository directoryRepository, ILogger logger)
 {
     _directoryService = directoryService;
     _defaultEndpointConfiguration = defaultEndpointConfiguration;
     _urlBuilder = urlBuilder;
     _directoryRepository = directoryRepository;
     _logger = logger;
 }
开发者ID:letmeproperty,项目名称:callcentre,代码行数:8,代码来源:EndpointResolverService.cs


示例9: DirectoryController

 public DirectoryController(IEndpointResolverService endpointResolverService, IAccountSettings accountSettings, ICallService callService, ILogger logger, IDirectoryService directoryService)
 {
     _endpointResolverService = endpointResolverService;
     _accountSettings = accountSettings;
     _callService = callService;
     _logger = logger;
     _directoryService = directoryService;
 }
开发者ID:letmeproperty,项目名称:callcentre,代码行数:8,代码来源:DirectoryController.cs


示例10: GetImages

        public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
        {
            var files = GetFiles(item, true, directoryService).ToList();

            var list = new List<LocalImageInfo>();

            PopulateImages(item, list, files, true, directoryService);

            return list;
        }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:10,代码来源:LocalImageProvider.cs


示例11: SearchViewModel

		public SearchViewModel (IDirectoryService service, Search search)
		{
			if (service == null) throw new ArgumentNullException ("service");
			this.service = service;

			if (search == null) throw new ArgumentNullException ("search");
			this.search = search;

			SetGroupedPeople ();
		}
开发者ID:JeffHarms,项目名称:xamarin-forms-samples-1,代码行数:10,代码来源:SearchViewModel.cs


示例12: HasChanged

        public bool HasChanged(IHasMetadata item, IDirectoryService directoryService)
        {
            var liveTvItem = item as ILiveTvRecording;

            if (liveTvItem != null)
            {
                return !liveTvItem.HasImage(ImageType.Primary);
            }
            return false;
        }
开发者ID:paul-777,项目名称:Emby,代码行数:10,代码来源:RecordingImageProvider.cs


示例13: CodeGenerationService

        public CodeGenerationService(IEntityPluralService entityPluralService, IFileService fileService, IDirectoryService directoryService)
        {
            Argument.IsNotNull(() => entityPluralService);
            Argument.IsNotNull(() => fileService);
            Argument.IsNotNull(() => directoryService);

            _entityPluralService = entityPluralService;
            _fileService = fileService;
            _directoryService = directoryService;
        }
开发者ID:WildGums,项目名称:Orc.CsvHelper,代码行数:10,代码来源:CodeGenerationService.cs


示例14: HasChanged

        public bool HasChanged(IHasMetadata item, MetadataStatus status, IDirectoryService directoryService)
        {
            var liveTvItem = item as LiveTvProgram;

            if (liveTvItem != null)
            {
                return !liveTvItem.HasImage(ImageType.Primary);
            }
            return false;
        }
开发者ID:rezafouladian,项目名称:Emby,代码行数:10,代码来源:ProgramImageProvider.cs


示例15: HasChanged

        public bool HasChanged(IHasMetadata item, IDirectoryService directoryService, DateTime date)
        {
            var channelItem = item as IChannelItem;

            if (channelItem != null)
            {
                return !channelItem.HasImage(ImageType.Primary) && !string.IsNullOrWhiteSpace(channelItem.OriginalImageUrl);
            }
            return false;
        }
开发者ID:Sile626,项目名称:MediaBrowser,代码行数:10,代码来源:ChannelItemImageProvider.cs


示例16: GetImages

        public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
        {
            var path = _config.ApplicationPaths.GetInternalMetadataPath(item.Id);

            try
            {
                return new LocalImageProvider().GetImages(item, path, directoryService);
            }
            catch (DirectoryNotFoundException)
            {
                return new List<LocalImageInfo>();
            }
        }
开发者ID:Rycius,项目名称:MediaBrowser,代码行数:13,代码来源:InternalMetadataFolderImageProvider.cs


示例17: GetImages

        public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
        {
            var path = item.GetInternalMetadataPath();

            try
            {
                return new LocalImageProvider(_fileSystem).GetImages(item, path, true, directoryService);
            }
            catch (DirectoryNotFoundException)
            {
                return new List<LocalImageInfo>();
            }
        }
开发者ID:Ceten,项目名称:MediaBrowser,代码行数:13,代码来源:InternalMetadataFolderImageProvider.cs


示例18: ImageRepository

        public ImageRepository(HttpServerUtilityBase server, IDirectoryService directory, string rootPath)
        {
            string path = server.MapPath(rootPath);
            var files = directory.EnumerateFiles(path, "*.jpg");

            foreach (var file in files) {

                string imageUrl = VirtualPathUtility.Combine(VirtualPathUtility.AppendTrailingSlash(rootPath), Path.GetFileName(file));
                string metaPath = file + ".meta";
                using (var reader = directory.GetReader(metaPath)) {
                    _images.Add(new ImageMetadata(imageUrl, reader));
                }
            }
        }
开发者ID:JanivZ,项目名称:letmebingthatforyou,代码行数:14,代码来源:ImageRepository.cs


示例19: GetImages

        public List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService)
        {
            var name = _fileSystem.GetValidFilename(item.Name);

            var path = Path.Combine(_config.ApplicationPaths.GeneralPath, name);

            try
            {
                return new LocalImageProvider(_fileSystem).GetImages(item, path, directoryService);
            }
            catch (DirectoryNotFoundException)
            {
                return new List<LocalImageInfo>();
            }
        }
开发者ID:paul-777,项目名称:Emby,代码行数:15,代码来源:ImagesByNameImageProvider.cs


示例20: ValidateChildrenInternal

        protected override async Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
        {
            await base.ValidateChildrenInternal(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService)
                .ConfigureAwait(false);

            // Not the best way to handle this, but it solves an issue
            // CollectionFolders aren't always getting saved after changes
            // This means that grabbing the item by Id may end up returning the old one
            // Fix is in two places - make sure the folder gets saved
            // And here to remedy it for affected users.
            // In theory this can be removed eventually.
            foreach (var item in Children)
            {
                LibraryManager.RegisterItem(item);
            }
        }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:16,代码来源:UserRootFolder.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IDiscountService类代码示例发布时间:2022-05-24
下一篇:
C# IDirectoryInfo类代码示例发布时间: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