/// <summary> /// Copy constructor. Note that this does not clone the other's /// ID, but instead obtains a new unique ID. /// </summary> /// <param name="other">The source</param> public XmlShapeAttrs(XmlShapeAttrs other) { _Id = Guid.NewGuid(); Name = other.Name; Time = other.Time; Type = other.Type; Author = other.Author; Color = other.Color; Height = other.Height; Width = other.Width; Area = other.Area; LaysInk = other.LaysInk; Orientation = other.Orientation; PenTip = other.PenTip; Raster = other.Raster; SubstrokeOf = other.SubstrokeOf; P1 = other.P1; P2 = other.P2; X = other.X; Y = other.Y; Text = other.Text; LeftX = other.LeftX; TopY = other.TopY; Control1 = other.Control1; Control2 = other.Control2; Start = other.Start; End = other.End; Source = other.Source; PenWidth = other.PenWidth; PenHeight = other.PenHeight; Probability = other.Probability; Classification = other.Classification; ClassificationBelief = other.ClassificationBelief; Connections = other.Connections; }
/// <summary> /// Clone method. /// </summary> /// <returns>A new XmlShapeAttrs struct copying the old one's values</returns> public XmlShapeAttrs Clone() { XmlShapeAttrs temp = new XmlShapeAttrs(); temp.Id = this.Id; temp.Name = this.Name; temp.Time = this.Time; temp.Type = this.Type; temp.Author = this.Author; temp.Color = this.Color; temp.Height = this.Height; temp.Width = this.Width; temp.Area = this.Area; temp.LaysInk = this.LaysInk; temp.Orientation = this.Orientation; temp.PenTip = this.PenTip; temp.Raster = this.Raster; temp.SubstrokeOf = this.SubstrokeOf; temp.P1 = this.P1; temp.P2 = this.P2; temp.X = this.X; temp.Y = this.Y; temp.Text = this.Text; temp.LeftX = this.LeftX; temp.TopY = this.TopY; temp.Control1 = this.Control1; temp.Control2 = this.Control2; temp.Start = this.Start; temp.End = this.End; temp.Source = this.Source; return(temp); }
/// <summary> /// Create a new XmlShapeAttrs object with some fields /// initialized. The default constructor should never be used; /// only this method. It is here because C# does not allow /// structs to have zero-argument constructors. /// </summary> /// <returns>a new XmlShapeAttrs struct</returns> public static XmlShapeAttrs CreateNew() { XmlShapeAttrs attrs = new XmlShapeAttrs(); attrs._Id = Guid.NewGuid(); attrs.Connections = new HashSet <Shape>(); return(attrs); }