/// <summary> /// Returns the open mode if it is specified in the uri; otherwise, returns <paramref name="default"/> value. /// </summary> /// <param name="default">The mode that should be returned if it is not specified in the uri.</param> /// <returns>The open mode.</returns> /// <seealso cref="OpenMode"/> public ResourceOpenMode GetOpenModeOrDefault(ResourceOpenMode @default) { int n = GetParameterOccurences("openMode"); if (n == 0) { return(@default); } if (n > 1) { throw new NotSupportedException("There are multiple openMode parameter in the uri"); } return(OpenMode); }
/// <summary> /// Returns the open mode if it is specified in the uri; otherwise, returns <paramref name="default"/> value. /// </summary> /// <param name="default">The mode that should be returned if it is not specified in the uri.</param> /// <returns>The open mode.</returns> /// <seealso cref="OpenMode"/> public ResourceOpenMode GetOpenModeOrDefault(ResourceOpenMode @default) { int n = GetParameterOccurences("openMode"); if (n == 0) return @default; if (n > 1) throw new NotSupportedException("There are multiple openMode parameter in the uri"); return OpenMode; }