/// <override></override> void IRegistrar.RegisterModelObjectType(ModelObjectType modelObjectType) { if (initializingLibrary == null) { throw new InvalidOperationException("RegisterModelObjectType can only be called while a library is initializing."); } if (string.IsNullOrEmpty(initializingLibrary.Name)) { throw new InvalidOperationException("RegisterLibrary has not been called or the library has an empty library name."); } if (modelObjectType == null) { throw new ArgumentNullException("modelObjectType"); } if (!Project.IsValidName(modelObjectType.Name)) { throw new ArgumentException("'{0}' is not a valid model object type name.", modelObjectType.Name); } if (modelObjectType.LibraryName != initializingLibrary.Name) { throw new InvalidOperationException("All model objects of a registering library must have the library's library name."); } if (modelObjectType.LibraryName != initializingLibrary.Name) { throw new InvalidOperationException(string.Format("The library name of model object type '{0}' is '{1}' instead of '{2}'.", modelObjectType.GetType().Name, modelObjectType.LibraryName, initializingLibrary.Name)); } // modelObjectTypes.Add(modelObjectType); // Create a delegate that adds required parameters to the CreateModelObjectDelegate // of the shape when called if (repository != null && repository.IsOpen) { RegisterModelObjectEntityType(modelObjectType, addingLibrary); } }
private void RegisterModelObjectEntityType(ModelObjectType modelObjectType, bool create) { int version = FindLibraryVersion(modelObjectType.LibraryName, create); IEntityType entityType = new EntityType(modelObjectType.FullName, EntityCategory.ModelObject, version, () => modelObjectType.CreateInstance(), modelObjectType.GetPropertyDefinitions(version)); repository.AddEntityType(entityType); }
public BusBar(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 1; }
public Label(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 0; }
public Connector(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 2; }
public AutoSwitch(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 2; }
protected internal ValueDevice(ModelObjectType modelObjectType) : base(modelObjectType) { }
public Switch(ModelObjectType modelObjectType) : base(modelObjectType) { TerminalCount = 4; }
public Picture(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 0; }
public Measurement(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 4; }
public AutoDisconnector(ModelObjectType modelObjectType) : base(modelObjectType) { terminalCount = 2; }
public Earth(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 1; }
public Transformer(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 2; }
public static ValueDevice CreateInstance(ModelObjectType modelObjectType) { return(new ValueDevice(modelObjectType)); }
internal Feeder(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 1; }
public Line(ModelObjectType modelObjectType) : base(modelObjectType) { this.terminalCount = 2; }
/// <summary> /// Initializes a new instance of <see cref="T:Dataweb.NShape.Advanced.NShapeInterfaceNotSupportedException" />. /// </summary> public NShapeInterfaceNotSupportedException(ModelObjectType instanceType, Type neededInterface) : base("Type '{0}' does not implement interface '{1}'.", instanceType.FullName, neededInterface.FullName) { }
public MyBusinessObject(ModelObjectType type) { this.modelObjectType = type; }
public static ValueDevice CreateInstance(ModelObjectType modelObjectType) { return new ValueDevice(modelObjectType); }