Base class that represents a substring of text from a parsed format string.
		public FormattingException(FormatItem errorItem, string issue, int index)
		{
			this.Format = errorItem.baseString;
			this.ErrorItem = errorItem;
			this.Issue = issue;
			this.Index = index;
		}
		public FormattingException(FormatItem errorItem, Exception formatException, int index)
		{
			this.Format = errorItem.baseString;
			this.ErrorItem = errorItem;
			this.Issue = formatException.Message;
			this.Index = index;
		}
Пример #3
0
		public FormattingException FormattingException(string issue, FormatItem problemItem = null, int startIndex = -1)
		{
			if (problemItem == null) problemItem = this.Format;
			if (startIndex == -1) startIndex = problemItem.startIndex;
			return new FormattingException(problemItem, issue, startIndex);
		}
 protected FormatItem(SmartSettings smartSettings, FormatItem parent, int startIndex) : this(smartSettings,
                                                                                             parent.baseString, startIndex, parent.baseString.Length)
 {
 }
Пример #5
0
		protected FormatItem(FormatItem parent, int startIndex) : this(parent.baseString, startIndex, parent.baseString.Length)
		{ }
Пример #6
0
 /// <summary>
 /// Initializes the <see cref="LiteralText"/> instance, representing the literal text that is found in a parsed format string.
 /// </summary>
 /// <param name="smartSettings">The <see cref="SmartSettings"/>.</param>
 /// <param name="parent">The parent <see cref="FormatItem"/></param>
 /// <param name="baseString">The reference to the parsed format string.</param>
 /// <param name="startIndex">The start index of the <see cref="LiteralText"/> in the format string.</param>
 /// <param name="endIndex">The end index of the <see cref="LiteralText"/> in the format string.</param>
 /// <returns>The <see cref="LiteralText"/> instance, representing the literal text that is found in a parsed format string.</returns>
 public new LiteralText Initialize(SmartSettings smartSettings, FormatItem parent, string baseString, int startIndex, int endIndex)
 {
     base.Initialize(smartSettings, parent, baseString, startIndex, endIndex);
     return(this);
 }