예제 #1
0
        /// <inheritdoc />
        protected override async Task <BoolResult> ShutdownCoreAsync(OperationContext context)
        {
            // Close all sessions?
            var result = await base.ShutdownCoreAsync(context);

            result &= await InnerStore.ShutdownAsync(context);

            return(result);
        }
 protected virtual void CopyItemsTo(T[] array, int arrayIndex)
 {
     using (IEnumerator <S> e = InnerStore.GetEnumerator())
     {
         while (e.MoveNext() && arrayIndex < array.Length)
         {
             array[arrayIndex++] = GetItem(e.Current);
         }
     }
 }
 protected virtual bool ContainsItem(T value)
 {
     using (IEnumerator <S> e = InnerStore.GetEnumerator())
         while (e.MoveNext())
         {
             if (Equals(GetItem(e.Current), value))
             {
                 return(true);
             }
         }
     return(false);
 }
예제 #4
0
        private CreateSessionResult <T> CreateSession <T>(Context context, string name, ImplicitPin implicitPin)
            where T : class, IName
        {
            var operationContext = OperationContext(context);

            return(operationContext.PerformOperation(
                       Tracer,
                       () =>
            {
                var innerSessionResult = InnerStore.CreateSession(context, name, implicitPin).ThrowIfFailure();
                var session = new VirtualizedContentSession(this, innerSessionResult.Session, name);
                return new CreateSessionResult <T>(session as T);
            }));
        }
예제 #5
0
        /// <inheritdoc />
        protected override async Task <BoolResult> StartupCoreAsync(OperationContext context)
        {
            await InnerStore.StartupAsync(context).ThrowIfFailure();

            return(await base.StartupCoreAsync(context));
        }
예제 #6
0
 /// <inheritdoc />
 public Task <GetStatsResult> GetStatsAsync(Context context)
 {
     return(InnerStore.GetStatsAsync(context));
 }
예제 #7
0
 /// <inheritdoc />
 public void PostInitializationCompleted(Context context, BoolResult result) => InnerStore.PostInitializationCompleted(context, result);