private IEnumerable <Instance> getInstances(string path) { var dir = Path.Combine(FS.GetTempPath(), "EditorEngine"); if (Directory.Exists(dir)) { foreach (var file in Directory.GetFiles(dir, "*.pid")) { Instance instance; try { instance = Instance.Get(file, File.ReadAllLines(file)); } catch { instance = null; } if (instance != null) { yield return(instance); } } } }
private IEnumerable <Instance> getInstances(string path) { 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 (Directory.Exists(dir)) { foreach (var file in Directory.GetFiles(dir, filename)) { Instance instance; try { instance = Instance.Get(file, File.ReadAllLines(file)); } catch { instance = null; } if (instance != null) { yield return(instance); } } } }