1 write to _contextPool
PresentationFramework (1)
MS\Internal\PtsHost\PtsCache.cs (1)
149_contextPool = new List<ContextDesc>(1);
62 references to _contextPool
PresentationFramework (62)
MS\Internal\PtsHost\PtsCache.cs (62)
186for (index = 0; index < _contextPool.Count; index++) 188if (!_contextPool[index].InUse && 189_contextPool[index].IsOptimalParagraphEnabled == ptsContext.IsOptimalParagraphEnabled) 196if (index == _contextPool.Count) 198_contextPool.Add(new ContextDesc()); 199_contextPool[index].IsOptimalParagraphEnabled = ptsContext.IsOptimalParagraphEnabled; 200_contextPool[index].PtsHost = new PtsHost(); 201_contextPool[index].PtsHost.Context = CreatePTSContext(index, textFormattingMode); 206if (_contextPool[index].IsOptimalParagraphEnabled) 208ptsContext.TextFormatter = _contextPool[index].TextFormatter; 212_contextPool[index].InUse = true; 213_contextPool[index].Owner = new WeakReference(ptsContext); 215return _contextPool[index].PtsHost; 253for (index = 0; index < _contextPool.Count; index++) 255if (_contextPool[index].PtsHost == ptsHost) 260Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the Context pool."); 261PTS.Validate(PTS.GetFloaterHandlerInfo(ref _contextPool[index].FloaterInit, pobjectinfo)); 272for (index = 0; index < _contextPool.Count; index++) 274if (_contextPool[index].PtsHost == ptsHost) 279Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the context pool."); 280PTS.Validate(PTS.GetTableObjHandlerInfo(ref _contextPool[index].TableobjInit, pobjectinfo)); 313while (index < _contextPool.Count) 315PtsContext ptsContext = _contextPool[index].Owner.Target as PtsContext; 318Invariant.Assert(_contextPool[index].PtsHost.Context == ptsContext.Context, "PTS Context mismatch."); 319_contextPool[index].Owner = new WeakReference(null); 320_contextPool[index].InUse = false; 326if (!_contextPool[index].InUse) 331Invariant.Assert(_contextPool[index].PtsHost.Context != IntPtr.Zero, "PTS Context handle is not valid."); 332PTS.IgnoreError(PTS.DestroyDocContext(_contextPool[index].PtsHost.Context)); 333Invariant.Assert(_contextPool[index].InstalledObjects != IntPtr.Zero, "Installed Objects handle is not valid."); 334PTS.IgnoreError(PTS.DestroyInstalledObjectsInfo(_contextPool[index].InstalledObjects)); 337if (_contextPool[index].TextPenaltyModule != null) 339_contextPool[index].TextPenaltyModule.Dispose(); 342_contextPool.RemoveAt(index); 378for (index = 0; index < _contextPool.Count; index++) 380if (_contextPool[index].PtsHost.Context == ptsContext.Context) 382_contextPool[index].Owner = new WeakReference(null); 383_contextPool[index].InUse = false; 387Invariant.Assert(index < _contextPool.Count, "PtsContext not found in the context pool."); 398if (cleanContextPool && _contextPool.Count > 4) 402while (index < _contextPool.Count) 404if (!_contextPool[index].InUse) 406Invariant.Assert(_contextPool[index].PtsHost.Context != IntPtr.Zero, "PTS Context handle is not valid."); 407PTS.Validate(PTS.DestroyDocContext(_contextPool[index].PtsHost.Context)); 408Invariant.Assert(_contextPool[index].InstalledObjects != IntPtr.Zero, "Installed Objects handle is not valid."); 409PTS.Validate(PTS.DestroyInstalledObjectsInfo(_contextPool[index].InstalledObjects)); 412if (_contextPool[index].TextPenaltyModule != null) 414_contextPool[index].TextPenaltyModule.Dispose(); 416_contextPool.RemoveAt(index); 437ptsHost = _contextPool[index].PtsHost; 441InitInstalledObjectsInfo(ptsHost, ref _contextPool[index].SubtrackParaInfo, ref _contextPool[index].SubpageParaInfo, out installedObjects, out installedObjectsCount); 442_contextPool[index].InstalledObjects = installedObjects; 445InitGenericInfo(ptsHost, (IntPtr)(index + 1), installedObjects, installedObjectsCount, ref _contextPool[index].ContextInfo); 448InitFloaterObjInfo(ptsHost, ref _contextPool[index].FloaterInit); 449InitTableObjInfo(ptsHost, ref _contextPool[index].TableobjInit); 452if (_contextPool[index].IsOptimalParagraphEnabled) 458_contextPool[index].TextPenaltyModule = penaltyModule; 459_contextPool[index].ContextInfo.ptsPenaltyModule = ptsPenaltyModule; 460_contextPool[index].TextFormatter = TextFormatter.CreateFromContext(textFormatterContext, textFormattingMode); 466GC.SuppressFinalize(_contextPool[index].TextPenaltyModule); 470PTS.Validate(PTS.CreateDocContext(ref _contextPool[index].ContextInfo, out context));