/// <summary> /// Returns the delimiter Commence will use when returning column data. /// </summary> /// <param name="rct">RelatedColumnType enum value.</param> /// <returns>delimiter.</returns> // simplified implementation private string GetDelimiter(RelatedColumnType rct) { /* Delimiter depends on cursor type and underlying view (if cursor is on view) * Luckily, changing flags doesn't alter this behaviour, it is complex enough as it is. * * If you would redefine the columns, you get different results. * For example: * If you do SetColumn(n, "ConnectionName CategoryName, 0) * then that column will be comma-separated * If you do SetRelatedColumn(n, "ConnectionName", "CategoryName", "FieldName", 0), * then that column will be newline-separated * (i.o.w., it will then act just like a Category type cursor) * That means that within the same View, you can have different delimiters. * Commence is such a mess in that respect :( */ switch (rct) { case RelatedColumnType.Connection: return(", "); // note the trailing space case RelatedColumnType.ConnectedField: return("\n"); default: return("\n"); } }
internal RelatedColumn(string connection, string category, string field, RelatedColumnType type, string delimiter) { Connection = connection; Category = category; Field = field; ColumnType = type; Delimiter = delimiter; }