2022-03-27 Fixed Windows \r\n TextBox issues by replacing \n->\r\n and back to \n when handling TextBox contents

This commit is contained in:
phantomix 2022-03-27 18:21:08 +02:00
parent 64ae7f6c4b
commit 538ba06221
5 changed files with 14 additions and 13 deletions

View File

@ -23,7 +23,7 @@ namespace dezentrale
{ {
public class Program public class Program
{ {
public static uint VersionNumber { get; private set; } = 0x22010700; public static uint VersionNumber { get; private set; } = 0x22032700;
public static string VersionString { get; private set; } = $"{VersionNumber:x}"; public static string VersionString { get; private set; } = $"{VersionNumber:x}";
public static string AppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); public static string AppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

View File

@ -34,7 +34,7 @@ namespace dezentrale.view
private void btnOk_Click(object sender, EventArgs e) private void btnOk_Click(object sender, EventArgs e)
{ {
Comment = tbComment.Text; Comment = tbComment.Text.Replace("\r\n", "\n");
this.Close(); this.Close();
} }
} }

View File

@ -611,7 +611,7 @@ namespace dezentrale.view
cbPaymentNotification.Checked = member.PaymentNotify; cbPaymentNotification.Checked = member.PaymentNotify;
tbBankTransferRegEx.ReadOnly = !cbEvaluateAccountInCharge.Checked; tbBankTransferRegEx.ReadOnly = !cbEvaluateAccountInCharge.Checked;
tbBankTransferRegEx.Text = member.BankTransferRegEx; tbBankTransferRegEx.Text = member.BankTransferRegEx;
tbRemarks.Text = member.Remarks; tbRemarks.Text = member.Remarks.Replace("\n", "\r\n");
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -693,7 +693,7 @@ namespace dezentrale.view
member.BankAccountInCharge = tbBankAccountInCharge.Text; member.BankAccountInCharge = tbBankAccountInCharge.Text;
member.PaymentNotify = cbPaymentNotification.Checked; member.PaymentNotify = cbPaymentNotification.Checked;
member.BankTransferRegEx = tbBankTransferRegEx.Text; member.BankTransferRegEx = tbBankTransferRegEx.Text;
member.Remarks = tbRemarks.Text; member.Remarks = tbRemarks.Text = member.Remarks.Replace("\r\n", "\n");
//member.FinishLogEvent(); //implicit in SaveToFile() //member.FinishLogEvent(); //implicit in SaveToFile()
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;

View File

@ -431,7 +431,7 @@ namespace dezentrale.view
cbCurrency.SelectedIndex = 1; cbCurrency.SelectedIndex = 1;
} }
typeVal = mt.TransferType; typeVal = mt.TransferType;
tbTransferReason.Text = mt.TransferReason; tbTransferReason.Text = mt.TransferReason.Replace("\n", "\r\n");
} }
foreach (MoneyTransfer.eTransferType type in Enum.GetValues(typeof(MoneyTransfer.eTransferType))) foreach (MoneyTransfer.eTransferType type in Enum.GetValues(typeof(MoneyTransfer.eTransferType)))
@ -495,7 +495,7 @@ namespace dezentrale.view
mt.ValutaDate = valutaDate.Value; mt.ValutaDate = valutaDate.Value;
mt.Amount = core.Utils.StringToInt64FP(tbAmount.Text); mt.Amount = core.Utils.StringToInt64FP(tbAmount.Text);
mt.Currency = cbCurrency.Text; mt.Currency = cbCurrency.Text;
mt.TransferReason = tbTransferReason.Text; mt.TransferReason = tbTransferReason.Text.Replace("\r\n", "\n");
if (mt.GetType() == typeof(CashTransfer)) if (mt.GetType() == typeof(CashTransfer))
{ {

View File

@ -294,11 +294,11 @@ namespace dezentrale.view
mv.EventDate = dt; mv.EventDate = dt;
mv.Place = tbPlace.Text; mv.Place = tbPlace.Text;
mv.Agenda = tbMvAgenda.Text; mv.Agenda = tbMvAgenda.Text.Replace("\r\n", "\n");
mv.InviteHeadline = tbInviteHeadline.Text; mv.InviteHeadline = tbInviteHeadline.Text;
mv.InviteBody = tbInviteBody.Text; mv.InviteBody = tbInviteBody.Text.Replace("\r\n", "\n");
mv.Protocol = tbMvProtocol.Text; mv.Protocol = tbMvProtocol.Text.Replace("\r\n", "\n");
} }
private void BuildPageInvitationSettings(Control parent) private void BuildPageInvitationSettings(Control parent)
@ -500,12 +500,13 @@ namespace dezentrale.view
if (e.KeyChar != 13) return; if (e.KeyChar != 13) return;
e.KeyChar = (char)0; e.KeyChar = (char)0;
bool foundAuthCode = false; bool foundAuthCode = false;
string searchText = tbAuthCodePaste.Text.ToUpper();
foreach(MvInvitedMember mvi in mv.Members) foreach(MvInvitedMember mvi in mv.Members)
{ {
if (string.IsNullOrEmpty(mvi.AuthCode)) if (string.IsNullOrEmpty(mvi.AuthCode))
continue; continue;
if (tbAuthCodePaste.Text.Contains(mvi.AuthCode)) if (searchText.Contains(mvi.AuthCode.ToUpper()))
{ {
foundAuthCode = true; foundAuthCode = true;
mvi.AttendedMv = true; mvi.AttendedMv = true;
@ -607,11 +608,11 @@ namespace dezentrale.view
mvDate.Value = mv.EventDate; mvDate.Value = mv.EventDate;
mvTime.Value = mv.EventDate; mvTime.Value = mv.EventDate;
tbPlace.Text = mv.Place; tbPlace.Text = mv.Place;
tbMvAgenda.Text = mv.Agenda; tbMvAgenda.Text = mv.Agenda.Replace("\n", "\r\n");
tbInviteHeadline.Text = mv.InviteHeadline; tbInviteHeadline.Text = mv.InviteHeadline;
tbInviteBody.Text = mv.InviteBody; tbInviteBody.Text = mv.InviteBody.Replace("\n", "\r\n");
tbMvProtocol.Text = mv.Protocol; tbMvProtocol.Text = mv.Protocol.Replace("\n", "\r\n");
UpdateGui(); UpdateGui();