Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- SHA512.cs
- DesignerHierarchicalDataSourceView.cs
- VarRemapper.cs
- RoleExceptions.cs
- RichTextBoxConstants.cs
- ThemeDictionaryExtension.cs
- IInstanceTable.cs
- XmlBinaryReader.cs
- HttpHostedTransportConfiguration.cs
- LowerCaseStringConverter.cs
- ListViewDataItem.cs
- NativeMethods.cs
- CompositeTypefaceMetrics.cs
- ComplexTypeEmitter.cs
- Int32CAMarshaler.cs
- StylusLogic.cs
- XamlToRtfWriter.cs
- ZoneButton.cs
- ResXDataNode.cs
- DataGridViewMethods.cs
- IncrementalHitTester.cs
- CreateUserWizardStep.cs
- ComponentEvent.cs
- IResourceProvider.cs
- CodeNamespaceImportCollection.cs
- ToolStripControlHost.cs
- CellParaClient.cs
- PersistenceProviderElement.cs
- ChannelCredentials.cs
- mediaeventargs.cs
- PolygonHotSpot.cs
- PlainXmlWriter.cs
- Error.cs
- ColorTransform.cs
- Compiler.cs
- HandleInitializationContext.cs
- AttributeEmitter.cs
- TextBoxBase.cs
- Attributes.cs
- PngBitmapEncoder.cs
- DataSourceControlBuilder.cs
- StorageAssociationSetMapping.cs
- ToolStripPanelRenderEventArgs.cs
- ComboBoxAutomationPeer.cs
- SecurityTokenTypes.cs
- DetailsViewUpdatedEventArgs.cs
- IndexerNameAttribute.cs
- TraceSource.cs
- TextSelectionProcessor.cs
- DynamicAttribute.cs
- _IPv6Address.cs
- MouseCaptureWithinProperty.cs
- XamlParser.cs
- SessionIDManager.cs
- Types.cs
- SelectionBorderGlyph.cs
- MouseActionValueSerializer.cs
- StylusPointProperties.cs
- TakeQueryOptionExpression.cs
- DocobjHost.cs
- GridLength.cs
- RemotingAttributes.cs
- PropertyGridDesigner.cs
- StaticDataManager.cs
- ThreadAttributes.cs
- XmlStringTable.cs
- shaperfactory.cs
- BrowserCapabilitiesCodeGenerator.cs
- InputLanguageSource.cs
- StrokeCollectionDefaultValueFactory.cs
- MexBindingBindingCollectionElement.cs
- LicenseManager.cs
- NeutralResourcesLanguageAttribute.cs
- DependencyObjectProvider.cs
- ProcessThread.cs
- UnsafeNativeMethods.cs
- Size3DValueSerializer.cs
- EntityDataSourceDesignerHelper.cs
- SafeCryptHandles.cs
- LambdaCompiler.Binary.cs
- ProgressBarAutomationPeer.cs
- Ray3DHitTestResult.cs
- UnsafeNativeMethodsMilCoreApi.cs
- Enum.cs
- TextBoxView.cs
- DataReaderContainer.cs
- TableCellCollection.cs
- MenuItemBindingCollection.cs
- ImageCodecInfo.cs
- XamlBrushSerializer.cs
- TemplateBamlTreeBuilder.cs
- InvokeMethodActivity.cs
- HMACSHA512.cs
- SiteIdentityPermission.cs
- GenericUriParser.cs
- BuildResultCache.cs
- ContentValidator.cs
- SlipBehavior.cs
- AutoCompleteStringCollection.cs
- ObjectTypeMapping.cs