/// <summary> /// Query SYSTem:ERRor automatically and throw ScpiErrorException on error /// </summary> /// <param name="enable"></param> /// <returns></returns> public IMessageSessionContext WithErrorsCheck(bool enable = true) { var context = new MessageSessionContext(this); context.checkScpiError = enable; return(context); }
/// <summary> /// Set read timeout for session /// </summary> /// <param name="timeout"></param> /// <returns></returns> public IMessageSessionContext WithTimeout(int timeout) { var context = new MessageSessionContext(this); context.timeout = timeout; return(context); }
public IMessageSessionContext Log(Action <string, MessageType, string, string> action) { var context = new MessageSessionContext(this); context.action += action; return(context); }
/// <summary> /// Set alias for message session /// </summary> /// <param name="resourceName"></param> /// <returns>Message session context</returns> public IMessageSessionContext WithResourceName(string resourceName) { var context = new MessageSessionContext(this); context.resourceName = resourceName; return(context); }
protected MessageSessionContext(MessageSessionContext context) { resourceName = context.resourceName; timeout = context.timeout; messageSession = context.messageSession; baseContext = context; checkScpiError = context.checkScpiError; ignoreWarnings = context.ignoreWarnings; }