Get() 공개 정적인 메소드

public static Get ( string file, string lines ) : Instance
file string
lines string
리턴 Instance
예제 #1
0
파일: Program.cs 프로젝트: alex1989/OpenIDE
        private IEnumerable <Instance> getInstances(string path)
        {
            var dir = Path.Combine(FS.GetTempDir(), "OpenIDE.Events");

            if (Directory.Exists(dir))
            {
                foreach (var file in Directory.GetFiles(dir, "*.pid"))
                {
                    var instance = Instance.Get(file, File.ReadAllLines(file));
                    if (instance != null)
                    {
                        yield return(instance);
                    }
                }
            }
        }
예제 #2
0
        private IEnumerable <Instance> getInstances(string path)
        {
            var user     = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace(Path.DirectorySeparatorChar.ToString(), "-");
            var filename = string.Format("*.OpenIDE.Events.{0}.pid", user);
            var dir      = FS.GetTempPath();

            if (Directory.Exists(dir))
            {
                foreach (var file in Directory.GetFiles(dir, filename))
                {
                    var instance = Instance.Get(file, File.ReadAllLines(file));
                    if (instance != null)
                    {
                        yield return(instance);
                    }
                }
            }
        }