Esempio n. 1
0
        private IEnumerable <Instance> getInstances()
        {
            var dir = Path.Combine(FS.GetTempPath(), "OpenIDE.CodeEngine");

            if (_fs.DirectoryExists(dir))
            {
                foreach (var file in _fs.GetFiles(dir, "*.pid"))
                {
                    var instance = Instance.Get(ClientFactory, file, _fs.ReadLines(file));
                    if (instance != null)
                    {
                        yield return(instance);
                    }
                }
            }
        }
Esempio n. 2
0
        private IEnumerable <Instance> getInstances()
        {
            var user     = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace(Path.DirectorySeparatorChar.ToString(), "-");
            var filename = string.Format("*.OpenIDE.CodeEngine.{0}.pid", user);
            var dir      = FS.GetTempPath();

            if (_fs.DirectoryExists(dir))
            {
                foreach (var file in _fs.GetFiles(dir, filename, SearchOption.TopDirectoryOnly))
                {
                    var instance = Instance.Get(ClientFactory, file, _fs.ReadLines(file));
                    if (instance != null)
                    {
                        yield return(instance);
                    }
                }
            }
        }