Class PhysicalUnitDescriptions
Represents a serializable list of physical unit descriptions.
Inheritance
Implements
Inherited Members
Namespace: Sdl.LanguagePlatform.Core.Tokenization
Assembly: Sdl.LanguagePlatform.Core.dll
Syntax
public class PhysicalUnitDescriptions : IEnumerable<PhysicalUnitDescription>, IEnumerable
Constructors
PhysicalUnitDescriptions()
Initializes a new instance with default values. This constructor should not be used directly, it is primarily for XML deserialization.
Declaration
public PhysicalUnitDescriptions()
PhysicalUnitDescriptions(PhysicalUnitDescriptions)
Initializes a new instance, using the values contained in another instance. This constructor can be used to create a deep copy.
Declaration
public PhysicalUnitDescriptions(PhysicalUnitDescriptions other)
Parameters
Type | Name | Description |
---|---|---|
Physical |
other | The instance to create a deep copy from |
Properties
Count
Gets the number of elements in this set.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System. |
Units
Gets or sets the list of physical unit descriptions in this set.
Declaration
public List<PhysicalUnitDescription> Units { get; set; }
Property Value
Type | Description |
---|---|
System. |
Methods
Add(PhysicalUnitDescription)
Adds a physical unit description to this set.
Declaration
public void Add(PhysicalUnitDescription d)
Parameters
Type | Name | Description |
---|---|---|
Physical |
d | The description to add. No duplicate checks are performed. |
Delete(PhysicalUnitDescription)
Deletes a physical unit description from this set. Not implemented yet, will throw an exception.
Declaration
public void Delete(PhysicalUnitDescription d)
Parameters
Type | Name | Description |
---|---|---|
Physical |
d | The physical unit description to delete. |
FindFirst(String)
Finds the first physical unit description which matches the specified unit abbreviation. Not implemented yet, will throw.
Declaration
public PhysicalUnitDescription FindFirst(string abbreviation)
Parameters
Type | Name | Description |
---|---|---|
System. |
abbreviation | The abbreviation to search |
Returns
Type | Description |
---|---|
Physical |
Always throws an exception |
GetEnumerator()
Returns an enumerator which can be used to iterate through the elements of this set.
Declaration
public IEnumerator<PhysicalUnitDescription> GetEnumerator()
Returns
Type | Description |
---|---|
System. |
An enumerator |
Load(CultureInfo, IResourceDataAccessor)
Creates a new instance and obtains, and loads (deserializes) the data from the specified resource accessor, using the provided culture. This method can be used to load a culture-specific set of physical unit descriptions.
Declaration
public static PhysicalUnitDescriptions Load(CultureInfo culture, IResourceDataAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
System. |
culture | The culture to use |
IResource |
accessor | The resource data accessor to use to obtain the data |
Returns
Type | Description |
---|---|
Physical |
A new instance with the data initialized from the resource data |
Load(Stream)
Creates a new instance and loads (deserializes) the data from the specified input stream.
Declaration
public static PhysicalUnitDescriptions Load(Stream reader)
Parameters
Type | Name | Description |
---|---|---|
System. |
reader | The reader to read the data from |
Returns
Type | Description |
---|---|
Physical |
A new instance with the data initialized from the stream's data |
Load(String)
Creates a new instance and loads (deserializes) the data from the specified file name.
Declaration
public static PhysicalUnitDescriptions Load(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System. |
fileName | The name of the file to load the data from |
Returns
Type | Description |
---|---|
Physical |
A new instance with the data initialized from the file's data |
Save(Stream)
Saves (serializes) the data of this instance in the specified stream.
Declaration
public void Save(Stream writer)
Parameters
Type | Name | Description |
---|---|---|
System. |
writer | The stream to write the output to. |
Save(String)
Saves (serializes) the data of this instance in the specified file.
Declaration
public void Save(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System. |
fileName | The file name to write the output to. |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator which can be used to iterate through the elements of this set.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System. |
An enumerator |