System.Xml.Schema.SymbolsDictionary.NameOf C# (CSharp) Méthode

NameOf() public méthode

Output symbol's name
public NameOf ( int symbol ) : string
symbol int
Résultat string
        public string NameOf(int symbol) {
            foreach (DictionaryEntry de in names) {
                if ((int)de.Value == symbol) {
                    return ((XmlQualifiedName)de.Key).ToString();
                }
            }
            if (wildcards != null) {
                foreach (DictionaryEntry de in wildcards) {
                    if ((int)de.Value == symbol) {
                        return (string)de.Key + ":*";
                    }
                }
            }
            return "##other:*";
        }
    }

Usage Example

 public override void Dump(StringBuilder bb, SymbolsDictionary symbols, Positions positions) {
     bb.Append("\"" + symbols.NameOf(positions[pos].symbol) + "\"");
 }