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
- HttpWebRequest.cs
- XPathNavigatorKeyComparer.cs
- ADMembershipUser.cs
- NavigationExpr.cs
- CodeCatchClause.cs
- NativeMethods.cs
- HttpVersion.cs
- LazyLoadBehavior.cs
- DataSourceView.cs
- Label.cs
- RightsDocument.cs
- TreeNodeStyle.cs
- ObjectDataSourceSelectingEventArgs.cs
- TypeSystem.cs
- AmbientLight.cs
- FormsAuthenticationTicket.cs
- ObfuscationAttribute.cs
- PropertyOverridesDialog.cs
- DataStorage.cs
- NegationPusher.cs
- WindowVisualStateTracker.cs
- CategoryGridEntry.cs
- FixUp.cs
- TrustManagerMoreInformation.cs
- CodeIndexerExpression.cs
- SqlNodeTypeOperators.cs
- IdentityReference.cs
- StructuralObject.cs
- TabPanel.cs
- TextViewBase.cs
- ContextMenuStripGroup.cs
- PrimitiveCodeDomSerializer.cs
- BehaviorEditorPart.cs
- UpdateCompiler.cs
- HtmlFormWrapper.cs
- HtmlElementErrorEventArgs.cs
- SortedList.cs
- RawKeyboardInputReport.cs
- PageCodeDomTreeGenerator.cs
- SpanIndex.cs
- DynamicValidatorEventArgs.cs
- WinInetCache.cs
- ObjectMemberMapping.cs
- SqlError.cs
- XmlComplianceUtil.cs
- FontSource.cs
- PersonalizationProviderHelper.cs
- NativeActivityAbortContext.cs
- SoapReflectionImporter.cs
- Model3DGroup.cs
- CodeLinePragma.cs
- DesignTimeValidationFeature.cs
- HostedElements.cs
- EmptyEnumerable.cs
- FontSourceCollection.cs
- MultipartContentParser.cs
- BindingContext.cs
- ShaderEffect.cs
- OfTypeExpression.cs
- KeyboardEventArgs.cs
- HostedAspNetEnvironment.cs
- TemplateDefinition.cs
- XmlIterators.cs
- Switch.cs
- HasCopySemanticsAttribute.cs
- AutoGeneratedFieldProperties.cs
- CharacterMetrics.cs
- HttpGetClientProtocol.cs
- FilteredAttributeCollection.cs
- Partitioner.cs
- ColorMap.cs
- SQLGuid.cs
- Events.cs
- CodeValidator.cs
- StickyNoteAnnotations.cs
- SQLBinary.cs
- BooleanProjectedSlot.cs
- UrlAuthorizationModule.cs
- HttpPostClientProtocol.cs
- TypedTableHandler.cs
- WmlListAdapter.cs
- ErrorTolerantObjectWriter.cs
- LinkedList.cs
- PageSetupDialog.cs
- Link.cs
- TypeInitializationException.cs
- SecurityPermission.cs
- SiteMapPath.cs
- DiscreteKeyFrames.cs
- MouseEventArgs.cs
- WindowsServiceCredential.cs
- SignatureHelper.cs
- ReceiveSecurityHeaderElementManager.cs
- SafeHandles.cs
- _KerberosClient.cs
- BitmapSource.cs
- returneventsaver.cs
- CommonRemoteMemoryBlock.cs
- CorrelationKey.cs
- SQLByteStorage.cs