Beispiel #1
0
        /// <summary>
        /// Validates if an <see cref="ObjectIdentifier"/> is a table.
        /// </summary>
        /// <param name="identifier">The object identifier.</param>
        /// <returns></returns>
        public bool ValidateTable(ObjectIdentifier identifier)
        {
            if (identifier == null)
            {
                throw new ArgumentNullException("identifier");
            }

            return(IsTableId(identifier.ToNumerical()));
        }
Beispiel #2
0
        public static string GetTextual(ObjectIdentifier id, IObjectRegistry registry)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            IObjectRegistry objects = registry ?? ObjectRegistry.Default;

            return(objects.Translate(id.ToNumerical()));
        }
Beispiel #3
0
        public static string GetStringOf(ObjectIdentifier id, IObjectRegistry objects)
        {
            if (objects == null)
            {
                return(id.ToString());
            }

            string result = objects.Tree.Search(id.ToNumerical()).AlternativeText;

            return(string.IsNullOrEmpty(result) ? id.ToString() : result);
        }
Beispiel #4
0
        /// <summary>
        /// Validates if an <see cref="ObjectIdentifier"/> is a table.
        /// </summary>
        /// <param name="identifier">The object identifier.</param>
        /// <returns></returns>
        public bool ValidateTable(ObjectIdentifier identifier)
        {
            if (identifier == null)
            {
                throw new ArgumentNullException("identifier");
            }

            try
            {
                return(IsTableId(identifier.ToNumerical()));
            }
            catch (ArgumentOutOfRangeException)
            {
                // if no matching definition found, refuse to continue.
                return(false);
            }
        }