Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- Stylus.cs
- Win32SafeHandles.cs
- SystemParameters.cs
- Thickness.cs
- ContainerUtilities.cs
- Codec.cs
- OleDbInfoMessageEvent.cs
- XmlName.cs
- SystemWebCachingSectionGroup.cs
- FlagsAttribute.cs
- BaseCodeDomTreeGenerator.cs
- RightsManagementPermission.cs
- mda.cs
- EllipticalNodeOperations.cs
- MarkupCompilePass2.cs
- CodeSpit.cs
- _SafeNetHandles.cs
- Set.cs
- FillErrorEventArgs.cs
- GridEntryCollection.cs
- ObfuscationAttribute.cs
- MouseOverProperty.cs
- Win32Exception.cs
- ipaddressinformationcollection.cs
- GcHandle.cs
- ToolStripTextBox.cs
- TextTreeUndo.cs
- XmlSchemaRedefine.cs
- LassoSelectionBehavior.cs
- Point3D.cs
- CopyOfAction.cs
- WasHttpModulesInstallComponent.cs
- CodeGen.cs
- BamlResourceSerializer.cs
- SqlFacetAttribute.cs
- SimpleLine.cs
- SharedPersonalizationStateInfo.cs
- SQLInt16.cs
- FrameDimension.cs
- RTLAwareMessageBox.cs
- OutOfMemoryException.cs
- MessageSecurityOverTcpElement.cs
- MimeFormatExtensions.cs
- SqlTransaction.cs
- InvokePattern.cs
- ResourceIDHelper.cs
- XmlUrlResolver.cs
- CompModSwitches.cs
- TransformProviderWrapper.cs
- QilGenerator.cs
- CompilerParameters.cs
- WebPartZoneAutoFormat.cs
- TraceContextEventArgs.cs
- LookupBindingPropertiesAttribute.cs
- CollectionType.cs
- smtpconnection.cs
- StyleConverter.cs
- RefType.cs
- WebBrowserProgressChangedEventHandler.cs
- ClientFormsIdentity.cs
- StructuralCache.cs
- CallbackHandler.cs
- DependencyPropertyValueSerializer.cs
- SpeechUI.cs
- InternalConfigEventArgs.cs
- uribuilder.cs
- DBCSCodePageEncoding.cs
- PngBitmapDecoder.cs
- Math.cs
- DeviceContext2.cs
- SchemaNotation.cs
- SecurityManager.cs
- TrustLevel.cs
- BitmapScalingModeValidation.cs
- XmlBaseWriter.cs
- Condition.cs
- SecurityManager.cs
- DataGridViewTopLeftHeaderCell.cs
- ForEachAction.cs
- FixedLineResult.cs
- CodePageEncoding.cs
- CompositeFontFamily.cs
- StatusBarPanelClickEvent.cs
- RegistrationServices.cs
- MobileControlPersister.cs
- HandleCollector.cs
- MetafileHeader.cs
- SystemWebCachingSectionGroup.cs
- EditorReuseAttribute.cs
- DiagnosticsConfigurationHandler.cs
- WebBrowserNavigatedEventHandler.cs
- MenuItemStyle.cs
- CompilerState.cs
- RelatedEnd.cs
- FileSystemEnumerable.cs
- MailAddressParser.cs
- CommandLibraryHelper.cs
- PassportAuthenticationModule.cs
- DefaultBindingPropertyAttribute.cs
- PermissionListSet.cs