/// <summary>Used to initialize the contents of this object, either as a copy of the given non-null <paramref name="other"/> instance, or using the default values when <paramref name="other"/> is given as null.</summary> public SetupInfo SetFrom(SetupInfo other) { if (other == null) { ClientNVS = NamedValueSet.Empty; DirPath = string.Empty; ClientName = string.Empty; FileNamePrefix = string.Empty; CreateDirectoryIfNeeded = true; MaxDataBlockSize = 262144; NominalMaxFileSize = 100 * 1024 * 1024; FileIndexNumRows = 2048; // 51200 bytes per row. 42 seconds per row (assuming full file consumes one day) MaxFileRecordingPeriod = (24.0).FromHours(); MinInterFileCreateHoldoffPeriod = (15.0).FromSeconds(); MinNominalFileIndexWriteInterval = (60.0).FromSeconds(); MinNominalWriteAllInterval = (15.0).FromMinutes(); I8Offset = 120; I4Offset = 120; I2Offset = 27; } else { ClientNVS = other.ClientNVS.ConvertToReadOnly(); DirPath = other.DirPath; ClientName = other.ClientName.MapNullOrEmptyTo("NoClientNameGiven"); FileNamePrefix = other.FileNamePrefix; CreateDirectoryIfNeeded = other.CreateDirectoryIfNeeded; MaxDataBlockSize = other.MaxDataBlockSize; NominalMaxFileSize = other.NominalMaxFileSize; FileIndexNumRows = other.FileIndexNumRows; MaxFileRecordingPeriod = other.MaxFileRecordingPeriod; MinInterFileCreateHoldoffPeriod = other.MinInterFileCreateHoldoffPeriod; MinNominalFileIndexWriteInterval = other.MinNominalFileIndexWriteInterval; MinNominalWriteAllInterval = other.MinNominalWriteAllInterval; I8Offset = other.I8Offset; I4Offset = other.I4Offset; I2Offset = other.I2Offset; } return(this); }
public TFileIndexInfo(SetupInfo setupInfo) : this(setupInfo.FileIndexNumRows) { NominalMaxFileSize = setupInfo.NominalMaxFileSize; }
public FileIndexInfo(SetupInfo setupInfo) : base(setupInfo) { }
/// <summary>Copy constructor. Calls SetFrom(<paramref name="other"/>)</summary> public SetupInfo(SetupInfo other) { SetFrom(other); }