MoneyTools / MyMoney.Net

MyMoney is a rich client .NET ClickOnce application for managing your personal finances. It is written entirely in C# and is designed for programmers who want easy access to their data and who want to quickly and easily add their own features. Your data will not be locked up in some proprietary format, it is yours to do with as you like.
https://moneytools.github.io/MyMoney.Net/
66 stars 21 forks source link

Why exclude special characters "{ } :" for Account Name #121

Closed jpdup closed 3 months ago

jpdup commented 3 months ago

In the flutter version we use ':' to tokenize the names for Category and Account, it has the benefit of doing nice rendering like this.

image

image

Looking at the code for Account dialog, the name is not allowed to have ':', Is this a legacy reason for serialization ? Would this limitation also be applicable to Category names ? which is allowed to have ':'

Can we remove this limitation?

private static readonly char[] InvalidNameChars = new char[] { '{', '}', ':' };

  private void OnNameChanged(object sender, TextChangedEventArgs e)
  {
      this.CheckButtonStates();

      if (this.TextBoxName.Text.IndexOfAny(InvalidNameChars) >= 0)
      {
          this.TextBoxName.Background = Brushes.Red;
          this.TextBoxName.ToolTip = Walkabout.Properties.Resources.AccountNameValidChars;
          this.ButtonOk.IsEnabled = false;
      }
      else
      {
          this.TextBoxName.ClearValue(TextBox.BackgroundProperty);
          this.TextBoxName.ToolTip = "";
      }
  }
clovett commented 3 months ago

Because the account name has to also be a valid windows folder name because that's where we store the statements and attachments.