public static file load(string fileName) { switch (Path.GetExtension(fileName).ToLower()) { case ".mbn": return(new file { data = MBN.load(fileName), type = formatType.model }); case ".xml": return(new file { data = NLP.load(fileName), type = formatType.model }); default: return(load(new FileStream(fileName, FileMode.Open))); } }
public static file load(string fileName) { FileLockCheckerHelper.FileReadCheck(fileName); switch (Path.GetExtension(fileName).ToLower()) { case ".mbn": return(new file { data = MBN.load(fileName), type = formatType.model }); case ".xml": return(new file { data = NLP.load(fileName), type = formatType.model }); default: return(load(new FileStream(fileName, FileMode.Open, FileAccess.Read))); } }