1 write to _contextPool
PresentationFramework (1)
MS\Internal\PtsHost\PtsCache.cs (1)
146_contextPool = new List<ContextDesc>(1);
62 references to _contextPool
PresentationFramework (62)
MS\Internal\PtsHost\PtsCache.cs (62)
183for (index = 0; index < _contextPool.Count; index++) 185if (!_contextPool[index].InUse && 186_contextPool[index].IsOptimalParagraphEnabled == ptsContext.IsOptimalParagraphEnabled) 194if (index == _contextPool.Count) 196_contextPool.Add(new ContextDesc()); 197_contextPool[index].IsOptimalParagraphEnabled = ptsContext.IsOptimalParagraphEnabled; 198_contextPool[index].PtsHost = new PtsHost(); 199_contextPool[index].PtsHost.Context = CreatePTSContext(index, textFormattingMode); 205if (_contextPool[index].IsOptimalParagraphEnabled) 207ptsContext.TextFormatter = _contextPool[index].TextFormatter; 211_contextPool[index].InUse = true; 212_contextPool[index].Owner = new WeakReference(ptsContext); 214return _contextPool[index].PtsHost; 252for (index = 0; index < _contextPool.Count; index++) 254if (_contextPool[index].PtsHost == ptsHost) 259Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the Context pool."); 260PTS.Validate(PTS.GetFloaterHandlerInfo(ref _contextPool[index].FloaterInit, pobjectinfo)); 271for (index = 0; index < _contextPool.Count; index++) 273if (_contextPool[index].PtsHost == ptsHost) 278Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the context pool."); 279PTS.Validate(PTS.GetTableObjHandlerInfo(ref _contextPool[index].TableobjInit, pobjectinfo)); 312while (index < _contextPool.Count) 314PtsContext ptsContext = _contextPool[index].Owner.Target as PtsContext; 317Invariant.Assert(_contextPool[index].PtsHost.Context == ptsContext.Context, "PTS Context mismatch."); 318_contextPool[index].Owner = new WeakReference(null); 319_contextPool[index].InUse = false; 325if (!_contextPool[index].InUse) 330Invariant.Assert(_contextPool[index].PtsHost.Context != IntPtr.Zero, "PTS Context handle is not valid."); 331PTS.IgnoreError(PTS.DestroyDocContext(_contextPool[index].PtsHost.Context)); 332Invariant.Assert(_contextPool[index].InstalledObjects != IntPtr.Zero, "Installed Objects handle is not valid."); 333PTS.IgnoreError(PTS.DestroyInstalledObjectsInfo(_contextPool[index].InstalledObjects)); 336if (_contextPool[index].TextPenaltyModule != null) 338_contextPool[index].TextPenaltyModule.Dispose(); 341_contextPool.RemoveAt(index); 377for (index = 0; index < _contextPool.Count; index++) 379if (_contextPool[index].PtsHost.Context == ptsContext.Context) 381_contextPool[index].Owner = new WeakReference(null); 382_contextPool[index].InUse = false; 386Invariant.Assert(index < _contextPool.Count, "PtsContext not found in the context pool."); 397if (cleanContextPool && _contextPool.Count > 4) 401while (index < _contextPool.Count) 403if (!_contextPool[index].InUse) 405Invariant.Assert(_contextPool[index].PtsHost.Context != IntPtr.Zero, "PTS Context handle is not valid."); 406PTS.Validate(PTS.DestroyDocContext(_contextPool[index].PtsHost.Context)); 407Invariant.Assert(_contextPool[index].InstalledObjects != IntPtr.Zero, "Installed Objects handle is not valid."); 408PTS.Validate(PTS.DestroyInstalledObjectsInfo(_contextPool[index].InstalledObjects)); 411if (_contextPool[index].TextPenaltyModule != null) 413_contextPool[index].TextPenaltyModule.Dispose(); 415_contextPool.RemoveAt(index); 436ptsHost = _contextPool[index].PtsHost; 440InitInstalledObjectsInfo(ptsHost, ref _contextPool[index].SubtrackParaInfo, ref _contextPool[index].SubpageParaInfo, out installedObjects, out installedObjectsCount); 441_contextPool[index].InstalledObjects = installedObjects; 444InitGenericInfo(ptsHost, (IntPtr)(index + 1), installedObjects, installedObjectsCount, ref _contextPool[index].ContextInfo); 447InitFloaterObjInfo(ptsHost, ref _contextPool[index].FloaterInit); 448InitTableObjInfo(ptsHost, ref _contextPool[index].TableobjInit); 451if (_contextPool[index].IsOptimalParagraphEnabled) 457_contextPool[index].TextPenaltyModule = penaltyModule; 458_contextPool[index].ContextInfo.ptsPenaltyModule = ptsPenaltyModule; 459_contextPool[index].TextFormatter = TextFormatter.CreateFromContext(textFormatterContext, textFormattingMode); 465GC.SuppressFinalize(_contextPool[index].TextPenaltyModule); 469PTS.Validate(PTS.CreateDocContext(ref _contextPool[index].ContextInfo, out context));