Exemplo n.º 1
0
        public PositionalArgument(Value value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            Value = value;
        }
Exemplo n.º 2
0
        public NamedArgument(string name, Value value)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            this.Name = name;
            this.Value = value;
        }
        private IEnumerable<string> Format(Value value)
        {
            var type = value.GetType();

            if (type == typeof(LiteralValue))
            {
                return this.Format((LiteralValue)value);
            }

            if (type == typeof(MarkupExtension))
            {
                return this.Format((MarkupExtension)value);
            }

            throw new ArgumentException($"Unhandled type {type.FullName}", nameof(value));
        }