public static Get ( Func |
||
clientFactory | Func |
|
file | string | |
lines | string | |
Résultat |
private IEnumerable <Instance> getInstances() { var dir = Path.Combine(FS.GetTempPath(), "EditorEngine"); if (_fs.DirectoryExists(dir)) { foreach (var file in _fs.GetFiles(dir, "*.pid")) { Instance instance; try { instance = Instance.Get(ClientFactory, file, _fs.ReadLines(file)); } catch { instance = null; } if (instance != null) { yield return(instance); } } } }
private IEnumerable <Instance> getInstances() { var user = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace(Path.DirectorySeparatorChar.ToString(), "-"); var filename = string.Format("*.EditorEngine.{0}.pid", user); var dir = FS.GetTempPath(); if (_fs.DirectoryExists(dir)) { foreach (var file in _fs.GetFiles(dir, filename, SearchOption.TopDirectoryOnly)) { Instance instance; try { instance = Instance.Get(ClientFactory, file, _fs.ReadLines(file)); } catch { instance = null; } if (instance != null) { yield return(instance); } } } }