Skip to content

Making limitation flexible #390

Open
@zapadi

Description

@zapadi

Discussed in #383

Originally posted by SebDaniViaDanubius May 5, 2025
I had a problem with the length limitation in TimeEntry class for the Comments field (255 chars). There were comments that were 471 characters long.

I was forced to hack this:

    public sealed class TimeEntry : Identifiable<TimeEntry>, ICloneable
    {
        /// <summary>
        /// Gets or sets the maximum length of comments. The default value is 255.
        /// </summary>
        public static int MaxLengthOfComments = 255;
        ...
        /// <summary>
        /// Gets or sets the short description for the entry (<see cref="MaxLengthOfComments">length is maximized</see>).
        /// </summary>
        /// <value>The comments.</value>
        public string Comments
        {
            get => comments;
            set => comments = value.Truncate(MaxLengthOfComments);
        }
        ...
    }

This way I can set the limit up to 1000 (in my code).

      TimeEntry.MaxLengthOfComments = 1000;

Someone could put this change in the master.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions