コード例 #1
0
        /// <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);
        }
コード例 #2
0
ファイル: DataSetUri.cs プロジェクト: modulexcite/SDSlite
 /// <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;
 }