Esempio n. 1
0
 public HatchPattern(string name, IEnumerable <HatchPatternLineDefinition> lineDefinitions, string description)
 {
     this.name            = string.IsNullOrEmpty(name) ? string.Empty : name;
     this.description     = string.IsNullOrEmpty(description) ? string.Empty : description;
     this.style           = HatchStyle.Normal;
     this.fill            = this.name == "SOLID" ? HatchFillType.SolidFill : HatchFillType.PatternFill;
     this.type            = HatchType.UserDefined;
     this.origin          = Vector2.Zero;
     this.angle           = 0.0;
     this.scale           = 1.0;
     this.lineDefinitions = lineDefinitions == null ? new List <HatchPatternLineDefinition>() : new List <HatchPatternLineDefinition>(lineDefinitions);
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <c>HatchPattern</c> class.
 /// </summary>
 /// <param name="name">Pattern name, always stored as uppercase.</param>
 /// <param name="description">Description of the pattern (optional, this information is not saved in the dxf file). By default it will use the supplied name.</param>
 public HatchPattern(string name, string description = null)
 {
     this.name            = name.ToUpper();
     this.description     = string.IsNullOrEmpty(description) ? name : description;
     this.style           = HatchStyle.Normal;
     this.fill            = this.name == "SOLID" ? HatchFillType.SolidFill : HatchFillType.PatternFill;
     this.type            = HatchType.UserDefined;
     this.origin          = Vector2.Zero;
     this.angle           = 0.0;
     this.scale           = 1.0;
     this.lineDefinitions = new List <HatchPatternLineDefinition>();
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <c>HatchPattern</c> class.
 /// </summary>
 /// <param name="name">Pattern name, always stored as uppercase.</param>
 /// <param name="description">Description of the pattern (optional, this information is not saved in the dxf file). By default it will use the supplied name.</param>
 public HatchPattern(string name, string description = null)
 {
     this.name = name.ToUpper();
     this.description = string.IsNullOrEmpty(description) ? name : description;
     this.style = HatchStyle.Normal;
     this.fill = this.name == "SOLID" ? HatchFillType.SolidFill : HatchFillType.PatternFill;
     this.type = HatchType.UserDefined;
     this.origin = Vector2.Zero;
     this.angle = 0.0;
     this.scale = 1.0;
     this.lineDefinitions = new List<HatchPatternLineDefinition>();
 }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <c>HatchPattern</c> class.
        /// </summary>
        /// <param name="name">Pattern name, always stored as uppercase.</param>
        /// <param name="lineDefinitions">The definition of the lines that make up the pattern (not applicable in Solid fills).</param>
        /// <param name="description">Description of the pattern (optional, this information is not saved in the dxf file). By default it will use the supplied name.</param>
        public HatchPattern(string name, IEnumerable<HatchPatternLineDefinition> lineDefinitions, string description)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentNullException(nameof(name));

            this.name = name.ToUpper(CultureInfo.CurrentCulture);
            this.description = string.IsNullOrEmpty(description) ? name : description;
            this.style = HatchStyle.Normal;
            this.fill = this.name == "SOLID" ? HatchFillType.SolidFill : HatchFillType.PatternFill;
            this.type = HatchType.UserDefined;
            this.origin = Vector2.Zero;
            this.angle = 0.0;
            this.scale = 1.0;
            this.lineDefinitions = lineDefinitions == null ? new List<HatchPatternLineDefinition>() : new List<HatchPatternLineDefinition>(lineDefinitions);
        }