コード例 #1
0
ファイル: MDRFCommon.cs プロジェクト: mosaicsys/MosaicLibCS
        /// <summary>This method is used to replace default (0) values for most property/field here with the value from the given <paramref name="other"/> instance.</summary>
        public SetupInfo MapDefaultsTo(SetupInfo other)
        {
            if (ClientNVS.IsNullOrEmpty())
            {
                ClientNVS = other.ClientNVS.ConvertToReadOnly();
            }

            DirPath        = DirPath.MapNullOrEmptyTo(other.DirPath);
            ClientName     = ClientName.MapNullOrEmptyTo(other.ClientName);
            FileNamePrefix = FileNamePrefix.MapNullOrEmptyTo(other.FileNamePrefix);

            CreateDirectoryIfNeeded          = CreateDirectoryIfNeeded.MapDefaultTo(other.CreateDirectoryIfNeeded);
            MaxDataBlockSize                 = MaxDataBlockSize.MapDefaultTo(other.MaxDataBlockSize);
            NominalMaxFileSize               = NominalMaxFileSize.MapDefaultTo(other.NominalMaxFileSize);
            FileIndexNumRows                 = FileIndexNumRows.MapDefaultTo(other.FileIndexNumRows);
            MaxFileRecordingPeriod           = MaxFileRecordingPeriod.MapDefaultTo(other.MaxFileRecordingPeriod);
            MinInterFileCreateHoldoffPeriod  = MinInterFileCreateHoldoffPeriod.MapDefaultTo(other.MinInterFileCreateHoldoffPeriod);
            MinNominalFileIndexWriteInterval = MinNominalFileIndexWriteInterval.MapDefaultTo(other.MinNominalFileIndexWriteInterval);
            MinNominalWriteAllInterval       = MinNominalWriteAllInterval.MapDefaultTo(other.MinNominalWriteAllInterval);
            I8Offset = I8Offset.MapDefaultTo(other.I8Offset);
            I4Offset = I4Offset.MapDefaultTo(other.I4Offset);
            I2Offset = I2Offset.MapDefaultTo(other.I2Offset);

            return(this);
        }
コード例 #2
0
ファイル: MDRFCommon.cs プロジェクト: mosaicsys/MosaicLibCS
        /// <summary>Helper debug and logging method</summary>
        public override string ToString()
        {
            string nvsStr = (ClientNVS.IsNullOrEmpty() ? "" : " {0}".CheckedFormat(ClientNVS));

            return("SetupInfo Client:'{0}' fnPrefix:'{1}' nomSize:{2} numRows:{3}{4}".CheckedFormat(ClientName, FileNamePrefix, NominalMaxFileSize, FileIndexNumRows, nvsStr));
        }