• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.Addons
    • IAction
    • IApplicationBootstrapper
    • IAsyncShutdownAction
    • IAsyncStartupAction
    • IBootstrapper
    • IDependencyProvider
    • IMefServiceLocator
    • IModule
    • IServiceExporter
    • IServiceRepository
    • IShutdownAction
    • IShutdownMetadata
    • IShutdownModule
    • IStartupAction
    • IStartupMetadata
    • IStartupModule
    • ModuleAttribute
    • ShutdownActionAttribute
    • StartupActionAttribute
    • StartupException
  • Dapplo.Addons.Bootstrapper
    • ApplicationBootstrapper
    • CompositionBootstrapper
    • ResourceMutex
    • StartupShutdownBootstrapper
  • Dapplo.Addons.Bootstrapper.Internal
    • CompressionTypes
    • StreamExtensions
  • Dapplo.Addons.Bootstrapper.Resolving
    • AssemblyResolver
    • EmbeddedResources
    • FileLocations
    • FileTools

Class FileLocations

Some utils for managing the location of files

Inheritance
System.Object
FileLocations
Namespace:Dapplo.Addons.Bootstrapper.Resolving
Assembly:Dapplo.Addons.Bootstrapper.dll
Syntax
public static class FileLocations : object

Properties

| Improve this Doc View Source

StartupDirectory

Get the startup location, which is either the location of the entry assemby, or the executing assembly

Declaration
public static string StartupDirectory { get; }
Property Value
Type Description
System.String

string with the directory of where the running code/applicationName was started

Methods

| Improve this Doc View Source

DirectoriesFor(String, Boolean)

For the given directory this will return possible location. It might be that multiple are returned, also normalization is made

Declaration
public static IEnumerable<string> DirectoriesFor(string directory, bool allowCurrentDirectory = true)
Parameters
Type Name Description
System.String directory

A absolute or relative directory

System.Boolean allowCurrentDirectory

true to allow relative to current working directory

Returns
Type Description
IEnumerable<System.String>

IEnumerable with possible directories

| Improve this Doc View Source

RoamingAppDataDirectory(String)

Get the roaming AppData directory

Declaration
public static string RoamingAppDataDirectory(string applicationName)
Parameters
Type Name Description
System.String applicationName
Returns
Type Description
System.String

string with the directory the appdata roaming directory

| Improve this Doc View Source

Scan(IEnumerable<String>, Regex, SearchOption)

Scan the supplied directories for files which match the passed file pattern

Declaration
public static IEnumerable<Tuple<string, Match>> Scan(IEnumerable<string> directories, Regex filePattern, SearchOption searchOption = null)
Parameters
Type Name Description
IEnumerable<System.String> directories
Regex filePattern

Regular expression for the filename

SearchOption searchOption

Makes it possible to specify if the search is recursive, SearchOption.AllDirectories is default, use SearchOption.TopDirectoryOnly for non recursive

Returns
Type Description
IEnumerable<Tuple<System.String, Match>>

IEnumerable with paths

| Improve this Doc View Source

Scan(IEnumerable<String>, String, SearchOption)

Scan the supplied directories for files which match the passed file pattern

Declaration
public static IEnumerable<string> Scan(IEnumerable<string> directories, string simplePattern, SearchOption searchOption = null)
Parameters
Type Name Description
IEnumerable<System.String> directories
System.String simplePattern
SearchOption searchOption

Makes it possible to specify if the search is recursive, SearchOption.AllDirectories is default, use SearchOption.TopDirectoryOnly for non recursive

Returns
Type Description
IEnumerable<System.String>

IEnumerable with paths

  • Improve this Doc
  • View Source
Back to top Copyright © 2017 Dapplo