Go to the documentation of this file.00001 using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Configuration;
00006
00007 namespace N2.Configuration
00008 {
00009 public class FileSystemElement : ConfigurationElement
00010 {
00011 [ConfigurationProperty("textFileExtensions", DefaultValue = ".cs,.vb,.js,.html,.htm,.xml,.aspx,.ascx,.ashx,.php,.txt")]
00012 public string TextFileExtensions
00013 {
00014 get { return (string)base["textFileExtensions"]; }
00015 set { base["textFileExtensions"] = value; }
00016 }
00017
00018 public bool IsTextFile(string virtualPath)
00019 {
00020 return Array.FindIndex(
00021 TextFileExtensions.Split(','),
00022 (extension) => virtualPath.EndsWith(extension, StringComparison.InvariantCultureIgnoreCase)) >= 0;
00023 }
00024 }
00025 }