本文整理汇总了C#中IFileService类的典型用法代码示例。如果您正苦于以下问题:C# IFileService类的具体用法?C# IFileService怎么用?C# IFileService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFileService类属于命名空间,在下文中一共展示了IFileService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TestCollectionService
public TestCollectionService(IConfigurationService configurationService, IFileService fileService, ICommandService commandService, IManifestService manifestService)
{
_configurationService = configurationService;
_fileService = fileService;
_commandService = commandService;
_manifestService = manifestService;
}
开发者ID:MGetmanov,项目名称:Selenite,代码行数:7,代码来源:TestCollectionService.cs
示例2: GetCanonicalRoot
/// <summary>
/// Get the canonical volume root (e.g. the \\?\VolumeGuid format) for the given path. The path must not be relative.
/// </summary>
/// <exception cref="ArgumentException">Thrown if the path is relative or indeterminate.</exception>
/// <exception cref="System.IO.IOException">Thrown if unable to get the root from the OS.</exception>
public static string GetCanonicalRoot(this IExtendedFileService extendedFileService, IFileService fileService, string path)
{
if (Paths.IsRelative(path)) throw new ArgumentException();
path = fileService.GetFullPath(path);
int rootLength;
var format = Paths.GetPathFormat(path, out rootLength);
if (format == PathFormat.UnknownFormat) throw new ArgumentException();
string root = path.Substring(0, rootLength);
string simpleRoot = root;
string canonicalRoot = root;
switch (format)
{
case PathFormat.UniformNamingConventionExtended:
simpleRoot = @"\\" + root.Substring(Paths.ExtendedUncPrefix.Length);
goto case PathFormat.UniformNamingConvention;
case PathFormat.UniformNamingConvention:
canonicalRoot = simpleRoot;
break;
case PathFormat.VolumeAbsoluteExtended:
case PathFormat.DriveAbsolute:
canonicalRoot = extendedFileService.GetVolumeName(root);
simpleRoot = extendedFileService.GetMountPoint(root);
break;
}
return canonicalRoot;
}
开发者ID:ramarag,项目名称:XTask,代码行数:35,代码来源:ExtendedFileServiceExtensions.cs
示例3: CreateProjectCore
/// <inheritdoc />
protected override ProjectTemplateResult CreateProjectCore(IFileService fileService, FilePath filePath)
{
var project = (NetProject)ProjectDescriptor.GetDescriptorByExtension(filePath.Extension).CreateProject(filePath.FileName);
project.ApplicationType = ApplicationType;
project.FilePath = filePath;
var results = new List<TemplateResult>();
foreach (var file in Files)
{
var result = file.CreateFile(
fileService,
project,
new FilePath(project.ProjectDirectory, file.Name + Language.StandardFileExtension));
foreach (var createdFile in result.CreatedFiles)
{
project.ProjectFiles.Add(new ProjectFileEntry(createdFile.File as OpenedFile));
}
results.Add(result);
}
foreach (var reference in References)
project.References.Add(reference);
return new ProjectTemplateResult(project, results.ToArray());
}
开发者ID:ThrDev,项目名称:LiteDevelop,代码行数:30,代码来源:NetProjectTemplate.cs
示例4: ClientSettingsView
protected ClientSettingsView(string settingsSection, SettingsLocation settingsLocation, IConfigurationManager configurationManager, IFileService fileService)
{
ConfigurationManager = configurationManager;
FileService = fileService;
SettingsSection = settingsSection;
SettingsLocation = settingsLocation;
}
开发者ID:JeremyKuhne,项目名称:XTask,代码行数:7,代码来源:ClientSettingsView.cs
示例5: Read
public static JadeCore.Project.IProject Read(string path, IFileService fileService)
{
ProjectType xml;
XmlSerializer serializer = new XmlSerializer(typeof(ProjectType));
TextReader tr = new StreamReader(path);
try
{
xml = (ProjectType)serializer.Deserialize(tr);
}
finally
{
tr.Close();
tr.Dispose();
}
JadeCore.Project.IProject result = new JadeCore.Project.Project(xml.Name, FilePath.Make(path));
foreach (FolderType f in xml.Folders)
{
result.AddFolder(MakeFolder(result, result.Directory, f, fileService));
}
foreach (FileType f in xml.Files)
{
result.AddItem(null, MakeFile(result.Directory, f, fileService));
}
return result;
}
开发者ID:JadeHub,项目名称:Jade,代码行数:27,代码来源:ProjectReaderWriter.cs
示例6: ChatController
public ChatController(IUserService userservice, IChatRoomService chatService, IMessageService messageService, IFileService fileService)
{
UserService = userservice;
ChatService = chatService;
MessageService = messageService;
FileService = fileService;
config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<User, UserChatViewModel>()
.ForMember(dest => dest.UserFoto,
opt => opt.MapFrom(src => src.UserFoto.
Insert(src.UserFoto.LastIndexOf('/') + 1,
"mini/")));
cfg.CreateMap<ChatRoom, ChatRoomPartialViewModel>();
cfg.CreateMap<Message, MessageViewModels>()
.ForMember(dest => dest.UserName, opt => opt.MapFrom(src => src.User.UserName))
.ForMember(dest => dest.PathFotoUser,
opt => opt.MapFrom(src => src.User.UserFoto.
Insert(src.User.UserFoto.LastIndexOf('/') + 1,
"mini/")))
.ForMember(dest => dest.FileId,
opt => opt.MapFrom(src => src.File.Id))
.ForMember(dest => dest.FileName,
opt => opt.MapFrom(src => src.File.NameFile));
cfg.CreateMap<ChatRoom, ChatRoomViewModels>()
.ForMember(dest => dest.UserName, opt => opt.MapFrom(src => src.User.UserName))
.ForMember(dest => dest.Users, opt => opt.MapFrom(src => src.Users))
.ForMember(dest => dest.Messages, opt => opt.MapFrom(src => src.Messages));
});
}
开发者ID:ProgiiX,项目名称:Chat_V2,代码行数:31,代码来源:ChatController.cs
示例7: DownloadsModule
/// <summary>
/// DownloadsModule constructor.
/// </summary>
/// <param name="fileService">FileService dependency.</param>
/// <param name="sessionManager">NHibernate session manager dependency.</param>
public DownloadsModule(IFileService fileService,IFileResourceService fileResourceService, ISessionManager sessionManager, IContentItemService<FileResource> contentItemService)
{
this._sessionManager = sessionManager;
this._fileService = fileService;
this._contentItemService = contentItemService;
this._fileResourceService = fileResourceService;
}
开发者ID:martijnboland,项目名称:Cuyahoga-Constructor,代码行数:12,代码来源:DownloadsModule.cs
示例8: BuildArgumentParser
public BuildArgumentParser(string taskName, string[] targets, string options, IFileService fileService)
: base (fileService)
{
this.AddTarget(taskName);
if (targets != null)
{
foreach (string target in targets)
this.AddTarget(target);
}
if (String.IsNullOrWhiteSpace(options)) { return; }
// Options are in xml format <Option>value</Option> or <Option/> for default
XmlReaderSettings settings = new XmlReaderSettings
{
ConformanceLevel = ConformanceLevel.Fragment
};
using (XmlReader reader = XmlReader.Create(new StringReader(options), settings))
{
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
this.AddOrUpdateOption(
optionName: reader.Name,
optionValue: reader.ReadString());
}
}
}
}
开发者ID:ramarag,项目名称:XTask,代码行数:31,代码来源:BuildArgumentParser.cs
示例9: Install
/// <summary>
/// Constructor.
/// </summary>
public Install()
{
this._commonDao = IoC.Resolve<ICommonDao>();
this._siteService = IoC.Resolve<ISiteService>();
this._moduleLoader = IoC.Resolve<ModuleLoader>();
this._fileService = IoC.Resolve<IFileService>();
}
开发者ID:martijnboland,项目名称:Cuyahoga-Constructor,代码行数:10,代码来源:Install.aspx.cs
示例10: NetkanTransformer
public NetkanTransformer(
IHttpService http,
IFileService fileService,
IModuleService moduleService,
string githubToken,
bool prerelease
)
{
_transformers = InjectVersionedOverrideTransformers(new List<ITransformer>
{
new MetaNetkanTransformer(http),
new SpacedockTransformer(new SpacedockApi(http)),
new GithubTransformer(new GithubApi(githubToken), prerelease),
new HttpTransformer(),
new JenkinsTransformer(http),
new InternalCkanTransformer(http, moduleService),
new AvcTransformer(http, moduleService),
new VersionEditTransformer(),
new ForcedVTransformer(),
new EpochTransformer(),
// This is the "default" VersionedOverrideTransformer for compatability with overrides that don't
// specify a before or after property.
new VersionedOverrideTransformer(before: new string[] { null }, after: new string[] { null }),
new DownloadAttributeTransformer(http, fileService),
new GeneratedByTransformer(),
new OptimusPrimeTransformer(),
new StripNetkanMetadataTransformer(),
new PropertySortTransformer()
});
}
开发者ID:CliftonMarien,项目名称:CKAN,代码行数:30,代码来源:NetkanTransformer.cs
示例11: DataManagementController
public DataManagementController(ICategoryService categoryService, IDataItemService dataItemService, IMemberService memberService, IFileService fileService)
{
this.categoryService = categoryService;
this.dataItemService = dataItemService;
this.memberService = memberService;
this.fileService = fileService;
}
开发者ID:HiepTang,项目名称:AmiCaseBook,代码行数:7,代码来源:DataManagementController.cs
示例12: AddPluginViewModel
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public AddPluginViewModel(IZipService zipService, IFileService fileService, ILiveWriterService liveWriterService)
{
_zipService = zipService;
_fileService = fileService;
_liveWriterService = liveWriterService;
CanAdd = AppHelper.LiveWriterInstalled;
}
开发者ID:ButchersBoy,项目名称:LiveWriterPluginManager,代码行数:10,代码来源:AddPluginViewModel.cs
示例13: Read
static private JadeCore.Project.IProject Read(string name, StreamReader reader, FilePath projectPath, IFileService fileService)
{
IProject project = new JadeCore.Project.Project(name, projectPath);
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
Match match = Regex.Match(line, _compileLineRegex);
if (match.Success)
{
string itemPath = match.Groups[1].Value;
itemPath = JadeUtils.IO.PathUtils.CombinePaths(projectPath.Directory, itemPath);
project.AddItem(null, new JadeCore.Project.FileItem(fileService.MakeFileHandle(itemPath)));
continue;
}
match = Regex.Match(line, _includeLineRegex);
if (match.Success)
{
string itemPath = match.Groups[1].Value;
itemPath = JadeUtils.IO.PathUtils.CombinePaths(projectPath.Directory, itemPath);
project.AddItem(null, new JadeCore.Project.FileItem(fileService.MakeFileHandle(itemPath)));
continue;
}
}
return project;
}
开发者ID:JadeHub,项目名称:Jade,代码行数:26,代码来源:ProjectReader.cs
示例14: FileModule
/// <summary>
/// Initializes a new instance of the <see cref="FileModule" /> class.
/// </summary>
/// <param name="fileService">The file service.</param>
public FileModule(IFileService fileService)
{
if (fileService == null) throw new ArgumentNullException("fileService");
_fileService = fileService;
ListingHtml = ListingTemplate;
}
开发者ID:marinehero,项目名称:microserver,代码行数:11,代码来源:FileModule.cs
示例15: PackageServiceTestBase
public PackageServiceTestBase()
{
_releaseStore = A.Fake<IReleaseStore>(opts => opts.Strict());
_fileService = A.Fake<IFileService>(opts => opts.Strict());
_SUT = new PackageService(_releaseStore, _fileService);
}
开发者ID:dealproc,项目名称:Drey,代码行数:7,代码来源:PackageServiceTestBase.cs
示例16: Read
static public JadeCore.Workspace.IWorkspace Read(FilePath path, IFileService fileService)
{
WorkspaceType xml;
XmlSerializer serializer = new XmlSerializer(typeof(WorkspaceType));
TextReader tr = new StreamReader(path.Str);
try
{
xml = (WorkspaceType)serializer.Deserialize(tr);
}
finally
{
tr.Close();
tr.Dispose();
}
JadeCore.Workspace.IWorkspace result = new JadeCore.Workspace.Workspace(xml.Name, path);
foreach (FolderType f in xml.Folders)
{
result.AddFolder(MakeFolder(result, result.Directory, f, fileService));
}
foreach (ProjectType p in xml.Projects)
{
result.AddProject(MakeProject(result.Directory, p, fileService));
}
return result;
}
开发者ID:JadeHub,项目名称:Jade,代码行数:27,代码来源:WorkspaceReaderWriter.cs
示例17: EnumerateChildrenInternal
internal static IEnumerable<IFileSystemInformation> EnumerateChildrenInternal(
string directory,
ChildType childType,
string searchPattern,
System.IO.SearchOption searchOption,
FileAttributes excludeAttributes,
IFileService fileService)
{
// We want to be able to see all files as we recurse and open new find handles (that might be over MAX_PATH).
// We've already normalized our base directory.
string extendedDirectory = Paths.AddExtendedPrefix(directory);
// The assertion here is that we want to find files that match the desired pattern in all subdirectories, even if the
// subdirectories themselves don't match the pattern. That requires two passes to avoid overallocating for directories
// with a large number of files.
// First look for items that match the given search pattern in the current directory
using (FindOperation findOperation = new FindOperation(Paths.Combine(extendedDirectory, searchPattern)))
{
FindResult findResult;
while ((findResult = findOperation.GetNextResult()) != null)
{
bool isDirectory = (findResult.Attributes & FileAttributes.FILE_ATTRIBUTE_DIRECTORY) == FileAttributes.FILE_ATTRIBUTE_DIRECTORY;
if ((findResult.Attributes & excludeAttributes) == 0
&& findResult.FileName != "."
&& findResult.FileName != ".."
&& ((isDirectory && childType == ChildType.Directory)
|| (!isDirectory && childType == ChildType.File)))
{
yield return FileSystemInformation.Create(findResult, directory, fileService);
}
}
}
if (searchOption != System.IO.SearchOption.AllDirectories) yield break;
// Now recurse into each subdirectory
using (FindOperation findOperation = new FindOperation(Paths.Combine(extendedDirectory, "*"), directoriesOnly: true))
{
FindResult findResult;
while ((findResult = findOperation.GetNextResult()) != null)
{
// Unfortunately there is no guarantee that the API will return only directories even if we ask for it
bool isDirectory = (findResult.Attributes & FileAttributes.FILE_ATTRIBUTE_DIRECTORY) == FileAttributes.FILE_ATTRIBUTE_DIRECTORY;
if ((findResult.Attributes & excludeAttributes) == 0
&& isDirectory
&& findResult.FileName != "."
&& findResult.FileName != "..")
{
foreach (var child in EnumerateChildrenInternal(Paths.Combine(directory, findResult.FileName), childType, searchPattern,
searchOption, excludeAttributes, fileService))
{
yield return child;
}
}
}
}
}
开发者ID:JeremyKuhne,项目名称:XTask,代码行数:60,代码来源:DirectoryInformation.cs
示例18: MediaSelectorService
public MediaSelectorService(ISession session, IFileService fileService, IImageProcessor imageProcessor, Site site)
{
_session = session;
_fileService = fileService;
_imageProcessor = imageProcessor;
_site = site;
}
开发者ID:neozhu,项目名称:MrCMS,代码行数:7,代码来源:MediaSelectorService.cs
示例19: OTAUIController
public OTAUIController(IOTAUIService otaUIService, IOTARedisService redisService, IFileService fileService, IUserAccessDataControlService userAccessDataControlService, IMembershipService membershipService, IFullTextSearchService fullTextSearchService)
: base(otaUIService, redisService, fileService, fullTextSearchService)
{
this.UserAccessDataControlService = userAccessDataControlService;
this.MembershipService = membershipService;
StatusOTAService = StructureMap.ObjectFactory.GetInstance<IStatusOTAService>();
}
开发者ID:itabas016,项目名称:AppStores,代码行数:7,代码来源:OTAUIController.cs
示例20: SetupEcommerceWidgets
public SetupEcommerceWidgets(IWidgetService widgetService, IDocumentService documentService, IFormAdminService formAdminService, IFileService fileService)
{
_widgetService = widgetService;
_documentService = documentService;
_formAdminService = formAdminService;
_fileService = fileService;
}
开发者ID:neozhu,项目名称:Ecommerce,代码行数:7,代码来源:SetupEcommerceWidgets.cs
注:本文中的IFileService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论