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
- ObjectToIdCache.cs
- TrustManagerMoreInformation.cs
- DetailsViewRow.cs
- DataGridViewHitTestInfo.cs
- AdapterUtil.cs
- SiteMapDataSource.cs
- DataServiceQueryException.cs
- SiteMapPath.cs
- ChannelFactoryRefCache.cs
- SerialPinChanges.cs
- ParseNumbers.cs
- ToggleProviderWrapper.cs
- PermissionSetEnumerator.cs
- DataControlButton.cs
- DocumentViewerBaseAutomationPeer.cs
- FederatedMessageSecurityOverHttpElement.cs
- SqlCacheDependencyDatabaseCollection.cs
- DataSourceSelectArguments.cs
- SettingsBase.cs
- ButtonField.cs
- MsmqDecodeHelper.cs
- CreateRefExpr.cs
- EmbossBitmapEffect.cs
- SelectQueryOperator.cs
- DataGridViewAdvancedBorderStyle.cs
- FontCollection.cs
- ProofTokenCryptoHandle.cs
- DbException.cs
- ReadWriteObjectLock.cs
- RelationshipManager.cs
- SimpleApplicationHost.cs
- Point.cs
- ImpersonateTokenRef.cs
- UIElement3DAutomationPeer.cs
- EntityCollection.cs
- WebScriptEnablingElement.cs
- XmlCharacterData.cs
- OutputCacheSettingsSection.cs
- HashStream.cs
- WebException.cs
- OverflowException.cs
- AsyncStreamReader.cs
- ChtmlPhoneCallAdapter.cs
- X509Chain.cs
- MobileCategoryAttribute.cs
- HebrewCalendar.cs
- BamlRecordReader.cs
- QueryContinueDragEventArgs.cs
- PlatformCulture.cs
- Function.cs
- IsolatedStorage.cs
- RelationshipFixer.cs
- MembershipUser.cs
- WebHttpEndpoint.cs
- DesignerOptionService.cs
- DeploymentSection.cs
- Select.cs
- GlyphRun.cs
- WebHttpBindingElement.cs
- DocumentViewer.cs
- IndexedString.cs
- ElementNotEnabledException.cs
- X509CertificateValidationMode.cs
- PackageDocument.cs
- XmlILStorageConverter.cs
- RootBuilder.cs
- IteratorDescriptor.cs
- ProviderBase.cs
- PixelFormatConverter.cs
- IfAction.cs
- ServiceProviders.cs
- ControlEvent.cs
- LinqDataSourceEditData.cs
- OleDbEnumerator.cs
- FunctionQuery.cs
- _ConnectStream.cs
- InputScope.cs
- HostProtectionPermission.cs
- MenuStrip.cs
- SessionStateContainer.cs
- MetadataConversionError.cs
- DeclarativeCatalogPart.cs
- BrowserCapabilitiesCodeGenerator.cs
- MsdtcClusterUtils.cs
- CodeChecksumPragma.cs
- WpfSharedXamlSchemaContext.cs
- MenuEventArgs.cs
- SqlUdtInfo.cs
- _HTTPDateParse.cs
- DesignerOptionService.cs
- _LoggingObject.cs
- PageMediaSize.cs
- EventMappingSettingsCollection.cs
- WsatServiceCertificate.cs
- MdiWindowListStrip.cs
- JournalEntry.cs
- DynamicILGenerator.cs
- SqlDataSourceConfigureFilterForm.cs
- EditorPart.cs
- MimePart.cs