LotSizingDataModel.Core
2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
NamedEntity.cs
Go to the documentation of this file.
1
using
System;
2
using
System.Xml.Serialization;
3
4
namespace
LotSizingDataModel.Core.Common
;
5
6
/// <summary>
7
/// Base class for model entities that have a name.
8
///
9
/// This class does not define an identifier because some entities in the
10
/// source UML model, such as the generic Warehouse class, only define a name.
11
/// </summary>
12
[Serializable]
13
[XmlType(TypeName =
"namedEntity"
)]
14
public
abstract
class
NamedEntity
:
ModelObject
15
{
16
private
string
_name =
string
.Empty;
17
18
/// <summary>
19
/// Initializes a new instance of the <see cref="NamedEntity"/> class.
20
///
21
/// Derived serializable classes must expose their own public
22
/// parameterless constructor.
23
/// </summary>
24
protected
NamedEntity
()
25
{
26
}
27
28
/// <summary>
29
/// Gets or sets the entity name.
30
/// </summary>
31
[XmlAttribute(
"name"
)]
32
public
string
Name
33
{
34
get
=> _name;
35
set
=> SetProperty(
36
ref _name,
37
value ??
string
.Empty);
// Ensure the name is never null
38
}
39
40
/// <summary>
41
/// Returns the entity name.
42
/// </summary>
43
public
override
string
ToString
()
44
{
45
return
Name
;
46
}
47
}
LotSizingDataModel.Core.Common.ModelObject
Base class for model objects that notify listeners when one of their properties changes.
Definition
ModelObject.cs:16
LotSizingDataModel.Core.Common.NamedEntity.Name
string Name
Gets or sets the entity name.
Definition
NamedEntity.cs:33
LotSizingDataModel.Core.Common.NamedEntity.NamedEntity
NamedEntity()
Initializes a new instance of the NamedEntity class.
Definition
NamedEntity.cs:24
LotSizingDataModel.Core.Common.NamedEntity.ToString
override string ToString()
Returns the entity name.
Definition
NamedEntity.cs:43
LotSizingDataModel.Core.Common
Definition
DoubleTimeSeries.cs:7
LotSizingDataModel.Core
Common
NamedEntity.cs
Generated by
1.17.0