Serilog.Parsing.PropertyToken.PropertyToken C# (CSharp) Method

PropertyToken() public method

Construct a PropertyToken.
public PropertyToken ( string propertyName, string rawText, string format = null, Alignment alignment = null, Destructuring destructuring = Destructuring.Default, int startIndex = -1 ) : System
propertyName string The name of the property.
rawText string The token as it appears in the message template.
format string The format applied to the property, if any.
alignment Alignment The alignment applied to the property, if any.
destructuring Destructuring The destructuring strategy applied to the property, if any.
startIndex int The token's start index in the template.
return System
        public PropertyToken(string propertyName, string rawText, string format = null, Alignment? alignment = null, Destructuring destructuring = Destructuring.Default, int startIndex = -1)
            : base(startIndex)
        {
            if (propertyName == null) throw new ArgumentNullException(nameof(propertyName));
            if (rawText == null) throw new ArgumentNullException(nameof(rawText));
            PropertyName = propertyName;
            Format = format;
            Destructuring = destructuring;
            _rawText = rawText;
            Alignment = alignment;

            int position;
            if (int.TryParse(PropertyName, NumberStyles.None, CultureInfo.InvariantCulture, out position) &&
                position >= 0)
            {
                _position = position;
            }
        }

Same methods

PropertyToken::PropertyToken ( string propertyName, string rawText, string formatObsolete, Destructuring destructuringObsolete ) : System