System.Yaml.YamlTagPrefixes.Add C# (CSharp) Méthode

Add() public méthode

public Add ( string tag_handle, string tag_prefix ) : void
tag_handle string
tag_prefix string
Résultat void
        public void Add(string tag_handle, string tag_prefix)
        {
            if ( TagPrefixes.ContainsKey(tag_handle) ) {
                switch ( tag_handle ) {
                case "!":
                    Error("Primary tag prefix is already defined as '{0}'.", TagPrefixes["!"]);
                    break;
                case "!!":
                    Error("Secondary tag prefix is already defined as '{0}'.", TagPrefixes["!!"]);
                    break;
                default:
                    Error("Tag prefix for the handle {0} is already defined as '{1}'.", tag_handle, TagPrefixes[tag_handle]);
                    break;
                }
            }
            TagPrefixes.Add(tag_handle, tag_prefix);
        }