Get() public static method

public static Get ( string file, string lines ) : Instance
file string
lines string
return Instance
コード例 #1
0
        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);
                    }
                }
            }
        }
コード例 #2
0
        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);
                    }
                }
            }
        }