internal override void EndProcessing() { // need to pop all the contexts, in case the transmission sequence // was interrupted while (true) { FormattingContextState ctx = contextManager.Peek(); if (ctx == FormattingContextState.none) { break; // we emerged and we are done } else if (ctx == FormattingContextState.group) { PopGroup(); } else if (ctx == FormattingContextState.document) { // inject the end format information FormatEndData endFormat = new FormatEndData(); this.WriteObject(endFormat); contextManager.Pop(); } } // while }
internal void Process(object o) { PacketInfoData formatData = o as PacketInfoData; FormatEntryData formatEntryData = formatData as FormatEntryData; if (formatEntryData != null) { OutputContext c = null; if (!formatEntryData.outOfBand) { c = (OutputContext)this.stack.Peek(); } this.payload(formatEntryData, c); } else { bool flag = formatData is FormatStartData; bool flag2 = formatData is GroupStartData; if (flag || flag2) { OutputContext context2 = this.contextCreation(this.ActiveOutputContext, formatData); this.stack.Push(context2); if (flag) { this.fs(context2); } else if (flag2) { this.gs(context2); } } else { GroupEndData fe = formatData as GroupEndData; FormatEndData data4 = formatData as FormatEndData; if ((fe != null) || (data4 != null)) { OutputContext context3 = (OutputContext)this.stack.Peek(); if (data4 != null) { this.fe(data4, context3); } else if (fe != null) { this.ge(fe, context3); } this.stack.Pop(); } } } }
internal override void EndProcessing() { while (true) { InnerFormatShapeCommandBase.FormattingContext context = (InnerFormatShapeCommandBase.FormattingContext) base.contextManager.Peek(); if (context.state == InnerFormatShapeCommandBase.FormattingContext.State.none) { return; } if (context.state == InnerFormatShapeCommandBase.FormattingContext.State.group) { this.PopGroup(); } else if (context.state == InnerFormatShapeCommandBase.FormattingContext.State.document) { FormatEndData o = new FormatEndData(); this.WriteObject(o); base.contextManager.Pop(); } } }
internal override void EndProcessing() { while (true) { InnerFormatShapeCommandBase.FormattingContext context = (InnerFormatShapeCommandBase.FormattingContext)base.contextManager.Peek(); if (context.state == InnerFormatShapeCommandBase.FormattingContext.State.none) { return; } if (context.state == InnerFormatShapeCommandBase.FormattingContext.State.group) { this.PopGroup(); } else if (context.state == InnerFormatShapeCommandBase.FormattingContext.State.document) { FormatEndData o = new FormatEndData(); this.WriteObject(o); base.contextManager.Pop(); } } }
/// <summary> /// callback for Fe processing /// </summary> /// <param name="fe">Fe notification message</param> /// <param name="c">current context, with Fs in it</param> private void ProcessFormatEnd(FormatEndData fe, FormatMessagesContextManager.OutputContext c) { //Console.WriteLine("ProcessFormatEnd"); // we just add an empty line to the display this.LineOutput.WriteLine(""); }
/// <summary> /// process an object from an input stream. It manages the context stack and /// calls back on the specified event delegates /// </summary> /// <param name="o">object to process</param> internal void Process(object o) { PacketInfoData formatData = o as PacketInfoData; FormatEntryData fed = formatData as FormatEntryData; if (fed != null) { OutputContext ctx = null; if (!fed.outOfBand) { ctx = _stack.Peek(); } // notify for Payload this.payload(fed, ctx); } else { bool formatDataIsFormatStartData = formatData is FormatStartData; bool formatDataIsGroupStartData = formatData is GroupStartData; // it's one of our formatting messages // we assume for the moment that they are in the correct sequence if (formatDataIsFormatStartData || formatDataIsGroupStartData) { OutputContext oc = this.contextCreation(this.ActiveOutputContext, formatData); _stack.Push(oc); // now we have the context properly set: need to notify the // underlying algorithm to do the start document or group stuff if (formatDataIsFormatStartData) { // notify for Fs this.fs(oc); } else if (formatDataIsGroupStartData) { //GroupStartData gsd = (GroupStartData) formatData; // notify for Gs this.gs(oc); } } else { GroupEndData ged = formatData as GroupEndData; FormatEndData fEndd = formatData as FormatEndData; if (ged != null || fEndd != null) { OutputContext oc = _stack.Peek(); if (fEndd != null) { // notify for Fe, passing the Fe info, before a Pop() this.fe(fEndd, oc); } else if (ged != null) { // notify for Fe, passing the Fe info, before a Pop() this.ge(ged, oc); } _stack.Pop(); } } } }
private void ProcessFormatEnd(FormatEndData fe, FormatMessagesContextManager.OutputContext c) { this.LineOutput.WriteLine(""); }