Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SettingsSection.cs
- EmptyTextWriter.cs
- EntityDataSourceContextDisposingEventArgs.cs
- DataGridItemAutomationPeer.cs
- Pair.cs
- TemplateDefinition.cs
- ManifestResourceInfo.cs
- EncoderParameter.cs
- DataGridColumnsPage.cs
- XamlTypeMapper.cs
- CodeLinePragma.cs
- EntitySetDataBindingList.cs
- DataTableReader.cs
- TextServicesContext.cs
- PropertyValueUIItem.cs
- StateManagedCollection.cs
- Compiler.cs
- PresentationAppDomainManager.cs
- Selector.cs
- Application.cs
- InheritanceContextHelper.cs
- EntityClassGenerator.cs
- PropertyDescriptorComparer.cs
- AttachedPropertyMethodSelector.cs
- HandlerElement.cs
- IdentityModelStringsVersion1.cs
- DataViewListener.cs
- LinearKeyFrames.cs
- BinaryUtilClasses.cs
- CalloutQueueItem.cs
- LineGeometry.cs
- SQLByteStorage.cs
- ActiveXContainer.cs
- MouseDevice.cs
- GetParentChain.cs
- MDIClient.cs
- ReceiveErrorHandling.cs
- CompositeCollection.cs
- ServiceDocument.cs
- EditorPartCollection.cs
- Decoder.cs
- Constant.cs
- RotateTransform.cs
- KeyInterop.cs
- InfocardInteractiveChannelInitializer.cs
- ApplicationManager.cs
- TemplateBuilder.cs
- CorrelationActionMessageFilter.cs
- GetPolicyDetailsRequest.cs
- WindowsScrollBar.cs
- CorrelationKeyCalculator.cs
- EntityParameter.cs
- PersistenceTypeAttribute.cs
- HtmlTableCellCollection.cs
- SqlCacheDependencySection.cs
- ColumnMapCopier.cs
- ImageInfo.cs
- BaseCodePageEncoding.cs
- HtmlElementCollection.cs
- AppSettings.cs
- PeerNameResolver.cs
- AuthorizationRule.cs
- InstanceKeyCollisionException.cs
- TextAutomationPeer.cs
- SHA256.cs
- NavigationWindowAutomationPeer.cs
- SiteMapNodeItem.cs
- ResourceReader.cs
- NativeObjectSecurity.cs
- SubstitutionResponseElement.cs
- WebPartVerb.cs
- CompressedStack.cs
- Ray3DHitTestResult.cs
- SimplePropertyEntry.cs
- ResourceManagerWrapper.cs
- GridViewItemAutomationPeer.cs
- FixedHighlight.cs
- XmlHierarchyData.cs
- XmlArrayItemAttributes.cs
- ToolStripControlHost.cs
- BaseComponentEditor.cs
- Collection.cs
- InkSerializer.cs
- UnmanagedHandle.cs
- X509Chain.cs
- XmlSubtreeReader.cs
- SmtpReplyReaderFactory.cs
- ConfigurationHandlersInstallComponent.cs
- RestClientProxyHandler.cs
- SafeLocalMemHandle.cs
- MetabaseSettingsIis7.cs
- DbDataSourceEnumerator.cs
- DoWorkEventArgs.cs
- RegistryKey.cs
- SqlDataSourceCommandEventArgs.cs
- DBBindings.cs
- altserialization.cs
- StatusCommandUI.cs
- RowUpdatedEventArgs.cs
- ToolZone.cs