/// <summary> /// Clones the object /// </summary> /// <returns></returns> public virtual object Clone() { ControlLayout layout = new ControlLayout(); layout.SetFrom(this); return(layout); }
/// <summary> /// Sets the base attributes from a source layout /// </summary> /// <param name="layout"></param> protected void SetFrom(ControlLayout layout) { this.Location = layout.Location; this.Center = layout.Center; this.Rotation = layout.Rotation; this.Size = layout.Size; }
/// <summary> /// Equals override /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if ((obj is ControlLayout)) { return(base.Equals(obj)); } ControlLayout layout = (ControlLayout)obj; return(layout.Location.Equals(this.Location) && layout.Center.Equals(this.Center) && layout.Size.Equals(this.Size) && layout.Rotation == this.Rotation); }