LogStreamer.Configuration.ValidateContent C# (CSharp) Method

ValidateContent() public method

public ValidateContent ( ) : void
return void
        void ValidateContent()
        {
            var cfg = this;
            if (cfg.FirstUserOid < 0 || cfg.LastUserOid < 0) {
                throw new FormatException("Key range values must be positive.");
            }
            if (cfg.LastUserOid < cfg.FirstUserOid) {
                throw new FormatException("Invalid key range: LastUserOid must be greater than FirstUserOid.");
            }
            if (cfg.ReconnectMaximumWaitSeconds < 0 || cfg.ReconnectMaximumWaitSeconds > int.MaxValue) {
                throw new FormatException("Illegal value for ReconnectMaximumWaitSeconds.");
            }
            if (cfg.ReconnectMinimumWaitSeconds < 0 || cfg.ReconnectMinimumWaitSeconds > int.MaxValue) {
                throw new FormatException("Illegal value for ReconnectMinimumWaitSeconds.");
            }
        }

Usage Example

コード例 #1
0
 public void SetContent(Configuration cfg)
 {
     cfg.ValidateContent();
     SettleAndApplyDefaults(cfg);
     content = cfg;
 }