public void RestoreTo(CanvasLayoutModel other) { other.Zones.Clear(); foreach (Int32Rect zone in Zones) { other.Zones.Add(zone); } }
public CanvasLayoutModel(CanvasLayoutModel other) : base(other) { CanvasRect = new Rect(other.CanvasRect.X, other.CanvasRect.Y, other.CanvasRect.Width, other.CanvasRect.Height); foreach (Int32Rect zone in other.Zones) { Zones.Add(zone); } }
public void RestoreTo(CanvasLayoutModel other) { other.Zones.Clear(); foreach (Int32Rect zone in Zones) { other.Zones.Add(zone); } other.SensitivityRadius = SensitivityRadius; }
public CanvasLayoutModel(CanvasLayoutModel other, bool enableQuickKeysPropertyChangedSubscribe = true) : base(other, enableQuickKeysPropertyChangedSubscribe) { CanvasRect = new Rect(other.CanvasRect.X, other.CanvasRect.Y, other.CanvasRect.Width, other.CanvasRect.Height); foreach (Int32Rect zone in other.Zones) { Zones.Add(zone); } }
// Clone // Implements the LayoutModel.Clone abstract method // Clones the data from this CanvasLayoutModel to a new CanvasLayoutModel public override LayoutModel Clone() { CanvasLayoutModel layout = new CanvasLayoutModel(Name); foreach (Int32Rect zone in Zones) { layout.Zones.Add(zone); } return(layout); }
// Clone // Implements the LayoutModel.Clone abstract method // Clones the data from this CanvasLayoutModel to a new CanvasLayoutModel public override LayoutModel Clone() { CanvasLayoutModel layout = new CanvasLayoutModel(Name); foreach (Int32Rect zone in Zones) { layout.Zones.Add(zone); } layout.SensitivityRadius = SensitivityRadius; return(layout); }
public void RestoreTo(CanvasLayoutModel other) { other.Zones.Clear(); foreach (Int32Rect zone in Zones) { other.Zones.Add(zone); } other._topLeft = _topLeft; other.SensitivityRadius = SensitivityRadius; other.CanvasRect = CanvasRect; other.UpdateLayout(); }
// Clone // Implements the LayoutModel.Clone abstract method // Clones the data from this CanvasLayoutModel to a new CanvasLayoutModel public override LayoutModel Clone() { CanvasLayoutModel layout = new CanvasLayoutModel(Name); layout.ReferenceHeight = ReferenceHeight; layout.ReferenceWidth = ReferenceWidth; foreach (Int32Rect zone in Zones) { layout.Zones.Add(zone); } return(layout); }
// Loads all the Layouts persisted under the Layouts key in the registry public static ObservableCollection <LayoutModel> LoadCustomModels() { _customModels = new ObservableCollection <LayoutModel>(); RegistryKey key = Registry.CurrentUser.OpenSubKey(_registryPath); if (key != null) { foreach (string name in key.GetValueNames()) { LayoutModel model = null; byte[] data = (byte[])Registry.GetValue(_fullRegistryPath, name, null); ushort version = (ushort)((data[0] * 256) + data[1]); byte type = data[2]; ushort id = (ushort)((data[3] * 256) + data[4]); switch (type) { case 0: model = new GridLayoutModel(version, name, id, data); break; case 1: model = new CanvasLayoutModel(version, name, id, data); break; } if (model != null) { if (_maxId < id) { _maxId = id; } _customModels.Add(model); } } } return(_customModels); }