/// <summary> /// Clone method. /// </summary> /// <returns>A new XmlSketchAttrs struct copying the old one's values</returns> public XmlSketchAttrs Clone() { XmlSketchAttrs temp = new XmlSketchAttrs(); temp._Id = this.Id; temp.Units = this.Units; return(temp); }
/// <summary> /// Create a new XmlSketchAttrs struct. You should always /// use this method instead of the default constructor. /// The default units are "himetric". /// </summary> /// <param name="id">If you need to initialize a set of /// attributes with a specific ID, use this parameter. /// If null is passed, a new ID is created.</param> /// <returns></returns> public static XmlSketchAttrs CreateNew(string id = null) { XmlSketchAttrs attrs = new XmlSketchAttrs(); attrs.Units = "pixels"; attrs._Id = (id == null) ? Guid.NewGuid() : new Guid(id); return(attrs); }