/// <summary>Initializes a new instance IniFileCommentary</summary> /// <param name="content">Actual content of a line in a INI file.</param> public IniFileCommentary(string content) : base(content) { if (IniFileSettings.CommentChars.Length == 0) { throw new NotSupportedException("Comments are disabled. Set the IniFileSettings.CommentChars property to turn them on."); } commentChar = IniFileSettings.startsWith(Content, IniFileSettings.CommentChars); if (Content.Length > commentChar.Length) { comment = Content.Substring(commentChar.Length); } else { comment = ""; } }
/// <summary>Determines whether specified string is a representation of particular IniFileElement object.</summary> /// <param name="testString">Trimmed test string.</param> public static bool IsLineValid(string testString) { return(IniFileSettings.startsWith(testString.TrimStart(), IniFileSettings.CommentChars) != null); }