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
- ResourceKey.cs
- PageHandlerFactory.cs
- PowerStatus.cs
- RegexMatch.cs
- BufferedGraphicsManager.cs
- SqlDependency.cs
- DataGridViewCellStyle.cs
- OutOfMemoryException.cs
- Evidence.cs
- BuildProvider.cs
- OleDbException.cs
- PhonemeEventArgs.cs
- StsCommunicationException.cs
- NavigateEvent.cs
- DesignObjectWrapper.cs
- TemplateControlParser.cs
- StreamGeometry.cs
- PartialCachingAttribute.cs
- Viewport3DAutomationPeer.cs
- CellParagraph.cs
- PropertyEntry.cs
- ObjectView.cs
- RectKeyFrameCollection.cs
- DataGridViewDataErrorEventArgs.cs
- StorageModelBuildProvider.cs
- TreeViewAutomationPeer.cs
- PolyQuadraticBezierSegment.cs
- PolyLineSegment.cs
- InputBuffer.cs
- BamlLocalizationDictionary.cs
- TrustSection.cs
- SimpleApplicationHost.cs
- WindowsHyperlink.cs
- ToolStripItemTextRenderEventArgs.cs
- VirtualDirectoryMappingCollection.cs
- SoapFault.cs
- SQLMoneyStorage.cs
- BrowserCapabilitiesFactory.cs
- TextStore.cs
- Light.cs
- RecognizerInfo.cs
- MessageAction.cs
- WebConfigurationHost.cs
- EventMetadata.cs
- Pts.cs
- LocationFactory.cs
- ISO2022Encoding.cs
- WindowsGraphics.cs
- MachineKeyValidationConverter.cs
- ProxyHelper.cs
- OperationCanceledException.cs
- EasingKeyFrames.cs
- GeneralTransform3DCollection.cs
- XmlDataSourceView.cs
- JsonByteArrayDataContract.cs
- StylusCollection.cs
- ExpressionBuilderCollection.cs
- TextParagraphView.cs
- BamlLocalizationDictionary.cs
- WsatTransactionInfo.cs
- Unit.cs
- BindingList.cs
- EventLevel.cs
- SimpleTypeResolver.cs
- TemplatedMailWebEventProvider.cs
- MimeTypeMapper.cs
- TokenBasedSetEnumerator.cs
- StorageMappingFragment.cs
- TriggerBase.cs
- CommandDevice.cs
- EntityDataSourceValidationException.cs
- DataSourceHelper.cs
- SystemIPGlobalStatistics.cs
- VirtualPathProvider.cs
- DesignerAdapterUtil.cs
- ParserStreamGeometryContext.cs
- mediapermission.cs
- transactioncontext.cs
- Normalization.cs
- TargetControlTypeCache.cs
- _SslSessionsCache.cs
- TreeChangeInfo.cs
- WebConvert.cs
- PointLightBase.cs
- ListItemCollection.cs
- TemplateField.cs
- SQLRoleProvider.cs
- DataPagerField.cs
- OdbcInfoMessageEvent.cs
- AssociationSetEnd.cs
- PropertyGridDesigner.cs
- StrokeDescriptor.cs
- EventEntry.cs
- XmlCompatibilityReader.cs
- SRDisplayNameAttribute.cs
- _Events.cs
- DataGridViewTopRowAccessibleObject.cs
- ListView.cs
- TrustLevelCollection.cs
- VScrollBar.cs