示例#1
0
        /// <summary>
        /// Loads an option value from a stream
        /// </summary>
        /// <param name="stream">The stream to load from</param>
        /// <returns>The loaded option value</returns>
        public static Option <T> Load(IValueStream stream)
        {
            bool hasValue = stream.OptionHasValue();

            if (hasValue)
            {
                return(new Option <T>(Value <T> .Load(stream)));
            }
            else
            {
                return(new Option <T>());
            }
        }