3 writes to _context
System.Xaml (3)
System\Xaml\InfosetObjects\XamlObjectWriter.cs (3)
104_context = new ObjectWriterContext(savedContext, settings, rootNameScope, runtime); 108_context = new ObjectWriterContext(schemaContext, settings, rootNameScope, runtime); 960_context = null;
195 references to _context
System.Xaml (195)
System\Xaml\InfosetObjects\XamlObjectWriter.cs (195)
109_context.AddNamespacePrefix(KnownStrings.XmlPrefix, XamlLanguage.Xml1998Namespace); 113throw _context.WithLineInfo(new XamlInternalException()); 115_context.IsInitializedCallback = this; 117_deferringWriter = new DeferringWriter(_context); 151Debug.Assert(_context.SourceBamlUri == null || _context.BaseUri == null || _context.SourceBamlUri == _context.BaseUri, 153_afterBeginInitHandler(this, new XamlObjectEventArgs(value, _context.BaseUri ?? _context.SourceBamlUri, _context.LineNumber_StartObject, _context.LinePosition_StartObject)); 237get { return _context.Runtime; } 267throw _context.WithLineInfo(new XamlObjectWriterException(err)); 269XamlMember parentProperty = (_context.CurrentType == null && _context.Depth > 1) 270? _context.ParentProperty 271: _context.CurrentProperty; // there is a push frame below making this the parent property. 274XamlType xamlType = (_context.CurrentType == null && _context.Depth > 1) 275? _context.ParentType 276: _context.CurrentType; 282throw _context.WithLineInfo(new XamlObjectWriterException(err)); 292if (_context.CurrentType != null) 294_context.PushScope(); 297TryCreateParentInstance(_context); 299_context.CurrentIsObjectFromMember = true; 301object parentInstance = _context.ParentInstance; 302_context.CurrentType = parentProperty.Type; 305_context.CurrentInstance = inst ?? throw _context.WithLineInfo(new XamlObjectWriterException(SR.Format(SR.GetObjectNull, parentInstance.GetType(), parentProperty.Name))); 308_context.CurrentCollection = inst; 328_context.LineNumber_StartObject = _context.LineNumber; 329_context.LinePosition_StartObject = _context.LinePosition; 336throw _context.WithLineInfo(new XamlObjectWriterException(err)); 341throw _context.WithLineInfo(new XamlObjectWriterException(err)); 344if (_context.CurrentType != null && _context.CurrentProperty == null) 347_context.CurrentType.ToString()); 348throw _context.WithLineInfo(new XamlObjectWriterException(err)); 358if (_context.CurrentType != null) 360_context.PushScope(); 363_context.CurrentType = xamlType; 370if ((_context.LiveDepth == 1) && (_rootObjectInstance != null)) 373if (!rootType.CanAssignTo(_context.CurrentType)) 378_context.CurrentInstance = _rootObjectInstance; 379if (_context.CurrentType.IsCollection || _context.CurrentType.IsDictionary) 381_context.CurrentCollection = _rootObjectInstance; 383Logic_BeginInit(_context); 399Debug.Assert(_context.CurrentProperty.DeferringLoader != null); 401_context.PushScope(); 402_context.CurrentInstance = (XamlReader)templateList.GetReader(); 412throw _context.WithLineInfo(new XamlObjectWriterException(err)); 414if (_context.CurrentType == null) 417throw _context.WithLineInfo(new XamlObjectWriterException(err)); 419if (_context.CurrentProperty != null) 421string err = SR.Format(SR.OpenPropertyInCurrentFrame_EO, _context.CurrentType.ToString(), 422_context.CurrentProperty.ToString()); 423throw _context.WithLineInfo(new XamlObjectWriterException(err)); 428Debug.Assert(_context.LiveDepth > 0); 429bool hasUnresolvedChildren = HasUnresolvedChildren(_context.CurrentInstance); 430bool isFixupToken = _context.CurrentInstance is NameFixupToken; 432if (!_context.CurrentIsObjectFromMember) 438if (_context.CurrentInstance == null) 440Logic_CreateAndAssignToParentStart(_context); 443XamlType xamlType = _context.CurrentType; 444object instance = _context.CurrentInstance; 447if (_context.CurrentType.IsMarkupExtension) 452Logic_DeferProvideValue(_context); 456ExecutePendingAdds(_context.CurrentType, _context.CurrentInstance); 457Logic_EndInit(_context); 458instance = _context.CurrentInstance; 459Logic_AssignProvidedValue(_context); 460if (_context.CurrentInstanceRegisteredName != null) 465TriggerNameResolution(instance, _context.CurrentInstanceRegisteredName); 467_context.CurrentInstanceRegisteredName = null; 469instance = _context.CurrentInstance; 476if (_context.LiveDepth > 1) 478if (!_context.CurrentWasAssignedAtCreation) 480Logic_DoAssignmentToParentProperty(_context); 488if (_context.LiveDepth > 1) 490Logic_AddDependencyForUnresolvedChildren(_context, null); 495ExecutePendingAdds(_context.CurrentType, _context.CurrentInstance); 496Logic_EndInit(_context); 504Debug.Assert(_context.LiveDepth > 1); 505Logic_AddDependencyForUnresolvedChildren(_context, null); 509ExecutePendingAdds(_context.CurrentType, _context.CurrentInstance); 512if (_context.ParentIsPropertyValueSet) 514throw _context.WithLineInfo(new XamlDuplicateMemberException( 515_context.ParentProperty, 516_context.ParentType)); 519_lastInstance = _context.CurrentInstance; 520string name = _context.CurrentInstanceRegisteredName; 522if (_context.LiveDepth == 1) 524_rootNamescope = _context.RootNameScope; 530_context.PopScope(); 534_nameFixupGraph.IsOffTheStack(_lastInstance, name, _context.LineNumber, _context.LinePosition); 556if (_context.LiveDepth == 0 && !_inDispose) 559_context.RaiseNameScopeInitializationCompleteEvent(); 585err = SR.Format(SR.TypeHasNoContentProperty, _context.CurrentType); 591else if (_context.CurrentProperty != null) 593err = SR.Format(SR.OpenPropertyInCurrentFrame_SM, _context.CurrentType.ToString(), 594_context.CurrentProperty.ToString(), 597else if (_context.CurrentType == null) 604throw _context.WithLineInfo(new XamlObjectWriterException(err)); 609Debug.Assert(_context.LiveDepth > 0); 610_context.CurrentProperty = property; 614Logic_DuplicatePropertyCheck(_context, property, false /*onParent*/); 618if (_context.CurrentInstance == null) 620if (!IsConstructionDirective(_context.CurrentProperty) 621&& !IsDirectiveAllowedOnNullInstance(_context.CurrentProperty, _context.CurrentType)) 623Logic_CreateAndAssignToParentStart(_context); 630_context.CurrentCollection = new List<PositionalParameterDescriptor>(); 638throw _context.WithLineInfo(new XamlObjectWriterException(SR.Format(SR.LateConstructionDirective, property.Name))); 641if (_context.CurrentIsTypeConvertedObject) 647throw _context.WithLineInfo(new XamlObjectWriterException(SR.Format(SR.SettingPropertiesIsNotAllowed, property.Name))); 652if (property.IsAttachable && _context.CurrentInstance is NameFixupToken) 654NameFixupToken token = (NameFixupToken)_context.CurrentInstance; 655throw _context.WithLineInfo(new XamlObjectWriterException(SR.Format(SR.AttachedPropOnFwdRefTC, 656property, _context.CurrentType, string.Join(", ", token.NeededNames.ToArray())))); 670_context.CurrentCollection = Runtime.CreateInstance(property.Type, null); 692if (_context.CurrentType == null) 694property = _context.ParentProperty; 699property = _context.CurrentProperty; 704string err = (_context.CurrentType != null) 705? SR.Format(SR.NoPropertyInCurrentFrame_EM, _context.CurrentType.ToString()) 708throw _context.WithLineInfo(new XamlObjectWriterException(err)); 720_context.CurrentCtorArgs = ((List<object>)_context.CurrentCollection).ToArray(); 724Logic_CreateFromInitializationValue(_context); 728_context.CurrentCollection = null; 732Logic_ConvertPositionalParamsToArgs(_context); 737if (_context.CurrentType == null) 739value = _context.CurrentInstance; 740_context.PopScope(); 742Logic_ValidateXClass(_context, value); 744else if (_context.CurrentType == null) 757object value = _context.CurrentInstance; 765_context.CurrentInstance = me; 769Logic_AssignProvidedValue(_context); 780if (property.IsDirective && property == XamlLanguage.Key && !Logic_ShouldConvertKey(_context)) 783_context.ParentKeyIsUnconverted = true; 787shouldSetValue = Logic_CreatePropertyValueFromValue(_context); 792_lastInstance = _context.CurrentInstance; 795Logic_DoAssignmentToParentProperty(_context); 797_context.PopScope(); // Value Node Scope 802_context.CurrentProperty = null; 803_context.CurrentIsPropertyValueSet = false; 818Debug.Assert(_context.CurrentProperty.DeferringLoader != null); 820_context.PushScope(); 821_context.CurrentInstance = (XamlReader)templateList.GetReader(); 828XamlMember currentProperty = _context.CurrentProperty; 831string err = (_context.CurrentType != null) 832? SR.Format(SR.NoPropertyInCurrentFrame_V, value, _context.CurrentType.ToString()) 835throw _context.WithLineInfo(new XamlObjectWriterException(err)); 841_context.PushScope(); 842_context.CurrentInstance = value; 863_context.CurrentType = XamlLanguage.PositionalParameterDescriptor; 864_context.CurrentInstance = new PositionalParameterDescriptor(value, true); 865Logic_DoAssignmentToParentCollection(_context); 866_context.PopScope(); 870_context.CurrentInstance = value; 871Logic_DoAssignmentToParentCollection(_context); 872_context.PopScope(); 904throw _context.WithLineInfo(new XamlObjectWriterException(err)); 906if (_context.CurrentType != null && _context.CurrentProperty == null) 910_context.CurrentType.ToString()); 911throw _context.WithLineInfo(new XamlObjectWriterException(err)); 915if (_context.CurrentType != null) 917_context.PushScope(); 919_context.AddNamespacePrefix(namespaceDeclaration.Prefix, namespaceDeclaration.Namespace); 925while (_context.LiveDepth > 0) 927_context.PopScope(); 932_context.PushScope(); 942bool seenStartObject = _context.LiveDepth > 1 || _context.CurrentType != null; 945while (_context.LiveDepth > 0) 947if (_context.CurrentProperty != null) 989return _context.RootNameScope; 1010return _context.SchemaContext; 1019_context.LineNumber = lineNumber; 1020_context.LinePosition = linePosition; 1042return _context.WithLineInfo(ex); 2355!_context.IsOnTheLiveStack(token.TargetContext.CurrentInstance)) 2386if (_context.LiveDepth > 0) 2389if (_context.IsOnTheLiveStack(instance))