1 write to _contextPool
PresentationFramework (1)
src\Framework\MS\Internal\PtsHost\PtsCache.cs (1)
167_contextPool = new List<ContextDesc>(1);
62 references to _contextPool
PresentationFramework (62)
src\Framework\MS\Internal\PtsHost\PtsCache.cs (62)
214for (index = 0; index < _contextPool.Count; index++) 216if (!_contextPool[index].InUse && 217_contextPool[index].IsOptimalParagraphEnabled == ptsContext.IsOptimalParagraphEnabled) 224if (index == _contextPool.Count) 226_contextPool.Add(new ContextDesc()); 227_contextPool[index].IsOptimalParagraphEnabled = ptsContext.IsOptimalParagraphEnabled; 228_contextPool[index].PtsHost = new PtsHost(); 229_contextPool[index].PtsHost.Context = CreatePTSContext(index, textFormattingMode); 234if (_contextPool[index].IsOptimalParagraphEnabled) 236ptsContext.TextFormatter = _contextPool[index].TextFormatter; 240_contextPool[index].InUse = true; 241_contextPool[index].Owner = new WeakReference(ptsContext); 243return _contextPool[index].PtsHost; 289for (index = 0; index < _contextPool.Count; index++) 291if (_contextPool[index].PtsHost == ptsHost) 296Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the Context pool."); 297PTS.Validate(PTS.GetFloaterHandlerInfo(ref _contextPool[index].FloaterInit, pobjectinfo)); 316for (index = 0; index < _contextPool.Count; index++) 318if (_contextPool[index].PtsHost == ptsHost) 323Invariant.Assert(index < _contextPool.Count, "Cannot find matching PtsHost in the context pool."); 324PTS.Validate(PTS.GetTableObjHandlerInfo(ref _contextPool[index].TableobjInit, pobjectinfo)); 365while (index < _contextPool.Count) 367PtsContext ptsContext = _contextPool[index].Owner.Target as PtsContext; 370Invariant.Assert(_contextPool[index].PtsHost.Context == ptsContext.Context, "PTS Context mismatch."); 371_contextPool[index].Owner = new WeakReference(null); 372_contextPool[index].InUse = false; 378if (!_contextPool[index].InUse) 383Invariant.Assert(_contextPool[index].PtsHost.Context != IntPtr.Zero, "PTS Context handle is not valid."); 384PTS.IgnoreError(PTS.DestroyDocContext(_contextPool[index].PtsHost.Context)); 385Invariant.Assert(_contextPool[index].InstalledObjects != IntPtr.Zero, "Installed Objects handle is not valid."); 386PTS.IgnoreError(PTS.DestroyInstalledObjectsInfo(_contextPool[index].InstalledObjects)); 389if (_contextPool[index].TextPenaltyModule != null) 391_contextPool[index].TextPenaltyModule.Dispose(); 394_contextPool.RemoveAt(index); 440for (index = 0; index < _contextPool.Count; index++) 442if (_contextPool[index].PtsHost.Context == ptsContext.Context) 444_contextPool[index].Owner = new WeakReference(null); 445_contextPool[index].InUse = false; 449Invariant.Assert(index < _contextPool.Count, "PtsContext not found in the context pool."); 460if (cleanContextPool && _contextPool.Count > 4) 464while (index < _contextPool.Count) 466if (!_contextPool[index].InUse) 468Invariant.Assert(_contextPool[index].PtsHost.Context != IntPtr.Zero, "PTS Context handle is not valid."); 469PTS.Validate(PTS.DestroyDocContext(_contextPool[index].PtsHost.Context)); 470Invariant.Assert(_contextPool[index].InstalledObjects != IntPtr.Zero, "Installed Objects handle is not valid."); 471PTS.Validate(PTS.DestroyInstalledObjectsInfo(_contextPool[index].InstalledObjects)); 474if (_contextPool[index].TextPenaltyModule != null) 476_contextPool[index].TextPenaltyModule.Dispose(); 478_contextPool.RemoveAt(index); 507ptsHost = _contextPool[index].PtsHost; 511InitInstalledObjectsInfo(ptsHost, ref _contextPool[index].SubtrackParaInfo, ref _contextPool[index].SubpageParaInfo, out installedObjects, out installedObjectsCount); 512_contextPool[index].InstalledObjects = installedObjects; 515InitGenericInfo(ptsHost, (IntPtr)(index + 1), installedObjects, installedObjectsCount, ref _contextPool[index].ContextInfo); 518InitFloaterObjInfo(ptsHost, ref _contextPool[index].FloaterInit); 519InitTableObjInfo(ptsHost, ref _contextPool[index].TableobjInit); 522if (_contextPool[index].IsOptimalParagraphEnabled) 528_contextPool[index].TextPenaltyModule = penaltyModule; 529_contextPool[index].ContextInfo.ptsPenaltyModule = ptsPenaltyModule; 530_contextPool[index].TextFormatter = TextFormatter.CreateFromContext(textFormatterContext, textFormattingMode); 536GC.SuppressFinalize(_contextPool[index].TextPenaltyModule); 540PTS.Validate(PTS.CreateDocContext(ref _contextPool[index].ContextInfo, out context));