/// <summary> /// Constructs a model object type. /// </summary> public ModelObjectType(string name, string libraryName, string categoryTitle, CreateModelObjectDelegate createModelObjectDelegate, GetPropertyDefinitionsDelegate getPropertyDefinitionsDelegate) { if (name == null) { throw new ArgumentNullException("name"); } if (!Project.IsValidName(name)) { throw new ArgumentException(string.Format("'{0}' is not a valid model object type name.", name)); } if (libraryName == null) { throw new ArgumentNullException("libraryName"); } if (!Project.IsValidName(libraryName)) { throw new ArgumentException(string.Format("'{0}' is not a valid library name.", libraryName)); } if (createModelObjectDelegate == null) { throw new ArgumentNullException("createModelObjectDelegate"); } if (getPropertyDefinitionsDelegate == null) { throw new ArgumentNullException("getPropertyDefinitionsDelegate"); } // this.name = name; this.libraryName = libraryName; this.categoryTitle = categoryTitle; this.createModelObjectDelegate = createModelObjectDelegate; this.getPropertyDefinitionsDelegate = getPropertyDefinitionsDelegate; }
/// <summary> /// Constructs a model object type. /// </summary> public ModelObjectType(string name, string libraryName, string categoryTitle, CreateModelObjectDelegate createModelObjectDelegate, GetPropertyDefinitionsDelegate getPropertyDefinitionsDelegate) { if (name == null) { throw new ArgumentNullException("name"); } if (!Project.IsValidName(name)) { throw new ArgumentException(string.Format(Properties.Resources.MessageFmt_0IsNotAValidModelObjectTypeName, name)); } if (libraryName == null) { throw new ArgumentNullException("libraryName"); } if (!Project.IsValidName(libraryName)) { throw new ArgumentException(string.Format(Properties.Resources.MessageFmt_0IsNotAValidLibraryName, libraryName)); } if (createModelObjectDelegate == null) { throw new ArgumentNullException("createModelObjectDelegate"); } if (getPropertyDefinitionsDelegate == null) { throw new ArgumentNullException("getPropertyDefinitionsDelegate"); } // this._name = name; this._libraryName = libraryName; this._categoryTitle = categoryTitle; this._createModelObjectDelegate = createModelObjectDelegate; this._getPropertyDefinitionsDelegate = getPropertyDefinitionsDelegate; }
/// <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) { }
/// <ToBeCompleted></ToBeCompleted> public GenericModelObjectType(string name, string namespaceName, string categoryTitle, CreateModelObjectDelegate createModelObjectDelegate, GetPropertyDefinitionsDelegate getPropertyDefinitionsDelegate, TerminalId maxTerminalId) : base(name, namespaceName, categoryTitle, createModelObjectDelegate, getPropertyDefinitionsDelegate) { this.maxTerminalId = maxTerminalId; for (int i = 1; i <= maxTerminalId; ++i) { terminals.Add(i, "Terminal " + Convert.ToString(i)); } }
/// <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; }