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
- CompoundFileIOPermission.cs
- Splitter.cs
- MediaScriptCommandRoutedEventArgs.cs
- DesignerDataSchemaClass.cs
- KeyedByTypeCollection.cs
- DataRecordInfo.cs
- EventRoute.cs
- DependencyPropertyDescriptor.cs
- DesignTimeTemplateParser.cs
- XmlCharCheckingReader.cs
- PtsHelper.cs
- OutOfMemoryException.cs
- HttpChannelBindingToken.cs
- CrossContextChannel.cs
- DbConnectionInternal.cs
- BindingContext.cs
- TabItemWrapperAutomationPeer.cs
- PropertyEmitter.cs
- BitmapEffectDrawing.cs
- CheckBoxList.cs
- OdbcCommand.cs
- OperationResponse.cs
- EncryptedXml.cs
- RectKeyFrameCollection.cs
- MultilineStringEditor.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- MSAAEventDispatcher.cs
- Win32.cs
- XmlNamespaceDeclarationsAttribute.cs
- InheritablePropertyChangeInfo.cs
- DragAssistanceManager.cs
- CachedRequestParams.cs
- TypeListConverter.cs
- COSERVERINFO.cs
- BinaryOperationBinder.cs
- unitconverter.cs
- CustomAttributeBuilder.cs
- DirectoryInfo.cs
- OleDbDataAdapter.cs
- PrimitiveCodeDomSerializer.cs
- CqlParserHelpers.cs
- ColorConvertedBitmapExtension.cs
- PointAnimationUsingPath.cs
- PseudoWebRequest.cs
- ApplicationId.cs
- CollectionViewSource.cs
- PointAnimationClockResource.cs
- DataGridViewRowHeaderCell.cs
- XPathDocumentBuilder.cs
- MatchAttribute.cs
- CollectionView.cs
- EntityViewGenerationAttribute.cs
- ImportCatalogPart.cs
- DataGridViewBand.cs
- OdbcInfoMessageEvent.cs
- MaskedTextProvider.cs
- BamlTreeNode.cs
- TcpConnectionPoolSettings.cs
- ImageAutomationPeer.cs
- MonthChangedEventArgs.cs
- ValueUtilsSmi.cs
- BookmarkInfo.cs
- ClaimTypeRequirement.cs
- DBConcurrencyException.cs
- TreeNodeConverter.cs
- ParameterCollection.cs
- WebPartDescriptionCollection.cs
- ConfigurationFileMap.cs
- NavigationEventArgs.cs
- XmlDataSource.cs
- Size3DValueSerializer.cs
- Peer.cs
- GradientStopCollection.cs
- ActiveXSite.cs
- TargetParameterCountException.cs
- XmlSerializationGeneratedCode.cs
- ImageEditor.cs
- SkewTransform.cs
- DirectoryInfo.cs
- BuildResult.cs
- Inline.cs
- RequestCacheManager.cs
- _emptywebproxy.cs
- TraceContextEventArgs.cs
- StateBag.cs
- WebResourceUtil.cs
- BitmapEffect.cs
- Types.cs
- UndoUnit.cs
- Native.cs
- BitmapEffectvisualstate.cs
- IIS7UserPrincipal.cs
- LateBoundBitmapDecoder.cs
- HttpCachePolicyElement.cs
- CompoundFileStreamReference.cs
- SharedStatics.cs
- WebServiceData.cs
- ProfilePropertyMetadata.cs
- ObjectDataSourceEventArgs.cs
- Closure.cs