/// <summary> /// Initializes a new instance of the <see cref="WebContextBase"/> class. /// </summary> /// <exception cref="InvalidOperationException"> is thrown if the constructor is invoked /// when <see cref="WebContextBase.Current"/> is valid and <paramref name="setAsCurrent"/> /// is <c>true</c>. /// </exception> /// <param name="setAsCurrent">Whether to use this context as the current instance</param> internal WebContextBase(bool setAsCurrent) { if (setAsCurrent) { if (WebContextBase.current != null) { throw new InvalidOperationException(Resources.WebContext_OnlyOne); } WebContextBase.current = this; } this._authentication = new DefaultAuthentication(); }
/// <summary> /// Initializes a new instance of the <see cref="WebContextBase"/> class. /// </summary> /// <exception cref="InvalidOperationException"> is thrown if the constructor is invoked /// when <see cref="WebContextBase.Current"/> is valid and <paramref name="setAsCurrent"/> /// is <c>true</c>. /// </exception> /// <param name="setAsCurrent">Whether to use this context as the current instance</param> internal WebContextBase(bool setAsCurrent) { if (setAsCurrent) { if (WebContextBase.current != null) { throw new InvalidOperationException(Resources.WebContext_OnlyOne); } WebContextBase.current = this; } this._authentication = new DefaultAuthentication(); }