示例#1
0
            /// <summary>
            /// Gets the index with the specified name.
            /// </summary>
            /// <typeparam name="U">Key type for the requested index.</typeparam>
            /// <param name="name">The name of the index to get.</param>
            /// <param name="index">When this method returns, the index with the specified name, if the name is found; otherwise, the default value for the type of the <paramref name="index"/> parameter. This parameter is passed uninitialized.</param>
            /// <returns>
            /// true if there is an index with the specified name and specified key type; otherwise, false.
            /// </returns>
            /// <exception cref="T:System.ArgumentNullException">
            ///     <paramref name="name"/> is null.
            /// </exception>
            public bool TryGetIndex <U>(string name, out ClientDatabaseIndex <U, T> index)
            {
                ClientDatabaseIndex <T> rawIndex;

                if (database.indexDictionary.TryGetValue(name, out rawIndex) && rawIndex is ClientDatabaseIndex <U, T> )
                {
                    index = rawIndex as ClientDatabaseIndex <U, T>;
                    return(true);
                }
                else
                {
                    index = null;
                    return(false);
                }
            }
示例#2
0
 void IDictionary <string, ClientDatabaseIndex <T> > .Add(string key, ClientDatabaseIndex <T> value)
 {
     throw new NotSupportedException();
 }
示例#3
0
 bool IDictionary <string, ClientDatabaseIndex <T> > .TryGetValue(string key, out ClientDatabaseIndex <T> value)
 {
     return(database.indexDictionary.TryGetValue(key, out value));
 }
示例#4
0
 /// <summary>
 /// Gets the index with the specified name.
 /// </summary>
 /// <param name="name">The name of the index to get.</param>
 /// <param name="index">When this method returns, the index with the specified name, if the name is found; otherwise, the default value for the type of the <paramref name="index"/> parameter. This parameter is passed uninitialized.</param>
 /// <returns>
 /// true if there is an index with the specified name; otherwise, false.
 /// </returns>
 /// <exception cref="T:System.ArgumentNullException">
 ///     <paramref name="name"/> is null.
 /// </exception>
 public bool TryGetIndex(string name, out ClientDatabaseIndex <T> index)
 {
     return(database.indexDictionary.TryGetValue(name, out index));
 }
示例#5
0
 private void Initialize()
 {
     index = Indexes["Id"] as ClientDatabaseIndex <TKey, TValue>;
 }