Click or drag to resize
DfsBuilder Class
Builder for dfs files.

The builder works in two stages. The first stage all header information and information of the dynamic items are provided. In the second stage static items are added. Then a dfs file is ready, and data for the dynamic items can be added.

To go from the first to the second stage by calling CreateFile(String), which will actually create a file on the disc.

To get the final file, call GetFile. After GetFile has been called, no more static items can be added to the file.

Stage 1: The following must be set during stage 1: SetGeographicalProjection(IDfsProjection), SetDataType(Int32), SetTemporalAxis(IDfsTemporalAxis). Furthermore, a number of dynamic items must be added.

Stage 2: Any number of static items can be added. Create the item by using one of the AddStaticItem(String, Array) functions. To create a new static item from scratch, use CreateStaticItemBuilder together with AddStaticItem(IDfsStaticItem).

Inheritance Hierarchy
SystemObject
  DHI.Generic.MikeZero.DFSDfsBuilder

Namespace: DHI.Generic.MikeZero.DFS
Assembly: DHI.Generic.MikeZero.DFS (in DHI.Generic.MikeZero.DFS.dll) Version: 16.0.0.0 (11.1.1.1111)
Syntax
public class DfsBuilder : IDfsFileBuilder

The DfsBuilder type exposes the following members.

Properties
  NameDescription
Public propertyDeleteValueByte
Gets/sets the delete value of type byte

This is a stage 1 method.

Public propertyDeleteValueDouble
Gets/sets the delete value of type double

This is a stage 1 method.

Public propertyDeleteValueFloat
Gets/sets the delete value of type float

This is a stage 1 method.

Public propertyDeleteValueInt
Gets/sets the delete value of type int

This is a stage 1 method.

Public propertyDeleteValueUnsignedInt
Gets/sets the delete value of type unsigned int

This is a stage 1 method.

Top
Methods
  NameDescription
Public methodAddCustomBlock(IDfsCustomBlock)
Adds a custom block.
Public methodAddCustomBlock(String, Array)
Adds a custom block containing the array data.

The type of arrayData must be an array of type equivalent to one of the supported DfsSimpleType, e.g. int[].

Public methodAddCustomBlock(String, Byte)
Add a custom block containing byte data.
Public methodAddCustomBlock(String, Double)
Add a custom block containing double data.
Public methodAddCustomBlock(String, Int16)
Add a custom block containing short data.
Public methodAddCustomBlock(String, Int32)
Add a custom block containing int data.
Public methodAddCustomBlock(String, Single)
Add a custom block containing float data.
Public methodAddCustomBlock(String, UInt16)
Add a custom block containing ushort data.
Public methodAddCustomBlock(String, UInt32)
Add a custom block containing uint data.
Public methodAddDynamicItem
Add a dynamic item to the file.
Public methodAddStaticItem(IDfsStaticItem)
Add static item to the file.

The static item can come from another file, then the item definition and data is copied over.

Public methodAddStaticItem(String, Array)
Creates and adds a static item storing the arrayData. Use this only when Quantity and SpatialAxis and others are not important. Quantity and spatial axis are set to default dummy values.

The type of arrayData must be an array of type equivalent to one of the supported DfsSimpleType, e.g. int[].

Public methodAddStaticItem(String, eumQuantity, Array)
Creates and adds a static item storing the arrayData. Use this only when SpatialAxis is not important. Spatial axis are set to default dummy values.

The type of arrayData must be an array of type equivalent to one of the supported DfsSimpleType, e.g. int[].

Public methodStatic memberCreate
Create a new builder that will build a default type of dfs file (with FixedSpace and AllItems)
Public methodCreateDynamicItemBuilder
Create a dynamic item builder, for creating and configuring a new dynamic item.
Public methodCreateFile
Create the file and move from stage 1 to stage 2 of the build process.
Public methodCreateStaticItemBuilder
Create a static item builder, for creating and configuring a new static item.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetFile
Returns the new dfs file
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodSetApplicationTitle
Set the title of the application writing the file.

This is a stage 1 method.

Public methodSetApplicationVersionNo
Set the version number of the application writing the file.

This is a stage 1 method.

Public methodSetDataType
Set the data type.

This is a stage 1 method.

The data type tags the file as a special dfs file type. There exists no global system for maintaining these tag-variables. The tag-variables should only be interpreted locally within one model-complex e.g. MIKE 21. The application programmer can tag bathymetries, result files, input files freely.

Public methodSetEncodingKey
Public methodSetFileTitle
Set the title of the file.

This is a stage 1 method.

Public methodSetGeographicalProjection
Sets the geographical projection and reference coordinates.

This must be set. This is a stage 1 method.

Public methodSetItemStatisticsType
Sets the statistics level StatType of all items in the file
Public methodSetTemporalAxis
Sets the temporal axis of the file.

This must be set. This is a stage 1 method.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Validate will return a string of issues from the item builder. When this returns an empty list, the item has been properly build.
Top
See Also