Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / MessageAction.cs / 1305376 / MessageAction.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.IO; using System.Globalization; using System.Diagnostics; using System.Xml; using System.Xml.XPath; internal class MessageAction : ContainerAction { bool _Terminate; internal override void Compile(Compiler compiler) { CompileAttributes(compiler); if (compiler.Recurse()) { CompileTemplate(compiler); compiler.ToParent(); } } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.Terminate)) { _Terminate = compiler.GetYesNo(value); } else { return false; } return true; } internal override void Execute(Processor processor, ActionFrame frame) { Debug.Assert(processor != null && frame != null); switch (frame.State) { case Initialized: TextOnlyOutput output = new TextOnlyOutput(processor, new StringWriter(CultureInfo.InvariantCulture)); processor.PushOutput(output); processor.PushActionFrame(frame); frame.State = ProcessingChildren; break; case ProcessingChildren: TextOnlyOutput recOutput = processor.PopOutput() as TextOnlyOutput; Debug.Assert(recOutput != null); Console.WriteLine(recOutput.Writer.ToString()); if (_Terminate) { throw XsltException.Create(Res.Xslt_Terminate, recOutput.Writer.ToString()); } frame.Finished(); break; default: Debug.Fail("Invalid MessageAction execution state"); break; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.IO; using System.Globalization; using System.Diagnostics; using System.Xml; using System.Xml.XPath; internal class MessageAction : ContainerAction { bool _Terminate; internal override void Compile(Compiler compiler) { CompileAttributes(compiler); if (compiler.Recurse()) { CompileTemplate(compiler); compiler.ToParent(); } } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.Terminate)) { _Terminate = compiler.GetYesNo(value); } else { return false; } return true; } internal override void Execute(Processor processor, ActionFrame frame) { Debug.Assert(processor != null && frame != null); switch (frame.State) { case Initialized: TextOnlyOutput output = new TextOnlyOutput(processor, new StringWriter(CultureInfo.InvariantCulture)); processor.PushOutput(output); processor.PushActionFrame(frame); frame.State = ProcessingChildren; break; case ProcessingChildren: TextOnlyOutput recOutput = processor.PopOutput() as TextOnlyOutput; Debug.Assert(recOutput != null); Console.WriteLine(recOutput.Writer.ToString()); if (_Terminate) { throw XsltException.Create(Res.Xslt_Terminate, recOutput.Writer.ToString()); } frame.Finished(); break; default: Debug.Fail("Invalid MessageAction execution state"); break; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeRegionDirective.cs
- CodeAccessSecurityEngine.cs
- TextDecorationCollection.cs
- DataFormats.cs
- SqlFlattener.cs
- GcSettings.cs
- RelationshipEndMember.cs
- __TransparentProxy.cs
- SerializationInfo.cs
- HostUtils.cs
- ApplicationServiceManager.cs
- HtmlShim.cs
- RectKeyFrameCollection.cs
- XmlNavigatorStack.cs
- ObjectTag.cs
- ObjectDataSourceSelectingEventArgs.cs
- SqlServices.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- AdornerHitTestResult.cs
- GatewayIPAddressInformationCollection.cs
- QilUnary.cs
- RichTextBox.cs
- UshortList2.cs
- HttpListenerContext.cs
- PersonalizableTypeEntry.cs
- SBCSCodePageEncoding.cs
- CodeConditionStatement.cs
- XmlDataSource.cs
- PeerResolverSettings.cs
- BinaryUtilClasses.cs
- precedingsibling.cs
- EntityDataSource.cs
- EventHandlerList.cs
- DesignerActionVerbList.cs
- ConnectionManager.cs
- CharEnumerator.cs
- XmlQueryCardinality.cs
- CryptoApi.cs
- RtfToXamlLexer.cs
- SplitContainer.cs
- HtmlTableCell.cs
- SemanticResolver.cs
- SqlInternalConnectionTds.cs
- EncryptedPackage.cs
- XPathAncestorIterator.cs
- DesignTimeParseData.cs
- ItemList.cs
- PageVisual.cs
- CursorConverter.cs
- PolygonHotSpot.cs
- DataRowCollection.cs
- SplineKeyFrames.cs
- IPAddressCollection.cs
- UserMapPath.cs
- SpeechSeg.cs
- StringPropertyBuilder.cs
- _KerberosClient.cs
- DocumentViewer.cs
- _ScatterGatherBuffers.cs
- SystemTcpConnection.cs
- InternalControlCollection.cs
- Image.cs
- ServiceDesigner.xaml.cs
- StringDictionary.cs
- CallbackValidator.cs
- DataGridViewColumnCollectionEditor.cs
- ContractDescription.cs
- RuntimeArgumentHandle.cs
- Expr.cs
- Form.cs
- TextTreeObjectNode.cs
- DetailsViewModeEventArgs.cs
- OleDbConnectionFactory.cs
- CellParagraph.cs
- TabPage.cs
- StateFinalizationDesigner.cs
- HttpListenerResponse.cs
- DataGridViewCellConverter.cs
- NamedPermissionSet.cs
- AppSettings.cs
- TypeTypeConverter.cs
- PresentationTraceSources.cs
- ValueTypeFixupInfo.cs
- WorkflowServiceBehavior.cs
- SequentialOutput.cs
- HtmlButton.cs
- DataBindingCollection.cs
- FormViewUpdateEventArgs.cs
- Rect3DValueSerializer.cs
- Closure.cs
- FieldNameLookup.cs
- SchemaRegistration.cs
- DefaultHttpHandler.cs
- XmlDocumentFragment.cs
- MemoryFailPoint.cs
- BamlTreeNode.cs
- SmtpMail.cs
- ResourceExpression.cs
- OleDbStruct.cs
- InputManager.cs