Click or drag to resize

ModelStateWriter Class

Class for writing to state stream.

It supports optional objects and optional values. Whenever a non-optional object or value is included, all earlier optional object and values at that level and lower will be added to the stream. Objects with purely optional sub-objects and parameters will not be added to the stream.

The optional object can be used if an ancestor does not know whether a child actually contains state, so the ancestor can add itself and its parameters as optional, and only if a child has state, the ancestor values will be included.

Inheritance Hierarchy
SystemObject
  DHI.Mike1D.ModelStateModelStateWriter

Namespace:  DHI.Mike1D.ModelState
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class ModelStateWriter

The ModelStateWriter type exposes the following members.

Constructors
  NameDescription
Public methodModelStateWriter
Constructor
Top
Properties
  NameDescription
Public propertyOptions
Option objects for writer
Public propertyStateTime
Timestamp of state
Top
Methods
  NameDescription
Public methodClose
Close state, and also underlying state stream.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodHandleOptionalParameter
Helper method for handling optional parameters: If the parameter is optional, and the current object is optional (there is something in the list of optional objects), this parameter value is added to the list of parameters in the optional object.

If the parameter is not optional, but the current object is optional, all optional objects and parameters are added to the state.

Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpen(Stream)
Create writer that writes to a stream
Public methodOpen(String)
Create writer that writes to a file
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWriteDataValue
Write parameter array values to current object
Public methodWriteEndObject
Closes current object
Protected methodWriteOptionalObjects
Write all optional objects to state stream.
Public methodWriteStartObject(String)
Writes a start object tag with the specified name
Public methodWriteStartObject(String, Boolean)
Adds an optional start object tag with the specified name to the list of optional objects
Public methodWriteValue(String, Boolean, Boolean)
Write parameter value to current object
Public methodWriteValue(String, IEnumerableDateTime, Boolean)
Write parameter array values to current object
Public methodWriteValue(String, IEnumerableDouble, Boolean)
Write parameter array values to current object
Public methodWriteValue(String, IEnumerableInt32, Boolean)
Write parameter array values to current object
Public methodWriteValue(String, IEnumerableString, Boolean)
Write parameter array values to current object
Public methodWriteValue(String, DateTime, Boolean)
Write parameter value to current object
Public methodWriteValue(String, Double, Boolean)
Write parameter value to current object
Public methodWriteValue(String, Int32, Boolean)
Write parameter value to current object
Public methodWriteValue(String, Object, Boolean)
Write parameter value to object
Public methodWriteValue(String, String, Boolean)
Write parameter value to current object
Public methodWriteValue(String, TimeSpan, Boolean)
Write parameter value to current object
Top
Extension Methods
  NameDescription
Public Extension MethodAddReach (Defined by NetworkStateWriter.)
Top
See Also