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
- SafeCryptoHandles.cs
- CompilerScopeManager.cs
- ToolStripItemBehavior.cs
- OdbcEnvironment.cs
- DetailsViewModeEventArgs.cs
- PageRequestManager.cs
- ThreadStateException.cs
- OutputCacheProfile.cs
- OleDbDataAdapter.cs
- ProgressBarHighlightConverter.cs
- BooleanFunctions.cs
- MemoryStream.cs
- ProviderSettings.cs
- Journal.cs
- ToolStripContextMenu.cs
- WmlControlAdapter.cs
- FormViewInsertEventArgs.cs
- DataObjectSettingDataEventArgs.cs
- AssertSection.cs
- NetworkCredential.cs
- PeerIPHelper.cs
- WorkflowInstanceExtensionManager.cs
- AncillaryOps.cs
- CultureTableRecord.cs
- FileAuthorizationModule.cs
- CryptoStream.cs
- UInt64Storage.cs
- BinaryWriter.cs
- GradientSpreadMethodValidation.cs
- MultiDataTrigger.cs
- DataServiceCollectionOfT.cs
- ArrayTypeMismatchException.cs
- DocumentGridPage.cs
- SerializationBinder.cs
- DynamicUpdateCommand.cs
- DbParameterCollection.cs
- SubMenuStyle.cs
- TextModifier.cs
- Shape.cs
- ReverseInheritProperty.cs
- IntSecurity.cs
- DriveInfo.cs
- wgx_commands.cs
- DataControlCommands.cs
- Stackframe.cs
- GlyphingCache.cs
- ResourceDescriptionAttribute.cs
- DispatchWrapper.cs
- RegexInterpreter.cs
- RuntimeUtils.cs
- SqlAliaser.cs
- EntityDataSourceContextCreatingEventArgs.cs
- HashStream.cs
- SafeProcessHandle.cs
- XmlUTF8TextWriter.cs
- ContentValidator.cs
- BinaryKeyIdentifierClause.cs
- ConfigurationStrings.cs
- Material.cs
- MachineKeyConverter.cs
- AspNetSynchronizationContext.cs
- RoutedEventConverter.cs
- StringValueSerializer.cs
- OptionalMessageQuery.cs
- CodeStatement.cs
- StandardBindingImporter.cs
- SelectionItemPattern.cs
- ListViewCommandEventArgs.cs
- ExceptionHandlersDesigner.cs
- TraceContext.cs
- Size3D.cs
- Geometry3D.cs
- ValueExpressions.cs
- Rect.cs
- BindingManagerDataErrorEventArgs.cs
- OleDbSchemaGuid.cs
- COAUTHINFO.cs
- EntityDataSourceState.cs
- Container.cs
- UdpRetransmissionSettings.cs
- ProfileModule.cs
- HorizontalAlignConverter.cs
- DtdParser.cs
- NotSupportedException.cs
- StringSorter.cs
- EnvironmentPermission.cs
- ProxyWebPartManager.cs
- InvalidProgramException.cs
- ComPlusServiceHost.cs
- OleDbConnectionFactory.cs
- FlowDocumentPaginator.cs
- AuthenticatedStream.cs
- WebPartCollection.cs
- GcHandle.cs
- AutomationAttributeInfo.cs
- TimeSpanOrInfiniteConverter.cs
- _AutoWebProxyScriptEngine.cs
- StylusTip.cs
- InstanceData.cs
- SamlSecurityTokenAuthenticator.cs