Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / MessageAction.cs / 1305376 / 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 (Ref.Equal(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 (Ref.Equal(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
- ColorAnimationBase.cs
- HyperLinkStyle.cs
- AnyReturnReader.cs
- HttpModuleActionCollection.cs
- XmlSchemaFacet.cs
- SharedStatics.cs
- ChainedAsyncResult.cs
- Line.cs
- RoleManagerSection.cs
- ExportFileRequest.cs
- PropertyEmitterBase.cs
- ConfigurationPropertyAttribute.cs
- TraceListener.cs
- DoubleAnimationClockResource.cs
- OleDbFactory.cs
- DriveInfo.cs
- Activity.cs
- WindowsToolbarAsMenu.cs
- Size.cs
- DataKeyCollection.cs
- Bitmap.cs
- DataGridViewDataErrorEventArgs.cs
- UriExt.cs
- Button.cs
- AppModelKnownContentFactory.cs
- WebPartDisplayMode.cs
- ExpressionBindingCollection.cs
- WeakEventManager.cs
- ControlAdapter.cs
- SHA384Managed.cs
- ExceptionHandlers.cs
- ExecutionContext.cs
- BufferedOutputStream.cs
- TouchPoint.cs
- WebPartVerbCollection.cs
- XmlParserContext.cs
- OdbcReferenceCollection.cs
- DBCommand.cs
- EditorZoneAutoFormat.cs
- AutomationPeer.cs
- ConnectionPoolManager.cs
- WebEventTraceProvider.cs
- AnnotationComponentChooser.cs
- NetworkCredential.cs
- CapabilitiesState.cs
- RectAnimationBase.cs
- DataColumnMappingCollection.cs
- KeyBinding.cs
- SyntaxCheck.cs
- ProtocolsConfigurationEntry.cs
- ThreadStaticAttribute.cs
- DataService.cs
- DbProviderManifest.cs
- DataGridViewHitTestInfo.cs
- LayoutEditorPart.cs
- SqlDataSourceFilteringEventArgs.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- _KerberosClient.cs
- SystemGatewayIPAddressInformation.cs
- BoolLiteral.cs
- ExpressionBuilder.cs
- AnnotationAdorner.cs
- AudioStateChangedEventArgs.cs
- MenuItemBinding.cs
- OdbcRowUpdatingEvent.cs
- SQLMoneyStorage.cs
- SchemaImporter.cs
- XmlEncodedRawTextWriter.cs
- ReliableOutputConnection.cs
- EdmPropertyAttribute.cs
- LocalizationComments.cs
- ExtensionFile.cs
- OleDbConnection.cs
- ToolZone.cs
- Setter.cs
- RelationshipEndMember.cs
- TextElementEnumerator.cs
- LocationSectionRecord.cs
- WebSysDefaultValueAttribute.cs
- IDataContractSurrogate.cs
- TreeNodeEventArgs.cs
- ArgumentElement.cs
- UnsafeNativeMethods.cs
- IWorkflowDebuggerService.cs
- ExpressionVisitor.cs
- UnitySerializationHolder.cs
- StatusBar.cs
- CollectionViewProxy.cs
- FontDriver.cs
- SQLByteStorage.cs
- Identifier.cs
- AxHost.cs
- AppSettingsExpressionBuilder.cs
- HttpApplicationStateWrapper.cs
- CommandHelpers.cs
- FieldAccessException.cs
- SafeHandle.cs
- SafeCertificateStore.cs
- ParameterBuilder.cs
- DockPanel.cs