Ejemplo n.º 1
0
Archivo: Pi2.cs Proyecto: habi/pi2
        /// <summary>
        /// Gets the value of this object as a string.
        /// Throws an exception if the value is not a string.
        /// </summary>
        /// <returns></returns>
        public string AsString()
        {
            string s = PiLib.GetString(Pi.Handle, Name);

            if (s == null)
            {
                throw new InvalidOperationException($"The object {Name} is not a string.");
            }
            return(s);
        }