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
- UpdateRecord.cs
- SecurityTimestamp.cs
- DataListCommandEventArgs.cs
- TiffBitmapEncoder.cs
- SqlCacheDependencyDatabase.cs
- WebBrowserDocumentCompletedEventHandler.cs
- CodeDirectoryCompiler.cs
- EntitySetRetriever.cs
- XmlSchemaInferenceException.cs
- XmlSchemaValidationException.cs
- ObjectResult.cs
- WindowsScrollBarBits.cs
- SiteMap.cs
- BaseProcessProtocolHandler.cs
- MemberAccessException.cs
- KeySplineConverter.cs
- BaseResourcesBuildProvider.cs
- InputLanguageEventArgs.cs
- ValuePattern.cs
- ExceptionTrace.cs
- ProfileService.cs
- RuleRefElement.cs
- CompilerGeneratedAttribute.cs
- DebugView.cs
- SimpleHandlerFactory.cs
- EmptyStringExpandableObjectConverter.cs
- PrintingPermission.cs
- DecimalConstantAttribute.cs
- ObjectDisposedException.cs
- PipelineModuleStepContainer.cs
- MetabaseSettings.cs
- VectorConverter.cs
- CapabilitiesSection.cs
- HandledMouseEvent.cs
- RuntimeConfigLKG.cs
- NgenServicingAttributes.cs
- InvokePattern.cs
- wpf-etw.cs
- EmptyEnumerator.cs
- WorkflowItemPresenter.cs
- RemoveStoryboard.cs
- SQLBoolean.cs
- CacheVirtualItemsEvent.cs
- ConstructorNeedsTagAttribute.cs
- Debugger.cs
- UserMapPath.cs
- DataGridCell.cs
- ComponentFactoryHelpers.cs
- Message.cs
- ColorTypeConverter.cs
- TreeViewAutomationPeer.cs
- Helper.cs
- Rect.cs
- LocatorPartList.cs
- SqlNodeAnnotation.cs
- BufferedReadStream.cs
- DbParameterHelper.cs
- HashRepartitionStream.cs
- WindowsTab.cs
- MetadataException.cs
- MenuCommand.cs
- IntSumAggregationOperator.cs
- WebPartDescription.cs
- Mutex.cs
- PropertyPath.cs
- CodeLabeledStatement.cs
- LinkedList.cs
- NoClickablePointException.cs
- IdentityModelDictionary.cs
- TextParagraphCache.cs
- PeerIPHelper.cs
- TextCollapsingProperties.cs
- LocalizedNameDescriptionPair.cs
- XmlQuerySequence.cs
- AnnotationHighlightLayer.cs
- CreateUserWizardStep.cs
- CommandLineParser.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- ListViewPagedDataSource.cs
- DataSourceComponent.cs
- CancellationHandlerDesigner.cs
- RoutedCommand.cs
- RegexCharClass.cs
- NativeWrapper.cs
- ListBindableAttribute.cs
- WMICapabilities.cs
- UrlMappingsModule.cs
- RangeBase.cs
- ControlCodeDomSerializer.cs
- HttpListenerRequestTraceRecord.cs
- LinkedResource.cs
- Journal.cs
- SessionIDManager.cs
- CompoundFileStorageReference.cs
- PeerName.cs
- RequestCachingSection.cs
- BaseCodePageEncoding.cs
- ClockController.cs
- UserControlAutomationPeer.cs
- InvalidWMPVersionException.cs