System.TermInfo.Database.ReadDatabase C# (CSharp) Méthode

ReadDatabase() private static méthode

Read the database for the specified terminal.
private static ReadDatabase ( string term ) : Database
term string The identifier for the terminal.
Résultat Database
            private static Database ReadDatabase(string term)
            {
                // This follows the same search order as prescribed by ncurses.
                Database db;

                // First try a location specified in the TERMINFO environment variable.
                string terminfo = Environment.GetEnvironmentVariable("TERMINFO");
                if (!string.IsNullOrWhiteSpace(terminfo) && (db = ReadDatabase(term, terminfo)) != null)
                {
                    return db;
                }

                // Then try in the user's home directory.
                string home = PersistedFiles.GetHomeDirectory();
                if (!string.IsNullOrWhiteSpace(home) && (db = ReadDatabase(term, home + "/.terminfo")) != null)
                {
                    return db;
                }

                // Then try a set of well-known locations.
                foreach (string terminfoLocation in _terminfoLocations)
                {
                    if ((db = ReadDatabase(term, terminfoLocation)) != null)
                    {
                        return db;
                    }
                }

                // Couldn't find one
                return null;
            }

Same methods

TermInfo.Database::ReadDatabase ( string term, string directoryPath ) : Database