using Nonemm.Core; namespace Nonemm.Session; /// The result of an edit: either the changed contact or an error message. /// `Field` names the field that was refused, so a dialog can put the cursor /// back in the right box. public sealed record QsoEdit(Qso? Result, string Error, QsoField? Field = null) { public static QsoEdit Accept(Qso qso) => new(qso, ""); public static QsoEdit Refuse(string error) => new(null, error); public bool IsAccepted => Result is not null; }