mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Fixed a lot of line issues, few auto
This commit is contained in:
@@ -11,7 +11,8 @@ namespace FancyZonesEditor.Models
|
||||
// Free form Layout Model, which specifies independent zone rects
|
||||
public class CanvasLayoutModel : LayoutModel
|
||||
{
|
||||
public CanvasLayoutModel(ushort version, string name, ushort id, byte[] data) : base(name, id)
|
||||
public CanvasLayoutModel(ushort version, string name, ushort id, byte[] data)
|
||||
: base(name, id)
|
||||
{
|
||||
if (version == _latestVersion)
|
||||
{
|
||||
@@ -19,23 +20,37 @@ namespace FancyZonesEditor.Models
|
||||
}
|
||||
}
|
||||
|
||||
public CanvasLayoutModel(string name, ushort id, int referenceWidth, int referenceHeight) : base(name, id)
|
||||
public CanvasLayoutModel(string name, ushort id, int referenceWidth, int referenceHeight)
|
||||
: base(name, id)
|
||||
{
|
||||
// Initialize Reference Size
|
||||
_referenceWidth = referenceWidth;
|
||||
_referenceHeight = referenceHeight;
|
||||
}
|
||||
|
||||
public CanvasLayoutModel(string name, ushort id) : base(name, id) { }
|
||||
public CanvasLayoutModel(string name, ushort id)
|
||||
: base(name, id)
|
||||
{
|
||||
}
|
||||
|
||||
public CanvasLayoutModel(string name) : base(name) { }
|
||||
public CanvasLayoutModel(string name)
|
||||
: base(name)
|
||||
{
|
||||
}
|
||||
|
||||
public CanvasLayoutModel() : base() { }
|
||||
public CanvasLayoutModel()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
// ReferenceWidth - the reference width for the layout rect that all Zones are relative to
|
||||
public int ReferenceWidth
|
||||
{
|
||||
get { return _referenceWidth; }
|
||||
get
|
||||
{
|
||||
return _referenceWidth;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (_referenceWidth != value)
|
||||
@@ -69,8 +84,7 @@ namespace FancyZonesEditor.Models
|
||||
private int _referenceHeight;
|
||||
|
||||
// Zones - the list of all zones in this layout, described as independent rectangles
|
||||
public IList<Int32Rect> Zones { get { return _zones; } }
|
||||
private IList<Int32Rect> _zones = new List<Int32Rect>();
|
||||
public IList<Int32Rect> Zones { get; } = new List<Int32Rect>();
|
||||
|
||||
// RemoveZoneAt
|
||||
// Removes the specified index from the Zones list, and fires a property changed notification for the Zones property
|
||||
@@ -100,7 +114,7 @@ namespace FancyZonesEditor.Models
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
_zones.Add(new Int32Rect(
|
||||
Zones.Add(new Int32Rect(
|
||||
data[i++] * 256 + data[i++],
|
||||
data[i++] * 256 + data[i++],
|
||||
data[i++] * 256 + data[i++],
|
||||
@@ -130,7 +144,7 @@ namespace FancyZonesEditor.Models
|
||||
// Returns the state of this GridLayoutModel in persisted format
|
||||
protected override byte[] GetPersistData()
|
||||
{
|
||||
byte[] data = new byte[10 + (_zones.Count * 8)];
|
||||
byte[] data = new byte[10 + (Zones.Count * 8)];
|
||||
int i = 0;
|
||||
|
||||
// Common persisted values between all layout types
|
||||
@@ -146,9 +160,9 @@ namespace FancyZonesEditor.Models
|
||||
data[i++] = (byte)(_referenceWidth % 256);
|
||||
data[i++] = (byte)(_referenceHeight / 256);
|
||||
data[i++] = (byte)(_referenceHeight % 256);
|
||||
data[i++] = (byte)_zones.Count;
|
||||
data[i++] = (byte)Zones.Count;
|
||||
|
||||
foreach (Int32Rect rect in _zones)
|
||||
foreach (Int32Rect rect in Zones)
|
||||
{
|
||||
data[i++] = (byte)(rect.X / 256);
|
||||
data[i++] = (byte)(rect.X % 256);
|
||||
|
||||
@@ -10,10 +10,23 @@ namespace FancyZonesEditor.Models
|
||||
// Grid-styled Layout Model, which specifies rows, columns, percentage sizes, and row/column spans
|
||||
public class GridLayoutModel : LayoutModel
|
||||
{
|
||||
public GridLayoutModel() : base() { }
|
||||
public GridLayoutModel(string name) : base(name) { }
|
||||
public GridLayoutModel(string name, ushort id) : base(name, id) { }
|
||||
public GridLayoutModel(ushort version, string name, ushort id, byte[] data) : base(name, id)
|
||||
public GridLayoutModel()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public GridLayoutModel(string name)
|
||||
: base(name)
|
||||
{
|
||||
}
|
||||
|
||||
public GridLayoutModel(string name, ushort id)
|
||||
: base(name, id)
|
||||
{
|
||||
}
|
||||
|
||||
public GridLayoutModel(ushort version, string name, ushort id, byte[] data)
|
||||
: base(name, id)
|
||||
{
|
||||
if (version == c_latestVersion)
|
||||
{
|
||||
|
||||
@@ -14,14 +14,18 @@ namespace FancyZonesEditor.Models
|
||||
// Manages common properties and base persistence
|
||||
public abstract class LayoutModel : INotifyPropertyChanged
|
||||
{
|
||||
protected LayoutModel() { }
|
||||
protected LayoutModel()
|
||||
{
|
||||
}
|
||||
|
||||
protected LayoutModel(string name) : this()
|
||||
protected LayoutModel(string name)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
protected LayoutModel(string name, ushort id) : this(name)
|
||||
protected LayoutModel(string name, ushort id)
|
||||
: this(name)
|
||||
{
|
||||
_id = id;
|
||||
}
|
||||
|
||||
@@ -340,8 +340,7 @@ namespace FancyZonesEditor
|
||||
|
||||
_workArea = new Rect(x, y, width, height);
|
||||
|
||||
uint monitor = 0;
|
||||
if (uint.TryParse(args[4], out monitor))
|
||||
if (uint.TryParse(args[4], out uint monitor))
|
||||
{
|
||||
Monitor = monitor;
|
||||
}
|
||||
@@ -349,7 +348,10 @@ namespace FancyZonesEditor
|
||||
}
|
||||
|
||||
|
||||
public IList<LayoutModel> DefaultModels { get { return _defaultModels; } }
|
||||
public IList<LayoutModel> DefaultModels
|
||||
{
|
||||
get { return _defaultModels; }
|
||||
}
|
||||
|
||||
public ObservableCollection<LayoutModel> CustomModels
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user