Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AdvanceStateAsync()

Task System.Xml.XmlWellFormedWriter.AdvanceStateAsync ( Token token)
inlineprivate

Definition at line 4246 of file XmlWellFormedWriter.cs.

4247 {
4248 if (_currentState >= State.Closed)
4249 {
4250 if (_currentState == State.Closed || _currentState == State.Error)
4251 {
4253 }
4255 }
4256 State state;
4257 while (true)
4258 {
4259 state = _stateTable[(int)(((int)token << 4) + _currentState)];
4260 switch (state)
4261 {
4262 case State.Error:
4264 break;
4265 case State.StartContent:
4267 case State.StartContentEle:
4269 case State.StartContentB64:
4271 case State.StartDoc:
4273 case State.StartDocEle:
4275 case State.EndAttrSEle:
4276 {
4277 Task task = SequenceRun(WriteEndAttributeAsync(), (XmlWellFormedWriter thisRef) => thisRef.StartElementContentAsync(), this);
4278 return AdvanceStateAsync_ReturnWhenFinish(task, State.Element);
4279 }
4280 case State.EndAttrEEle:
4281 {
4282 Task task = SequenceRun(WriteEndAttributeAsync(), (XmlWellFormedWriter thisRef) => thisRef.StartElementContentAsync(), this);
4283 return AdvanceStateAsync_ReturnWhenFinish(task, State.Content);
4284 }
4285 case State.EndAttrSCont:
4286 {
4287 Task task = SequenceRun(WriteEndAttributeAsync(), (XmlWellFormedWriter thisRef) => thisRef.StartElementContentAsync(), this);
4288 return AdvanceStateAsync_ReturnWhenFinish(task, State.Content);
4289 }
4290 case State.EndAttrSAttr:
4292 case State.PostB64Cont:
4293 if (_rawWriter != null)
4294 {
4296 }
4297 _currentState = State.Content;
4298 continue;
4299 case State.PostB64Attr:
4300 if (_rawWriter != null)
4301 {
4303 }
4304 _currentState = State.Attribute;
4305 continue;
4306 case State.PostB64RootAttr:
4307 if (_rawWriter != null)
4308 {
4309 return AdvanceStateAsync_ContinueWhenFinish(_rawWriter.WriteEndBase64Async(), State.RootLevelAttr, token);
4310 }
4311 _currentState = State.RootLevelAttr;
4312 continue;
4313 case State.StartFragEle:
4314 StartFragment();
4315 state = State.Element;
4316 break;
4317 case State.StartFragCont:
4318 StartFragment();
4319 state = State.Content;
4320 break;
4321 case State.StartFragB64:
4322 StartFragment();
4323 state = State.B64Content;
4324 break;
4325 case State.StartRootLevelAttr:
4326 return AdvanceStateAsync_ReturnWhenFinish(WriteEndAttributeAsync(), State.RootLevelAttr);
4327 }
4328 break;
4329 }
4331 return Task.CompletedTask;
4332 }
static string Xml_ClosedOrError
Definition SR.cs:300
static string Xml_WrongToken
Definition SR.cs:302
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
static Task CompletedTask
Definition Task.cs:1120
virtual Task WriteEndBase64Async()
static string GetStateName(State state)
Task AdvanceStateAsync_ReturnWhenFinish(Task task, State newState)
void ThrowInvalidStateTransition(Token token, State currentState)
static readonly string[] tokenName
Task AdvanceStateAsync_ContinueWhenFinish(Task task, State newState, Token token)
XmlWellFormedWriter(XmlWriter writer, XmlWriterSettings settings)

References System.Xml.XmlWellFormedWriter._currentState, System.Xml.XmlWellFormedWriter._rawWriter, System.Xml.XmlWellFormedWriter._stateTable, System.Xml.XmlWellFormedWriter.AdvanceStateAsync_ContinueWhenFinish(), System.Xml.XmlWellFormedWriter.AdvanceStateAsync_ReturnWhenFinish(), System.Threading.Tasks.Task< TResult >.CompletedTask, System.Xml.Dictionary, System.SR.Format(), System.Xml.XmlWellFormedWriter.GetStateName(), System.Xml.XmlWellFormedWriter.StartElementContentAsync(), System.Xml.XmlWellFormedWriter.StartFragment(), System.state, System.task, System.Xml.XmlWellFormedWriter.ThrowInvalidStateTransition(), System.Xml.XmlWellFormedWriter.tokenName, System.Xml.XmlWellFormedWriter.WriteEndAttributeAsync(), System.Xml.XmlRawWriter.WriteEndBase64Async(), System.Xml.XmlWellFormedWriter.WriteStartDocumentAsync(), System.SR.Xml_ClosedOrError, and System.SR.Xml_WrongToken.

Referenced by System.Xml.XmlWellFormedWriter._AdvanceStateAsync_ContinueWhenFinish(), System.Xml.XmlWellFormedWriter.AdvanceStateAsync_ContinueWhenFinish(), System.Xml.XmlWellFormedWriter.DisposeAsyncCore(), System.Xml.XmlWellFormedWriter.WriteBase64Async(), System.Xml.XmlWellFormedWriter.WriteBinHexAsync(), System.Xml.XmlWellFormedWriter.WriteCDataAsync(), System.Xml.XmlWellFormedWriter.WriteCharEntityAsync(), System.Xml.XmlWellFormedWriter.WriteCharsAsync(), System.Xml.XmlWellFormedWriter.WriteCommentAsync(), System.Xml.XmlWellFormedWriter.WriteDocTypeAsync(), System.Xml.XmlWellFormedWriter.WriteEndAttributeAsync(), System.Xml.XmlWellFormedWriter.WriteEndDocumentAsync(), System.Xml.XmlWellFormedWriter.WriteEndElementAsync(), System.Xml.XmlWellFormedWriter.WriteEntityRefAsync(), System.Xml.XmlWellFormedWriter.WriteFullEndElementAsync(), System.Xml.XmlWellFormedWriter.WriteProcessingInstructionAsync(), System.Xml.XmlWellFormedWriter.WriteQualifiedNameAsync(), System.Xml.XmlWellFormedWriter.WriteRawAsync(), System.Xml.XmlWellFormedWriter.WriteRawAsync(), System.Xml.XmlWellFormedWriter.WriteStartAttributeAsync(), System.Xml.XmlWellFormedWriter.WriteStartDocumentImplAsync(), System.Xml.XmlWellFormedWriter.WriteStartElementAsync(), System.Xml.XmlWellFormedWriter.WriteStringAsync(), System.Xml.XmlWellFormedWriter.WriteSurrogateCharEntityAsync(), and System.Xml.XmlWellFormedWriter.WriteWhitespaceAsync().