/// <summary> /// Constructs a shape type. /// </summary> public ShapeType(string name, string libraryName, ResourceString categoryTitle, CreateShapeDelegate createShapeDelegate, GetPropertyDefinitionsDelegate getPropertyDefinitionsDelegate) : this(name, libraryName, categoryTitle, string.Empty, createShapeDelegate, getPropertyDefinitionsDelegate, null, true) { }
/// <summary> /// Constructs a shape type. /// </summary> public ShapeType(string name, string libraryName, ResourceString categoryTitle, CreateShapeDelegate createShapeDelegate, GetPropertyDefinitionsDelegate getPropertyDefinitionsDelegate, Bitmap freehandReferenceImage) : this(name, libraryName, categoryTitle, string.Empty, createShapeDelegate, getPropertyDefinitionsDelegate, freehandReferenceImage, true) { }
/// <summary> /// Constructs a shape type. /// </summary> public ShapeType(string name, string libraryName, ResourceString categoryTitle, ResourceString description, CreateShapeDelegate createShapeDelegate, GetPropertyDefinitionsDelegate getPropertyDefinitionsDelegate, Bitmap freehandReferenceImage, bool supportsTemplates) { // Sanity check if (name == null) { throw new ArgumentNullException("Shape type name"); } if (!Project.IsValidName(name)) { throw new ArgumentException(string.Format("'{0}' is not a valid shape type name.", name)); } if (libraryName == null) { throw new ArgumentNullException("Namespace name"); } if (!Project.IsValidName(libraryName)) { throw new ArgumentException("'{0}' is not a valid library name.", libraryName); } if (createShapeDelegate == null) { throw new ArgumentNullException("Shape creation delegate"); } if (getPropertyDefinitionsDelegate == null) { throw new ArgumentNullException("Property infos"); } // this.name = name; this.libraryName = libraryName; this.categoryTitle = categoryTitle ?? string.Empty; this.description = description ?? string.Empty; this.createShapeDelegate = createShapeDelegate; this.getPropertyDefinitionsDelegate = getPropertyDefinitionsDelegate; this.freehandReferenceImage = freehandReferenceImage; this.supportsAutoTemplates = supportsTemplates; }