Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ProcessingSleepTime Property
- [ConfigurationProperty("ProcessingSleepTime", DefaultValue = 1000, IsRequired = false)]
- [IntegerValidator(MinValue = 5, MaxValue = 60000)]
- public Int32 ProcessingSleepTime
- {
- get
- {
- if (this["ProcessingSleepTime"] == null)
- return 100;
- return (Int32)this["ProcessingSleepTime"];
- }
- set
- {
- this["ProcessingSleepTime"] = value;
- }
- }
- int GetIntFromConfigSetting(string settingName, int defaultValue)
- {
- int retValue = defaultValue;
- if(this.ContainsKey(settingName))
- {
- int sleepInterval;
- if(Int32.TryParse(this[settingName], out sleepInterval)
- {
- retValue = sleepInterval;
- }
- }
- return retValue;
- }
- int retValue = 100;
- if(this.ContainsKey("ProcessingSleepTime"))
- {
- object sleepTime = this["ProcessingSleepTime"];
- int sleepInterval;
- if(Int32.TryParse(sleepTime.ToString(), out sleepInterval)
- {
- retValue = sleepInterval;
- }
- }
- return retValue;
Add Comment
Please, Sign In to add comment