Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / MessageAction.cs / 1 / 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 (Keywords.Equals(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 (Keywords.Equals(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
- EntityConnectionStringBuilderItem.cs
- PolyBezierSegmentFigureLogic.cs
- HostingPreferredMapPath.cs
- UrlSyndicationContent.cs
- RelationshipSet.cs
- __ConsoleStream.cs
- HttpContext.cs
- Property.cs
- TCPClient.cs
- SQLInt32Storage.cs
- RouteParameter.cs
- DNS.cs
- Soap12ProtocolReflector.cs
- AsmxEndpointPickerExtension.cs
- ApplicationSecurityInfo.cs
- FormViewModeEventArgs.cs
- CustomPopupPlacement.cs
- WebScriptMetadataFormatter.cs
- WriteTimeStream.cs
- MethodCallConverter.cs
- PageHandlerFactory.cs
- ADRoleFactory.cs
- AmbientValueAttribute.cs
- DataGridViewAddColumnDialog.cs
- formatter.cs
- PiiTraceSource.cs
- FormatterServicesNoSerializableCheck.cs
- SchemaComplexType.cs
- DataGridViewColumn.cs
- PreviewPrintController.cs
- ScriptComponentDescriptor.cs
- IdentityModelStringsVersion1.cs
- XmlUtil.cs
- XmlILModule.cs
- Internal.cs
- SettingsSavedEventArgs.cs
- OdbcConnectionFactory.cs
- XmlSchemaInclude.cs
- DnsEndPoint.cs
- XmlSchemaElement.cs
- ToolStripPanel.cs
- SectionVisual.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- TextInfo.cs
- SQLInt32.cs
- FrameworkElementAutomationPeer.cs
- InfoCardTraceRecord.cs
- PrivacyNoticeBindingElement.cs
- SettingsPropertyCollection.cs
- HyperLinkColumn.cs
- XPathSingletonIterator.cs
- SchemaDeclBase.cs
- HttpProtocolImporter.cs
- FixedDocumentSequencePaginator.cs
- CustomCredentialPolicy.cs
- NonParentingControl.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- RC2.cs
- XD.cs
- HWStack.cs
- StrokeRenderer.cs
- ProfileManager.cs
- StreamInfo.cs
- Int32RectConverter.cs
- TextOptions.cs
- DataControlFieldCell.cs
- Library.cs
- UnsafeNativeMethods.cs
- WindowsGraphicsCacheManager.cs
- RawStylusInputCustomData.cs
- ServiceHostingEnvironment.cs
- ItemsControl.cs
- Point3DConverter.cs
- XmlComplianceUtil.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ACL.cs
- ElementInit.cs
- CompilerLocalReference.cs
- ConfigurationStrings.cs
- RegexMatchCollection.cs
- SqlWebEventProvider.cs
- DataGridHelper.cs
- FilterableAttribute.cs
- RenderContext.cs
- RequestStatusBarUpdateEventArgs.cs
- CodeArrayIndexerExpression.cs
- TraceSource.cs
- ButtonPopupAdapter.cs
- SByteStorage.cs
- odbcmetadatafactory.cs
- ApplicationTrust.cs
- CompensationExtension.cs
- CodeMemberProperty.cs
- MissingFieldException.cs
- ExpressionQuoter.cs
- FontFamily.cs
- SQLBytes.cs
- SyntaxCheck.cs
- SamlAuthenticationClaimResource.cs
- TraceListener.cs