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); }
private SemaphoreSlim EnsureAsyncActiveSemaphoreInitialized() { return(LazyInitializer.EnsureInitialized(ref _asyncActiveSemaphore, () => new SemaphoreSlim(1, 1))); }
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); }
internal IChangeToken GetFilterChangeToken() { CancellationTokenSource cts = LazyInitializer.EnsureInitialized(ref _cancellationTokenSource, () => new CancellationTokenSource()); return(new CancellationChangeToken(cts.Token)); }
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); }
public Task <RSA> GetMiniserverPublicKeyAsync(CancellationToken cancellationToken) => LazyInitializer.EnsureInitialized(ref _publicKeyTask, ref _publicKeyTaskInitialized, ref _lock, () => GetMiniserverPublicKeyInternalAsync(cancellationToken));
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); }
private void EnsureCacheIsPopulated() { LazyInitializer.EnsureInitialized(ref _regions, LoadRegions); }
private static IShotHistoryProvider CreateShotHistoryProvider(CueBallGameType gameType) { LazyInitializer.EnsureInitialized(ref _shotHistoryProvider, SetupGameStatusProviderStatus); return(_shotHistoryProvider[gameType]()); }
private IReadOnlyCollection <IElementDefinitionSummary> getChildDefinitions(IStructureDefinitionSummaryProvider provider) { LazyInitializer.EnsureInitialized(ref _childDefinitions, () => this.ChildDefinitions(provider)); return(_childDefinitions); }
private IProperty[] EnsurePropertiesInitialized() { return(LazyInitializer.EnsureInitialized(ref _properties, LoadProperties)); }
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))); }
ValueTask GetSource() { return(LazyInitializer.EnsureInitialized(ref source, ref initialized, ref syncLock, factory)); }
/// <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())); }
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); }
/// <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())); }
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())); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { // Обеспечение однократной инициализации ASP.NET Simple Membership при каждом запуске приложения LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock); }
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)); }
private async Task EnsureSizeIsCalculatedAsync() { await LazyInitializer.EnsureInitialized(ref this.calculateSizeTask, this.CalculateSizeAsync).ConfigureAwait(false); }