/// <summary> /// Toes the string helper. /// </summary> /// <param name="data">The ISerializableObject object.</param> /// <param name="descriptionLength">Length of the description.</param> /// <returns></returns> protected string ToStringHelper(SerializableObject data, int descriptionLength) { System.Text.StringBuilder ret = new System.Text.StringBuilder(); for (int i = 0; i < descriptionLength; i++) { ret.Append("-"); } ret.Append("\n"); ret.Append(AttributeUtilities.GetTableMapping(data)).Append(" Row\n"); for (int i = 0; i < descriptionLength; i++) { ret.Append("-"); } ret.Append("\n"); PropertyInfo[] properties = data.GetType().GetProperties(); foreach (PropertyInfo property in properties) { ColumnAttribute attribute = AttributeUtilities.GetColumnAttribute(property); if (attribute != null) { string columnName = AttributeUtilities.GetColumnMapping(property); ret.Append(columnName); for (int i = columnName.Length; i < descriptionLength; i++) { ret.Append("."); } ret.Append(": "); MethodInfo m = property.GetGetMethod(); Object obj = m.Invoke(data, null); ret.Append(obj); ret.Append("\n"); } } return(ret.ToString()); }
protected QueryStrategy(ISerializableObject data) { this.data = data; table = AttributeUtilities.GetTableMapping(data); properties = data.GetType().GetProperties(); }