/// <summary>
        /// Returns a serialized representation of this object.
        /// </summary>
        /// <returns>A string containing four fields delimited by commas.  Commas within the fields are escaped with backslashes.</returns>
        public string Serialize(string projectFolderForRelativization)
        {
            string relativePath = Utilities.RelativePathFromAbsolute(FilePath, projectFolderForRelativization);

            return(Utilities.EscapeChar(relativePath, ',') + ',' +
                   Utilities.EscapeChar(IgnoredTerm, ',') + ',' +
                   PositionOfIgnoredTerm.ToString(CultureInfo.InvariantCulture) + ',' +
                   Utilities.EscapeChar(IgnoredLine, ','));
        }
Example #2
0
 public override int GetHashCode()
 {
     // Since these properties define the behavior of the Equals method, they must also
     // define the hash code.
     return
         ((FilePath ?? string.Empty).GetHashCode() ^
          (IgnoredLine ?? string.Empty).GetHashCode() ^
          (IgnoredTerm ?? string.Empty).GetHashCode() ^
          PositionOfIgnoredTerm.GetHashCode());
 }