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
- AppSettingsReader.cs
- DrawingContext.cs
- MonthCalendarDesigner.cs
- ReflectionPermission.cs
- ObjectDataSourceDisposingEventArgs.cs
- HttpApplication.cs
- RewritingSimplifier.cs
- CodeAccessSecurityEngine.cs
- WebBrowsableAttribute.cs
- OracleParameterCollection.cs
- HttpDictionary.cs
- FileDialog_Vista_Interop.cs
- MouseGestureConverter.cs
- ObjectDataSourceDesigner.cs
- CodeObjectCreateExpression.cs
- RepeatBehaviorConverter.cs
- SecurityStandardsManager.cs
- HttpListenerResponse.cs
- DataBoundControlAdapter.cs
- PrefixQName.cs
- RouteUrlExpressionBuilder.cs
- System.Data.OracleClient_BID.cs
- PropertyDescriptorComparer.cs
- QueryOperationResponseOfT.cs
- RawStylusInputReport.cs
- MessageQueueAccessControlEntry.cs
- Configuration.cs
- errorpatternmatcher.cs
- CapabilitiesSection.cs
- ProvideValueServiceProvider.cs
- IpcManager.cs
- ExtractorMetadata.cs
- PlatformCulture.cs
- ValueHandle.cs
- OTFRasterizer.cs
- BindingOperations.cs
- serverconfig.cs
- WebPartConnectionsEventArgs.cs
- TableDetailsCollection.cs
- ChooseAction.cs
- TemplateBindingExpression.cs
- ScriptingRoleServiceSection.cs
- InfoCardService.cs
- MetaForeignKeyColumn.cs
- AttributeTable.cs
- XmlCustomFormatter.cs
- EmissiveMaterial.cs
- SchemaTableOptionalColumn.cs
- Monitor.cs
- CachedPathData.cs
- DataSourceControl.cs
- CodeThrowExceptionStatement.cs
- TextStore.cs
- GridItem.cs
- GlobalEventManager.cs
- HttpConfigurationContext.cs
- HttpModuleAction.cs
- EdmConstants.cs
- TypeInfo.cs
- MatchingStyle.cs
- EntityViewContainer.cs
- LiteralControl.cs
- SingletonInstanceContextProvider.cs
- LambdaCompiler.Lambda.cs
- OciHandle.cs
- ScriptingJsonSerializationSection.cs
- WpfSharedXamlSchemaContext.cs
- DrawListViewItemEventArgs.cs
- UseAttributeSetsAction.cs
- NonValidatingSecurityTokenAuthenticator.cs
- NumberSubstitution.cs
- Int64Converter.cs
- RelatedCurrencyManager.cs
- XmlObjectSerializerWriteContext.cs
- ProviderConnectionPoint.cs
- LicenseProviderAttribute.cs
- TimeSpanValidatorAttribute.cs
- AbstractDataSvcMapFileLoader.cs
- MachinePropertyVariants.cs
- FixedTextPointer.cs
- OpCodes.cs
- UseLicense.cs
- SecurityContextSecurityTokenResolver.cs
- RegexFCD.cs
- FormViewDeleteEventArgs.cs
- DragStartedEventArgs.cs
- WmiEventSink.cs
- TrackBar.cs
- CompareInfo.cs
- TypefaceMap.cs
- Window.cs
- ContainerUIElement3D.cs
- OpenTypeLayout.cs
- BadImageFormatException.cs
- XmlDocumentSerializer.cs
- XamlRtfConverter.cs
- HtmlAnchor.cs
- DataBoundControl.cs
- X509Utils.cs
- PrintDocument.cs