Beispiel #1
0
        public static ICueBallGameReferee CreateGameReferee(CueBallGameType gameType)
        {
            LazyInitializer.EnsureInitialized(ref _gameReferee, SetupGameRefereeCreationalDelegates);

            return(_gameReferee[gameType](CreateShotHistoryProvider(gameType)));
        }
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     // 确保每次启动应用程序时只初始化一次 ASP.NET Simple Membership
     LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
 }
Beispiel #3
0
 private SemaphoreSlim EnsureAsyncActiveSemaphoreInitialized()
 {
     return(LazyInitializer.EnsureInitialized(ref _asyncActiveSemaphore, () => new SemaphoreSlim(1, 1)));
 }
Beispiel #4
0
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     // Ensure ASP.NET Simple Membership is initialized only once per app start
     LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
 }
Beispiel #5
0
        internal IChangeToken GetFilterChangeToken()
        {
            CancellationTokenSource cts = LazyInitializer.EnsureInitialized(ref _cancellationTokenSource, () => new CancellationTokenSource());

            return(new CancellationChangeToken(cts.Token));
        }
Beispiel #6
0
 void EnsureConsumerInitialized()
 => LazyInitializer.EnsureInitialized(ref consumer, InitializeConsumer);
 public IKey GetPrimaryKey()
 {
     return(LazyInitializer.EnsureInitialized(ref _key, LoadKey));
 }
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     // 請確定一個應用程式啟動只起始一次 ASP.NET Simple Membership
     LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
 }
Beispiel #9
0
 public Task <RSA> GetMiniserverPublicKeyAsync(CancellationToken cancellationToken) =>
 LazyInitializer.EnsureInitialized(ref _publicKeyTask, ref _publicKeyTaskInitialized, ref _lock, () => GetMiniserverPublicKeyInternalAsync(cancellationToken));
Beispiel #10
0
 public Task <string> GetSessionKeyAsync(CancellationToken cancellationToken) =>
 LazyInitializer.EnsureInitialized(ref _sessionKeyTask, ref _sessionKeyTaskInitialized, ref _lock, () => GetSessionKeyInternalAsync(cancellationToken));
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
 }
Beispiel #12
0
 private void EnsureCacheIsPopulated()
 {
     LazyInitializer.EnsureInitialized(ref _regions, LoadRegions);
 }
Beispiel #13
0
        private static IShotHistoryProvider CreateShotHistoryProvider(CueBallGameType gameType)
        {
            LazyInitializer.EnsureInitialized(ref _shotHistoryProvider, SetupGameStatusProviderStatus);

            return(_shotHistoryProvider[gameType]());
        }
Beispiel #14
0
        private IReadOnlyCollection <IElementDefinitionSummary> getChildDefinitions(IStructureDefinitionSummaryProvider provider)
        {
            LazyInitializer.EnsureInitialized(ref _childDefinitions, () => this.ChildDefinitions(provider));

            return(_childDefinitions);
        }
 private IProperty[] EnsurePropertiesInitialized()
 {
     return(LazyInitializer.EnsureInitialized(ref _properties, LoadProperties));
 }
Beispiel #16
0
 internal SemaphoreSlim EnsureAsyncActiveSemaphoreInitialized()
 {
     // Lazily-initialize _asyncActiveSemaphore.  As we're never accessing the SemaphoreSlim's
     // WaitHandle, we don't need to worry about Disposing it.
     return(LazyInitializer.EnsureInitialized(ref _asyncActiveSemaphore, () => new SemaphoreSlim(1, 1)));
 }
Beispiel #17
0
 ValueTask GetSource()
 {
     return(LazyInitializer.EnsureInitialized(ref source, ref initialized, ref syncLock, factory));
 }
Beispiel #18
0
 /// <summary>Gets the lazily-initialized completion state.</summary>
 private CompletionState EnsureCompletionStateInitialized()
 {
     // ValueLock not needed, but it's ok if it's held
     return(LazyInitializer.EnsureInitialized(ref m_completionState, () => new CompletionState()));
 }
Beispiel #19
0
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     // S'assurer qu'ASP.NET Simple Membership est initialisé une seule fois par démarrage d'application
     LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
 }
Beispiel #20
0
 /// <summary>
 /// Load settings from the AppSettings section of the config file.
 /// </summary>
 /// <returns></returns>
 public static IDictionary <string, string> LoadFromConfig()
 {
     return(LazyInitializer.EnsureInitialized(
                ref _fromConfigImplementation,
                () => new FromConfigImplementation()));
 }
Beispiel #21
0
 public virtual IPrincipalKeyValueFactory <TKey> GetPrincipalKeyValueFactory <TKey>()
 => (IPrincipalKeyValueFactory <TKey>)LazyInitializer.EnsureInitialized(
     ref _principalKeyValueFactory, () => new KeyValueFactoryFactory().Create <TKey>(this));
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     // Asegúrese de que ASP.NET Simple Membership se inicialice solo una vez por inicio de la aplicación
     LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
 }
 // Token: 0x06004131 RID: 16689 RVA: 0x000F2389 File Offset: 0x000F0589
 private ConcurrentExclusiveSchedulerPair.CompletionState EnsureCompletionStateInitialized()
 {
     return(LazyInitializer.EnsureInitialized <ConcurrentExclusiveSchedulerPair.CompletionState>(ref this.m_completionState, () => new ConcurrentExclusiveSchedulerPair.CompletionState()));
 }
Beispiel #24
0
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     // Обеспечение однократной инициализации ASP.NET Simple Membership при каждом запуске приложения
     LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
 }
Beispiel #25
0
 private static PropertyInfo GetTransformNamesPropertyInfo(Type attributeType)
 {
     return(LazyInitializer.EnsureInitialized(ref tranformerNamesLazyPropertyInfo,
                                              () => attributeType.GetProperty("TransformNames", BindingFlags.Instance | BindingFlags.Public)));
 }
 public T EnsureInitialized()
 {
     return(LazyInitializer.EnsureInitialized <T>(ref _value, ref _initialized, ref _lock, _initializer));
 }
Beispiel #27
0
 private async Task EnsureSizeIsCalculatedAsync()
 {
     await LazyInitializer.EnsureInitialized(ref this.calculateSizeTask, this.CalculateSizeAsync).ConfigureAwait(false);
 }