public string FindFileContent(string fileName) { Ensure.NotNullOrEmpty(fileName, "fileName"); if (fileName.EndsWith(".log") && SequenceIsolatedFile.Exists(fileName)) { SequenceIsolatedFile file = new SequenceIsolatedFile(fileName); return(String.Join(Environment.NewLine, file.Enumerate())); } return(null); }
public IEnumerable <LogModel> GetFileNames() { Dictionary <string, List <string> > result = new Dictionary <string, List <string> >(); foreach (string fileName in SequenceIsolatedFile.EnumerateNames("*.log")) { string[] parts = fileName.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries); string name = parts[0]; if (!result.TryGetValue(name, out List <string> items)) { result[name] = items = new List <string>(); } items.Add(fileName); } return(result.Select(i => new LogModel(i.Key, i.Value))); }
private string FindPath() { IsolatedStorageFile storage = SequenceIsolatedFile.GetStorage(); FieldInfo fieldInfo = storage.GetType().GetField("m_RootDir", BindingFlags.NonPublic | BindingFlags.Instance); if (fieldInfo == null) { return(null); } string value = (string)fieldInfo.GetValue(storage); if (value == null) { return(null); } return(value); }