¡@

Home 

c# Programming Glossary: fileexists

How do you mock out the file system in C# for unit testing?

http://stackoverflow.com/questions/1087351/how-do-you-mock-out-the-file-system-in-c-sharp-for-unit-testing

do it by creating an interface interface IFileSystem bool FileExists string fileName DateTime GetCreationDate string fileName and..

Pulling a View from a database rather than a file

http://stackoverflow.com/questions/3367106/pulling-a-view-from-a-database-rather-than-a-file

public DbPathProvider base public override bool FileExists string virtualPath if virtualPath.StartsWith test virtualPath.StartsWith.. virtualPath.StartsWith ~ test return true return base.FileExists virtualPath deal with this later public override VirtualFile.. interesting. If I remove the return base... from the FileExists and GetFile methods and only return true my DbVirtualFile the..

Using the Razor view engine in a different way

http://stackoverflow.com/questions/3808076/using-the-razor-view-engine-in-a-different-way

DateTime utcStart return null public override bool FileExists string virtualPath if virtualPath.StartsWith stringviews virtualPath.StartsWith.. ~ stringviews return true return base.FileExists virtualPath public override VirtualFile GetFile string virtualPath..

Using FileStream.Seek

http://stackoverflow.com/questions/5201414/using-filestream-seek

private void FindLineLength string line Add check for FileExists using StreamReader reader new StreamReader FileName if line.. FileInfo fileInfo Possibly might have to check for FileExists int length FindLineLength fileInfo if length 0 throw new PaddedProgramException..

Read custom configuration file in C# (Framework 4.0)

http://stackoverflow.com/questions/6341906/read-custom-configuration-file-in-c-sharp-framework-4-0

public CustomConfigurationFileReader NotNull FileExists string configFileName bool notifyOnFileChange Set the configuration..