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
- VariableQuery.cs
- WindowsSlider.cs
- EntityProxyFactory.cs
- GiveFeedbackEventArgs.cs
- BehaviorEditorPart.cs
- TypeCodeDomSerializer.cs
- DBPropSet.cs
- SQLByteStorage.cs
- NonSerializedAttribute.cs
- ScriptControlDescriptor.cs
- PageThemeCodeDomTreeGenerator.cs
- SmiRecordBuffer.cs
- PropertyToken.cs
- StringUtil.cs
- iisPickupDirectory.cs
- Trace.cs
- ParenthesizePropertyNameAttribute.cs
- SqlServices.cs
- WorkerRequest.cs
- XmlSchemaSubstitutionGroup.cs
- CredentialManagerDialog.cs
- DropAnimation.xaml.cs
- InvokeProviderWrapper.cs
- XmlNodeList.cs
- SynchronousReceiveBehavior.cs
- ControlPaint.cs
- Vector3DAnimationBase.cs
- SchemaElementDecl.cs
- LifetimeServices.cs
- StoreItemCollection.Loader.cs
- _FixedSizeReader.cs
- SystemTcpStatistics.cs
- FormViewDeleteEventArgs.cs
- ChangePassword.cs
- DataGridTextBox.cs
- ByteStreamMessageEncodingElement.cs
- ImageSource.cs
- TextTreeTextBlock.cs
- DesignTimeValidationFeature.cs
- ExpressionBindingCollection.cs
- DataFormats.cs
- CustomPopupPlacement.cs
- TextElementEditingBehaviorAttribute.cs
- DataServiceProcessingPipelineEventArgs.cs
- CacheSection.cs
- SafeFileMappingHandle.cs
- ColorAnimation.cs
- DependencyObjectProvider.cs
- ClientConfigPaths.cs
- XamlSerializer.cs
- DataGridHelper.cs
- SocketElement.cs
- DoubleAnimationClockResource.cs
- SignedXml.cs
- Int32CollectionConverter.cs
- FontCollection.cs
- StatusBarAutomationPeer.cs
- UriExt.cs
- UnionCqlBlock.cs
- InputLanguageProfileNotifySink.cs
- SrgsSubset.cs
- BindingExpressionBase.cs
- MsmqInputSessionChannelListener.cs
- SocketAddress.cs
- SqlUtil.cs
- Processor.cs
- BrushMappingModeValidation.cs
- ServiceHttpModule.cs
- GridViewItemAutomationPeer.cs
- NumberSubstitution.cs
- FrameDimension.cs
- ColorMap.cs
- MessageDecoder.cs
- HtmlTernaryTree.cs
- XmlObjectSerializerWriteContextComplex.cs
- XmlName.cs
- MailAddress.cs
- WebControlsSection.cs
- FormsAuthenticationUser.cs
- DataGridViewColumnCollectionDialog.cs
- DomNameTable.cs
- PauseStoryboard.cs
- util.cs
- NativeActivityTransactionContext.cs
- SendKeys.cs
- ImageAttributes.cs
- RootBrowserWindowProxy.cs
- ExtensibleClassFactory.cs
- Point3DCollectionValueSerializer.cs
- XPathChildIterator.cs
- PropertyValueChangedEvent.cs
- ManualResetEvent.cs
- HtmlImage.cs
- File.cs
- DotAtomReader.cs
- EdmItemError.cs
- Transform.cs
- BoolExpr.cs
- ThreadSafeList.cs
- EventSetterHandlerConverter.cs