3 writes to _context
System.Xaml (3)
System\Xaml\InfosetObjects\XamlObjectWriter.cs (3)
103_context = new ObjectWriterContext(savedContext, settings, rootNameScope, runtime); 107_context = new ObjectWriterContext(schemaContext, settings, rootNameScope, runtime); 955_context = null;
195 references to _context
System.Xaml (195)
System\Xaml\InfosetObjects\XamlObjectWriter.cs (195)
108_context.AddNamespacePrefix(KnownStrings.XmlPrefix, XamlLanguage.Xml1998Namespace); 112throw _context.WithLineInfo(new XamlInternalException()); 114_context.IsInitializedCallback = this; 116_deferringWriter = new DeferringWriter(_context); 148Debug.Assert(_context.SourceBamlUri == null || _context.BaseUri == null || _context.SourceBamlUri == _context.BaseUri, 150_afterBeginInitHandler(this, new XamlObjectEventArgs(value, _context.BaseUri ?? _context.SourceBamlUri, _context.LineNumber_StartObject, _context.LinePosition_StartObject)); 232get { return _context.Runtime; } 262throw _context.WithLineInfo(new XamlObjectWriterException(err)); 264XamlMember parentProperty = (_context.CurrentType == null && _context.Depth > 1) 265? _context.ParentProperty 266: _context.CurrentProperty; // there is a push frame below making this the parent property. 269XamlType xamlType = (_context.CurrentType == null && _context.Depth > 1) 270? _context.ParentType 271: _context.CurrentType; 277throw _context.WithLineInfo(new XamlObjectWriterException(err)); 287if (_context.CurrentType != null) 289_context.PushScope(); 292TryCreateParentInstance(_context); 294_context.CurrentIsObjectFromMember = true; 296object parentInstance = _context.ParentInstance; 297_context.CurrentType = parentProperty.Type; 300_context.CurrentInstance = inst ?? throw _context.WithLineInfo(new XamlObjectWriterException(SR.Format(SR.GetObjectNull, parentInstance.GetType(), parentProperty.Name))); 303_context.CurrentCollection = inst; 323_context.LineNumber_StartObject = _context.LineNumber; 324_context.LinePosition_StartObject = _context.LinePosition; 331throw _context.WithLineInfo(new XamlObjectWriterException(err)); 336throw _context.WithLineInfo(new XamlObjectWriterException(err)); 339if (_context.CurrentType != null && _context.CurrentProperty == null) 342_context.CurrentType.ToString()); 343throw _context.WithLineInfo(new XamlObjectWriterException(err)); 353if (_context.CurrentType != null) 355_context.PushScope(); 358_context.CurrentType = xamlType; 365if ((_context.LiveDepth == 1) && (_rootObjectInstance != null)) 368if (!rootType.CanAssignTo(_context.CurrentType)) 373_context.CurrentInstance = _rootObjectInstance; 374if (_context.CurrentType.IsCollection || _context.CurrentType.IsDictionary) 376_context.CurrentCollection = _rootObjectInstance; 378Logic_BeginInit(_context); 394Debug.Assert(_context.CurrentProperty.DeferringLoader != null); 396_context.PushScope(); 397_context.CurrentInstance = (XamlReader)templateList.GetReader(); 407throw _context.WithLineInfo(new XamlObjectWriterException(err)); 409if (_context.CurrentType == null) 412throw _context.WithLineInfo(new XamlObjectWriterException(err)); 414if (_context.CurrentProperty != null) 416string err = SR.Format(SR.OpenPropertyInCurrentFrame_EO, _context.CurrentType.ToString(), 417_context.CurrentProperty.ToString()); 418throw _context.WithLineInfo(new XamlObjectWriterException(err)); 423Debug.Assert(_context.LiveDepth > 0); 424bool hasUnresolvedChildren = HasUnresolvedChildren(_context.CurrentInstance); 425bool isFixupToken = _context.CurrentInstance is NameFixupToken; 427if (!_context.CurrentIsObjectFromMember) 433if (_context.CurrentInstance == null) 435Logic_CreateAndAssignToParentStart(_context); 438XamlType xamlType = _context.CurrentType; 439object instance = _context.CurrentInstance; 442if (_context.CurrentType.IsMarkupExtension) 447Logic_DeferProvideValue(_context); 451ExecutePendingAdds(_context.CurrentType, _context.CurrentInstance); 452Logic_EndInit(_context); 453instance = _context.CurrentInstance; 454Logic_AssignProvidedValue(_context); 455if (_context.CurrentInstanceRegisteredName != null) 460TriggerNameResolution(instance, _context.CurrentInstanceRegisteredName); 462_context.CurrentInstanceRegisteredName = null; 464instance = _context.CurrentInstance; 471if (_context.LiveDepth > 1) 473if (!_context.CurrentWasAssignedAtCreation) 475Logic_DoAssignmentToParentProperty(_context); 483if (_context.LiveDepth > 1) 485Logic_AddDependencyForUnresolvedChildren(_context, null); 490ExecutePendingAdds(_context.CurrentType, _context.CurrentInstance); 491Logic_EndInit(_context); 499Debug.Assert(_context.LiveDepth > 1); 500Logic_AddDependencyForUnresolvedChildren(_context, null); 504ExecutePendingAdds(_context.CurrentType, _context.CurrentInstance); 507if (_context.ParentIsPropertyValueSet) 509throw _context.WithLineInfo(new XamlDuplicateMemberException( 510_context.ParentProperty, 511_context.ParentType)); 514_lastInstance = _context.CurrentInstance; 515string name = _context.CurrentInstanceRegisteredName; 517if (_context.LiveDepth == 1) 519_rootNamescope = _context.RootNameScope; 525_context.PopScope(); 529_nameFixupGraph.IsOffTheStack(_lastInstance, name, _context.LineNumber, _context.LinePosition); 551if (_context.LiveDepth == 0 && !_inDispose) 554_context.RaiseNameScopeInitializationCompleteEvent(); 580err = SR.Format(SR.TypeHasNoContentProperty, _context.CurrentType); 586else if (_context.CurrentProperty != null) 588err = SR.Format(SR.OpenPropertyInCurrentFrame_SM, _context.CurrentType.ToString(), 589_context.CurrentProperty.ToString(), 592else if (_context.CurrentType == null) 599throw _context.WithLineInfo(new XamlObjectWriterException(err)); 604Debug.Assert(_context.LiveDepth > 0); 605_context.CurrentProperty = property; 609Logic_DuplicatePropertyCheck(_context, property, false /*onParent*/); 613if (_context.CurrentInstance == null) 615if (!IsConstructionDirective(_context.CurrentProperty) 616&& !IsDirectiveAllowedOnNullInstance(_context.CurrentProperty, _context.CurrentType)) 618Logic_CreateAndAssignToParentStart(_context); 625_context.CurrentCollection = new List<PositionalParameterDescriptor>(); 633throw _context.WithLineInfo(new XamlObjectWriterException(SR.Format(SR.LateConstructionDirective, property.Name))); 636if (_context.CurrentIsTypeConvertedObject) 642throw _context.WithLineInfo(new XamlObjectWriterException(SR.Format(SR.SettingPropertiesIsNotAllowed, property.Name))); 647if (property.IsAttachable && _context.CurrentInstance is NameFixupToken) 649NameFixupToken token = (NameFixupToken)_context.CurrentInstance; 650throw _context.WithLineInfo(new XamlObjectWriterException(SR.Format(SR.AttachedPropOnFwdRefTC, 651property, _context.CurrentType, string.Join(", ", token.NeededNames.ToArray())))); 665_context.CurrentCollection = Runtime.CreateInstance(property.Type, null); 687if (_context.CurrentType == null) 689property = _context.ParentProperty; 694property = _context.CurrentProperty; 699string err = (_context.CurrentType != null) 700? SR.Format(SR.NoPropertyInCurrentFrame_EM, _context.CurrentType.ToString()) 703throw _context.WithLineInfo(new XamlObjectWriterException(err)); 715_context.CurrentCtorArgs = ((List<object>)_context.CurrentCollection).ToArray(); 719Logic_CreateFromInitializationValue(_context); 723_context.CurrentCollection = null; 727Logic_ConvertPositionalParamsToArgs(_context); 732if (_context.CurrentType == null) 734value = _context.CurrentInstance; 735_context.PopScope(); 737Logic_ValidateXClass(_context, value); 739else if (_context.CurrentType == null) 752object value = _context.CurrentInstance; 760_context.CurrentInstance = me; 764Logic_AssignProvidedValue(_context); 775if (property.IsDirective && property == XamlLanguage.Key && !Logic_ShouldConvertKey(_context)) 778_context.ParentKeyIsUnconverted = true; 782shouldSetValue = Logic_CreatePropertyValueFromValue(_context); 787_lastInstance = _context.CurrentInstance; 790Logic_DoAssignmentToParentProperty(_context); 792_context.PopScope(); // Value Node Scope 797_context.CurrentProperty = null; 798_context.CurrentIsPropertyValueSet = false; 813Debug.Assert(_context.CurrentProperty.DeferringLoader != null); 815_context.PushScope(); 816_context.CurrentInstance = (XamlReader)templateList.GetReader(); 823XamlMember currentProperty = _context.CurrentProperty; 826string err = (_context.CurrentType != null) 827? SR.Format(SR.NoPropertyInCurrentFrame_V, value, _context.CurrentType.ToString()) 830throw _context.WithLineInfo(new XamlObjectWriterException(err)); 836_context.PushScope(); 837_context.CurrentInstance = value; 858_context.CurrentType = XamlLanguage.PositionalParameterDescriptor; 859_context.CurrentInstance = new PositionalParameterDescriptor(value, true); 860Logic_DoAssignmentToParentCollection(_context); 861_context.PopScope(); 865_context.CurrentInstance = value; 866Logic_DoAssignmentToParentCollection(_context); 867_context.PopScope(); 899throw _context.WithLineInfo(new XamlObjectWriterException(err)); 901if (_context.CurrentType != null && _context.CurrentProperty == null) 905_context.CurrentType.ToString()); 906throw _context.WithLineInfo(new XamlObjectWriterException(err)); 910if (_context.CurrentType != null) 912_context.PushScope(); 914_context.AddNamespacePrefix(namespaceDeclaration.Prefix, namespaceDeclaration.Namespace); 920while (_context.LiveDepth > 0) 922_context.PopScope(); 927_context.PushScope(); 937bool seenStartObject = _context.LiveDepth > 1 || _context.CurrentType != null; 940while (_context.LiveDepth > 0) 942if (_context.CurrentProperty != null) 984return _context.RootNameScope; 1005return _context.SchemaContext; 1014_context.LineNumber = lineNumber; 1015_context.LinePosition = linePosition; 1037return _context.WithLineInfo(ex); 2344!_context.IsOnTheLiveStack(token.TargetContext.CurrentInstance)) 2375if (_context.LiveDepth > 0) 2378if (_context.IsOnTheLiveStack(instance))