本文整理汇总了C#中IDirectoryService类的典型用法代码示例。如果您正苦于以下问题:C# IDirectoryService类的具体用法?C# IDirectoryService怎么用?C# IDirectoryService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDirectoryService类属于命名空间,在下文中一共展示了IDirectoryService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoginViewModel
public LoginViewModel (IDirectoryService service)
{
this.service = service;
Username = "";
Password = "";
}
示例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>();
}
示例3: ImageRefreshOptions
public ImageRefreshOptions(IDirectoryService directoryService)
{
ImageRefreshMode = ImageRefreshMode.Default;
DirectoryService = directoryService;
ReplaceImages = new List<ImageType>();
}
示例4: LoginViewModel
public LoginViewModel(IDirectoryService service)
{
this.service = service;
Username = string.Empty;
Password = string.Empty;
}
示例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);
}
示例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;
}
示例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();
}
示例8: EndpointResolverService
public EndpointResolverService(IDirectoryService directoryService, IDefaultEndpointConfiguration defaultEndpointConfiguration, IUrlBuilder urlBuilder, IDirectoryRepository directoryRepository, ILogger logger)
{
_directoryService = directoryService;
_defaultEndpointConfiguration = defaultEndpointConfiguration;
_urlBuilder = urlBuilder;
_directoryRepository = directoryRepository;
_logger = logger;
}
示例9: DirectoryController
public DirectoryController(IEndpointResolverService endpointResolverService, IAccountSettings accountSettings, ICallService callService, ILogger logger, IDirectoryService directoryService)
{
_endpointResolverService = endpointResolverService;
_accountSettings = accountSettings;
_callService = callService;
_logger = logger;
_directoryService = directoryService;
}
示例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;
}
示例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 ();
}
示例12: HasChanged
public bool HasChanged(IHasMetadata item, IDirectoryService directoryService)
{
var liveTvItem = item as ILiveTvRecording;
if (liveTvItem != null)
{
return !liveTvItem.HasImage(ImageType.Primary);
}
return false;
}
示例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;
}
示例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;
}
示例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;
}