Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- DESCryptoServiceProvider.cs
- UriSection.cs
- TcpProcessProtocolHandler.cs
- WebPartMenuStyle.cs
- WebPartCatalogCloseVerb.cs
- XmlValueConverter.cs
- DataGridSortCommandEventArgs.cs
- ColumnHeaderCollectionEditor.cs
- SqlNode.cs
- TextDataBindingHandler.cs
- SiteMapDataSourceView.cs
- DownloadProgressEventArgs.cs
- Transform.cs
- HostSecurityManager.cs
- MethodExpr.cs
- SoapSchemaMember.cs
- MergeFailedEvent.cs
- PropertyDescriptor.cs
- ProcessProtocolHandler.cs
- CfgSemanticTag.cs
- SectionVisual.cs
- Adorner.cs
- UnsafeNativeMethods.cs
- MetadataSet.cs
- InputReferenceExpression.cs
- ProviderIncompatibleException.cs
- ToReply.cs
- HtmlInputPassword.cs
- _ProxyRegBlob.cs
- IteratorFilter.cs
- ValueChangedEventManager.cs
- HttpCapabilitiesEvaluator.cs
- ComplexLine.cs
- WebContext.cs
- RadioButtonPopupAdapter.cs
- SkewTransform.cs
- ToolboxItemFilterAttribute.cs
- ConstraintCollection.cs
- WebPartCatalogAddVerb.cs
- LoginCancelEventArgs.cs
- ExpressionBindingCollection.cs
- safemediahandle.cs
- PerformanceCounterPermissionEntry.cs
- ValidatingReaderNodeData.cs
- ToolStripActionList.cs
- WebPartMenu.cs
- FigureParaClient.cs
- PlatformCulture.cs
- FilterInvalidBodyAccessException.cs
- FixedSOMTextRun.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- JsonByteArrayDataContract.cs
- BinHexEncoder.cs
- Converter.cs
- Source.cs
- MetadataImporterQuotas.cs
- MultipleViewProviderWrapper.cs
- InstrumentationTracker.cs
- GeneralTransform2DTo3DTo2D.cs
- AttachedAnnotation.cs
- ToolboxComponentsCreatedEventArgs.cs
- WinEventTracker.cs
- BamlWriter.cs
- ReaderWriterLock.cs
- SequenceDesigner.cs
- Missing.cs
- ViewStateException.cs
- CapabilitiesPattern.cs
- Registry.cs
- ColumnWidthChangedEvent.cs
- ToolboxCategory.cs
- FixedTextContainer.cs
- ConfigXmlText.cs
- ConstraintCollection.cs
- VScrollBar.cs
- StructuralObject.cs
- UnsafeNativeMethods.cs
- XmlArrayAttribute.cs
- ThreadExceptionDialog.cs
- rsa.cs
- ReadOnlyNameValueCollection.cs
- UniqueIdentifierService.cs
- COM2Properties.cs
- BreakRecordTable.cs
- XamlInt32CollectionSerializer.cs
- ObjectRef.cs
- unsafenativemethodstextservices.cs
- SqlFacetAttribute.cs
- BackgroundFormatInfo.cs
- OdbcParameterCollection.cs
- SecurityIdentifierElementCollection.cs
- SerializationInfo.cs
- ArgumentNullException.cs
- SpanIndex.cs
- XmlDocument.cs
- EventProviderWriter.cs
- OpenTypeLayout.cs
- FastEncoder.cs
- WindowInteropHelper.cs
- HighlightComponent.cs