internal FIEncodingAlgorithm Encoding(string uri)
        {
            if (_uriToEncodingMap != null)
            {
                FIEncodingAlgorithm encoding = null;
                if (_uriToEncodingMap.TryGetValue(uri, out encoding))
                {
                    return(encoding);
                }
            }

            return(null);
        }
        internal void Add(FIEncodingAlgorithm encoding)
        {
            string uri = encoding.URI.ToString();

            if (_uriToEncodingMap == null)
            {
                _uriToEncodingMap = new Dictionary <string, FIEncodingAlgorithm>();
            }
            else
            if (_uriToEncodingMap.ContainsKey(uri))
            {
                throw new LtFastInfosetException("An encoding algorithm already exists for URI " + uri);
            }

            _uriToEncodingMap.Add(uri, encoding);
        }
예제 #3
0
 /// <summary>
 /// Adds an encoding algorithm to the vocabulary [X.891 Section 8.3].
 /// </summary>
 /// <param name="alogrithm">Encoding alogrithm to add.</param>
 /// <seealso cref="FIEncodingAlgorithm"/>
 public void AddEncodingAlgorithm(FIEncodingAlgorithm alogrithm)
 {
     _encodingAlgorithmManager.Add(alogrithm);
 }