public void Clear() { this._handled = false; this._mode = DeferringMode.Off; this._deferredList = null; this._deferredTreeDepth = -1; }
void WriteObject(XamlType xamlType, bool fromMember, string methodName) { _handled = false; switch (_mode) { case DeferringMode.Off: break; case DeferringMode.TemplateReady: throw new XamlInternalException(SR.Get(SRID.TemplateNotCollected, methodName)); case DeferringMode.TemplateStarting: StartDeferredList(); _mode = DeferringMode.TemplateDeferring; goto case DeferringMode.TemplateDeferring; case DeferringMode.TemplateDeferring: if (fromMember) { _deferredWriter.WriteGetObject(); } else { _deferredWriter.WriteStartObject(xamlType); } _deferredTreeDepth += 1; _handled = true; break; default: throw new XamlInternalException(SR.Get(SRID.MissingCase, _mode.ToString(), methodName)); } }
public void Clear() { this._handled = false; this._mode = DeferringMode.Off; this._deferredList = null; this._deferredTreeDepth = -1; }
public void Clear() { _handled = false; _mode = DeferringMode.Off; _deferredList = null; _deferredTreeDepth = -1; }
public override void WriteValue(object value) { this._handled = false; switch (this._mode) { case DeferringMode.Off: return; case DeferringMode.TemplateStarting: if (!(value is XamlNodeList)) { this.StartDeferredList(); this._mode = DeferringMode.TemplateDeferring; break; } this._deferredList = (XamlNodeList)value; this._mode = DeferringMode.TemplateReady; this._handled = true; return; case DeferringMode.TemplateDeferring: break; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { "WriteValue" })); default: throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), "WriteValue" })); } this._deferredWriter.WriteValue(value); this._handled = true; }
public override void WriteStartMember(XamlMember property) { _handled = false; switch (_mode) { case DeferringMode.Off: if (property.DeferringLoader != null) { _mode = DeferringMode.TemplateStarting; // We assume in WriteValue that this property can never be multi-valued Debug.Assert(!property.IsDirective && !property.IsUnknown); } break; case DeferringMode.TemplateReady: throw new XamlInternalException(SR.Get(SRID.TemplateNotCollected, "WriteMember")); case DeferringMode.TemplateDeferring: _deferredWriter.WriteStartMember(property); _handled = true; break; default: throw new XamlInternalException(SR.Get(SRID.MissingCase, _mode.ToString(), "WriteMember")); } }
public override void WriteEndObject() { this._handled = false; switch (this._mode) { case DeferringMode.Off: return; case DeferringMode.TemplateDeferring: this._deferredWriter.WriteEndObject(); this._handled = true; this._deferredTreeDepth--; if (this._deferredTreeDepth == 0) { this._deferredWriter.Close(); this._deferredWriter = null; this._mode = DeferringMode.TemplateReady; } return; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { "WriteEndObject" })); } throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), "WriteEndObject" })); }
public override void WriteEndObject() { _handled = false; switch (_mode) { case DeferringMode.Off: break; case DeferringMode.TemplateReady: throw new XamlInternalException(SR.Get(SRID.TemplateNotCollected, "WriteEndObject")); case DeferringMode.TemplateDeferring: _deferredWriter.WriteEndObject(); _handled = true; _deferredTreeDepth -= 1; if (_deferredTreeDepth == 0) { _deferredWriter.Close(); _deferredWriter = null; _mode = DeferringMode.TemplateReady; } break; default: throw new XamlInternalException(SR.Get(SRID.MissingCase, _mode.ToString(), "WriteEndObject")); } }
private void WriteObject(XamlType xamlType, bool fromMember, string methodName) { this._handled = false; switch (this._mode) { case DeferringMode.Off: return; case DeferringMode.TemplateStarting: this.StartDeferredList(); this._mode = DeferringMode.TemplateDeferring; break; case DeferringMode.TemplateDeferring: break; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { methodName })); default: throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), methodName })); } if (fromMember) { this._deferredWriter.WriteGetObject(); } else { this._deferredWriter.WriteStartObject(xamlType); } this._deferredTreeDepth++; this._handled = true; }
public XamlNodeList CollectTemplateList() { XamlNodeList list = this._deferredList; this._deferredList = null; this._mode = DeferringMode.Off; return list; }
public XamlNodeList CollectTemplateList() { XamlNodeList list = this._deferredList; this._deferredList = null; this._mode = DeferringMode.Off; return(list); }
public XamlNodeList CollectTemplateList() { XamlNodeList retValue = _deferredList; _deferredList = null; _mode = DeferringMode.Off; return(retValue); }
public override void WriteStartMember(XamlMember property) { this._handled = false; switch (this._mode) { case DeferringMode.Off: if (property.DeferringLoader != null) { this._mode = DeferringMode.TemplateStarting; } return; case DeferringMode.TemplateDeferring: this._deferredWriter.WriteStartMember(property); this._handled = true; return; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { "WriteMember" })); } throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), "WriteMember" })); }
public override void WriteValue(object value) { _handled = false; switch (_mode) { case DeferringMode.Off: break; case DeferringMode.TemplateReady: throw new XamlInternalException(SR.Get(SRID.TemplateNotCollected, "WriteValue")); case DeferringMode.TemplateStarting: // This handles the case of SM template; V object; EM Debug.Assert(_deferredTreeDepth == 0); if (value is XamlNodeList) { _deferredList = (XamlNodeList)value; _mode = DeferringMode.TemplateReady; _handled = true; } else { StartDeferredList(); _mode = DeferringMode.TemplateDeferring; goto case DeferringMode.TemplateDeferring; } break; case DeferringMode.TemplateDeferring: _deferredWriter.WriteValue(value); _handled = true; break; default: throw new XamlInternalException(SR.Get(SRID.MissingCase, _mode.ToString(), "WriteValue")); } }
public override void WriteNamespace(NamespaceDeclaration namespaceDeclaration) { switch (_mode) { case DeferringMode.Off: return; case DeferringMode.TemplateReady: throw new XamlInternalException(SR.Get(SRID.TemplateNotCollected, "WriteNamespace")); case DeferringMode.TemplateStarting: StartDeferredList(); _mode = DeferringMode.TemplateDeferring; goto case DeferringMode.TemplateDeferring; case DeferringMode.TemplateDeferring: _deferredWriter.WriteNamespace(namespaceDeclaration); _handled = true; break; default: throw new XamlInternalException(SR.Get(SRID.MissingCase, _mode.ToString(), "WriteNamespace")); } }
public override void WriteNamespace(NamespaceDeclaration namespaceDeclaration) { switch (this._mode) { case DeferringMode.Off: return; case DeferringMode.TemplateStarting: this.StartDeferredList(); this._mode = DeferringMode.TemplateDeferring; break; case DeferringMode.TemplateDeferring: break; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { "WriteNamespace" })); default: throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), "WriteNamespace" })); } this._deferredWriter.WriteNamespace(namespaceDeclaration); this._handled = true; }
private void WriteObject(XamlType xamlType, bool fromMember, string methodName) { this._handled = false; switch (this._mode) { case DeferringMode.Off: return; case DeferringMode.TemplateStarting: this.StartDeferredList(); this._mode = DeferringMode.TemplateDeferring; break; case DeferringMode.TemplateDeferring: break; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { methodName })); default: throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), methodName })); } if (fromMember) { this._deferredWriter.WriteGetObject(); } else { this._deferredWriter.WriteStartObject(xamlType); } this._deferredTreeDepth++; this._handled = true; }
public DeferringWriter(ObjectWriterContext context) { _context = context; _mode = DeferringMode.Off; }
public override void WriteStartMember(XamlMember property) { this._handled = false; switch (this._mode) { case DeferringMode.Off: if (property.DeferringLoader != null) { this._mode = DeferringMode.TemplateStarting; } return; case DeferringMode.TemplateDeferring: this._deferredWriter.WriteStartMember(property); this._handled = true; return; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { "WriteMember" })); } throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), "WriteMember" })); }
public override void WriteEndObject() { this._handled = false; switch (this._mode) { case DeferringMode.Off: return; case DeferringMode.TemplateDeferring: this._deferredWriter.WriteEndObject(); this._handled = true; this._deferredTreeDepth--; if (this._deferredTreeDepth == 0) { this._deferredWriter.Close(); this._deferredWriter = null; this._mode = DeferringMode.TemplateReady; } return; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { "WriteEndObject" })); } throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), "WriteEndObject" })); }
public override void WriteValue(object value) { this._handled = false; switch (this._mode) { case DeferringMode.Off: return; case DeferringMode.TemplateStarting: if (!(value is XamlNodeList)) { this.StartDeferredList(); this._mode = DeferringMode.TemplateDeferring; break; } this._deferredList = (XamlNodeList) value; this._mode = DeferringMode.TemplateReady; this._handled = true; return; case DeferringMode.TemplateDeferring: break; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { "WriteValue" })); default: throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), "WriteValue" })); } this._deferredWriter.WriteValue(value); this._handled = true; }
public override void WriteNamespace(NamespaceDeclaration namespaceDeclaration) { switch (this._mode) { case DeferringMode.Off: return; case DeferringMode.TemplateStarting: this.StartDeferredList(); this._mode = DeferringMode.TemplateDeferring; break; case DeferringMode.TemplateDeferring: break; case DeferringMode.TemplateReady: throw new XamlInternalException(System.Xaml.SR.Get("TemplateNotCollected", new object[] { "WriteNamespace" })); default: throw new XamlInternalException(System.Xaml.SR.Get("MissingCase", new object[] { this._mode.ToString(), "WriteNamespace" })); } this._deferredWriter.WriteNamespace(namespaceDeclaration); this._handled = true; }
public DeferringWriter(ObjectWriterContext context) { this._context = context; this._mode = DeferringMode.Off; }