Skip to content

Commit

Permalink
Compress layout XML representation
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Aug 5, 2024
1 parent 1f97636 commit a5f7449
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Bonsai.Editor/Layout/VisualizerDialogSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@ namespace Bonsai.Design
#pragma warning restore CS0612 // Type or member is obsolete
public class VisualizerDialogSettings
{
[XmlIgnore]
public int? Index { get; set; }

[XmlAttribute(nameof(Index))]
public string IndexXml
{
get => Index.HasValue ? Index.GetValueOrDefault().ToString() : null;
set => Index = !string.IsNullOrEmpty(value) ? int.Parse(value) : null;
}

[XmlIgnore]
public object Tag { get; set; }

Expand Down Expand Up @@ -44,12 +52,16 @@ public Rectangle Bounds
// [Obsolete]
public Collection<int> Mashups { get; } = new Collection<int>();

public bool VisibleSpecified => Visible;

public bool LocationSpecified => !Location.IsEmpty;

public bool SizeSpecified => !Size.IsEmpty;

public bool WindowStateSpecified => WindowState != FormWindowState.Normal;

public bool NestedLayoutSpecified => NestedLayout?.DialogSettings.Count > 0;

public bool MashupsSpecified => false;
}
}

0 comments on commit a5f7449

Please sign in to comment.