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
- X509RecipientCertificateClientElement.cs
- CoreSwitches.cs
- CollectionViewGroup.cs
- JsonClassDataContract.cs
- ListViewInsertEventArgs.cs
- MasterPage.cs
- followingquery.cs
- ReachPrintTicketSerializer.cs
- DynamicDiscoSearcher.cs
- EncryptRequest.cs
- WindowsScroll.cs
- QilList.cs
- SchemaElementDecl.cs
- IProvider.cs
- ImageButton.cs
- BrushConverter.cs
- AppDomainProtocolHandler.cs
- SpecularMaterial.cs
- RuntimeIdentifierPropertyAttribute.cs
- AlternateViewCollection.cs
- ProcessRequestArgs.cs
- ValidatorCollection.cs
- FontSizeConverter.cs
- CodeComment.cs
- HtmlElement.cs
- IQueryable.cs
- RealizationDrawingContextWalker.cs
- ConfigXmlElement.cs
- XmlSchemaCollection.cs
- MouseDevice.cs
- DetailsViewInsertEventArgs.cs
- ComplexTypeEmitter.cs
- XmlSchemaSet.cs
- TypeReference.cs
- BitVector32.cs
- UrlUtility.cs
- NestPullup.cs
- RuleSet.cs
- PerfService.cs
- wgx_sdk_version.cs
- XamlStyleSerializer.cs
- IPipelineRuntime.cs
- CipherData.cs
- EventMappingSettingsCollection.cs
- MultipartIdentifier.cs
- MarshalByValueComponent.cs
- IdnElement.cs
- Point4DConverter.cs
- SpecialFolderEnumConverter.cs
- Form.cs
- Interlocked.cs
- PreservationFileReader.cs
- HttpServerUtilityBase.cs
- RegisteredHiddenField.cs
- InstanceKeyView.cs
- VerificationAttribute.cs
- _NtlmClient.cs
- StrokeCollectionDefaultValueFactory.cs
- StrongNameUtility.cs
- InvalidComObjectException.cs
- DurableOperationContext.cs
- RoutedEventValueSerializer.cs
- StrokeCollectionDefaultValueFactory.cs
- DependencyObject.cs
- InputReport.cs
- WebServiceResponse.cs
- RemoveStoryboard.cs
- TypeElement.cs
- InputScopeConverter.cs
- CursorConverter.cs
- DesignerAttribute.cs
- PrivilegeNotHeldException.cs
- TextTreeExtractElementUndoUnit.cs
- HttpResponseBase.cs
- ParagraphResult.cs
- MetricEntry.cs
- SQLDoubleStorage.cs
- IListConverters.cs
- FontStyle.cs
- DispatcherOperation.cs
- ObjectListGeneralPage.cs
- PeerApplicationLaunchInfo.cs
- SoapServerMethod.cs
- BaseCodeDomTreeGenerator.cs
- FullTextBreakpoint.cs
- XmlWriterDelegator.cs
- SystemWebCachingSectionGroup.cs
- ComplexLine.cs
- HttpSysSettings.cs
- SQLConvert.cs
- Tokenizer.cs
- CompositeCollectionView.cs
- XmlTextEncoder.cs
- IndexedEnumerable.cs
- EditCommandColumn.cs
- WebPartExportVerb.cs
- CatalogPartCollection.cs
- RtfControls.cs
- GenericWebPart.cs
- BitmapEncoder.cs