2 implementations of Context
System.Windows.Forms.Design (2)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.PassThroughSerializationManager.cs (1)
21ContextStack IDesignerSerializationManager.Context
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (1)
640ContextStack IDesignerSerializationManager.Context
117 references to Context
System.Windows.Forms.Design (98)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (4)
500manager.Context.Push(statementCtx); 509manager.Context.Push(extraStatements); 573manager.Context.Pop(); 646manager.Context.Pop();
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.PassThroughSerializationManager.cs (1)
23get => ((IDesignerSerializationManager)Manager).Context;
System\ComponentModel\Design\Serialization\CodeDomSerializer.cs (6)
210manager.Context.Push(abs); 217Debug.Assert(manager.Context.Current == abs, "Serializer added a context it didn't remove."); 218manager.Context.Pop(); 271manager.Context.Push(abs); 279Debug.Assert(manager.Context.Current == abs, "Serializer added a context it didn't remove."); 280manager.Context.Pop();
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (33)
407manager.Context.Push(statement); 465Debug.Assert(manager.Context.Current == statement, "Someone corrupted the context stack"); 466manager.Context.Pop(); 1965manager.Context.Push(newCtx); 1976Debug.Assert(manager.Context.Current == newCtx, "Context stack corrupted."); 1977manager.Context.Pop(); 2108manager.Context.Push(statements); 2109manager.Context.Push(descriptor); 2121Debug.Assert(manager.Context.Current == descriptor, "Context stack corrupted."); 2122manager.Context.Pop(); 2123manager.Context.Pop(); 2149manager.Context.Push(inheritance); 2162Debug.Assert(manager.Context.Current == inheritance, "Somebody messed up our context stack."); 2163manager.Context.Pop(); 2197manager.Context.Push(statements); 2207manager.Context.Push(tree); 2230Debug.Assert(manager.Context.Current == tree, "Context stack corrupted."); 2231manager.Context.Pop(); 2238Debug.Assert(manager.Context.Current == statements, "Context stack corrupted."); 2239manager.Context.Pop(); 2254manager.Context.Push(statements); 2255manager.Context.Push(propertyToSerialize); 2266Debug.Assert(manager.Context.Current == propertyToSerialize, "Context stack corrupted."); 2267manager.Context.Pop(); 2268manager.Context.Pop(); 2360manager.Context.Push(saveStatements); 2373Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted."); 2374manager.Context.Pop(); 2506manager.Context.Append(table); 2554manager.Context.Push(saveStatements); 2566Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted."); 2567manager.Context.Pop(); 2596manager.Context.Append(table);
System\ComponentModel\Design\Serialization\CollectionCodeDomSerializer.cs (9)
424manager.Context.Push(newContext); 435Debug.Assert(manager.Context.Current == newContext, "Context stack corrupted."); 436manager.Context.Pop(); 518manager.Context.Push(newCtx); 529Debug.Assert(manager.Context.Current == newCtx, "Context stack corrupted."); 530manager.Context.Pop(); 594manager.Context.Push(newContext); 605Debug.Assert(manager.Context.Current == newContext, "Context stack corrupted."); 606manager.Context.Pop();
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (10)
201manager.Context.Push(value); 202manager.Context.Push(statements); 417manager.Context.Push(cache); 418manager.Context.Push(entry); 454Debug.Assert(manager.Context.Current == entry, "Context stack corrupted"); 455manager.Context.Pop(); 456manager.Context.Pop(); 496Debug.Assert(manager.Context.Current == statements, "Context stack corrupted"); 497manager.Context.Pop(); 498manager.Context.Pop();
System\ComponentModel\Design\Serialization\LocalizationCodeDomSerializer.cs (7)
49ApplyMethodTable? table = (ApplyMethodTable?)manager.Context[typeof(ApplyMethodTable)]; 54manager.Context.Append(table); 66PropertyDescriptor? descriptor = (PropertyDescriptor?)manager.Context[typeof(PropertyDescriptor)]; 67ExpressionContext? tree = (ExpressionContext?)manager.Context[typeof(ExpressionContext)]; 93CodeStatementCollection? statements = (CodeStatementCollection?)manager.Context[typeof(CodeStatementCollection)]; 116RootContext? rootContext = manager.Context[typeof(RootContext)] as RootContext; 129ResourceManager? resourceManager = manager.Context[typeof(ResourceManager)] as ResourceManager;
System\ComponentModel\Design\Serialization\PropertyMemberCodeDomSerializer.cs (9)
181manager.Context.Push(tree); 200Debug.Assert(manager.Context.Current == tree, "Serializer added a context it didn't remove."); 201manager.Context.Pop(); 249manager.Context.Push(tree); 260Debug.Assert(manager.Context.Current == tree, "Context stack corrupted."); 261manager.Context.Pop(); 330manager.Context.Push(tree); 341Debug.Assert(manager.Context.Current == tree, "Context stack corrupted."); 342manager.Context.Pop();
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.cs (7)
217manager.Context.Append(sm); 420manager.Context.Push(re.PropertyDescriptor!); 421manager.Context.Push(re.ExpressionContext!); 428Debug.Assert(manager.Context.Current == re.ExpressionContext, "Someone corrupted the context stack"); 429manager.Context.Pop(); 430Debug.Assert(manager.Context.Current == re.PropertyDescriptor, "Someone corrupted the context stack"); 431manager.Context.Pop();
System\ComponentModel\Design\Serialization\ResourcePropertyMemberCodeDomSerializer.cs (2)
34manager.Context.Push(_model); 42manager.Context.Pop();
System\ComponentModel\Design\Serialization\TypeCodeDomSerializer.cs (10)
89manager.Context.Push(rootCtx); 202Debug.Assert(manager.Context.Current == rootCtx, "Context stack corrupted"); 204manager.Context.Pop(); 430manager.Context.Push(docType); 431manager.Context.Push(rootCtx); 432manager.Context.Push(statementCtx); 465Debug.Assert(manager.Context.Current == statementCtx, "Somebody messed up our context stack"); 466manager.Context.Pop(); 467manager.Context.Pop(); 468manager.Context.Pop();
System.Windows.Forms.Design.Tests (17)
System\ComponentModel\Design\Serialization\DesignerSerializationManagerTests.cs (17)
113ContextStack context = iManager.Context; 115Assert.Same(context, iManager.Context); 124ContextStack context = iManager.Context; 126Assert.Same(context, iManager.Context); 128Assert.Throws<InvalidOperationException>(() => iManager.Context); 136Assert.Throws<InvalidOperationException>(() => iManager.Context); 462Assert.Throws<InvalidOperationException>(() => iManager.Context); 466Assert.Throws<InvalidOperationException>(() => iManager.Context); 471Assert.Throws<InvalidOperationException>(() => iManager.Context); 561ContextStack stack1 = iManager.Context; 563Assert.Same(stack1, iManager.Context); 568ContextStack stack2 = iManager.Context; 570Assert.Same(stack2, iManager.Context); 1742ContextStack stack1 = iManager.Context; 1744Assert.Same(stack1, iManager.Context); 1749ContextStack stack2 = iManager.Context; 1751Assert.Same(stack2, iManager.Context);
System.Windows.Forms.Primitives (2)
System\ComponentModel\Design\Serialization\DesignerSerializationManagerHelper.cs (2)
12if (manager.Context[typeof(T)] is T contextTemp) 24return manager.Context[typeof(T)] as T;