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
- WebConfigurationManager.cs
- XmlWriterDelegator.cs
- UdpDiscoveryEndpointProvider.cs
- XmlProcessingInstruction.cs
- ShaderEffect.cs
- RequiredFieldValidator.cs
- OptionUsage.cs
- TextMarkerSource.cs
- TcpHostedTransportConfiguration.cs
- DragStartedEventArgs.cs
- UrlMappingsModule.cs
- BehaviorEditorPart.cs
- DataListItemEventArgs.cs
- ImplicitInputBrush.cs
- TimerElapsedEvenArgs.cs
- XmlDownloadManager.cs
- DictionaryGlobals.cs
- Mappings.cs
- XmlChildEnumerator.cs
- PerformanceCountersElement.cs
- WebPartVerb.cs
- AdjustableArrowCap.cs
- CompositionAdorner.cs
- Symbol.cs
- UrlMappingCollection.cs
- RtfControls.cs
- ControlCollection.cs
- DispatcherHooks.cs
- TextTreeUndoUnit.cs
- UInt16Converter.cs
- ObjectQueryProvider.cs
- UpdateManifestForBrowserApplication.cs
- JapaneseLunisolarCalendar.cs
- XmlPropertyBag.cs
- EventManager.cs
- SecureUICommand.cs
- regiisutil.cs
- PerformanceCounterManager.cs
- MenuAdapter.cs
- ErrorInfoXmlDocument.cs
- DynamicFilter.cs
- IdentityModelDictionary.cs
- Section.cs
- AttributedMetaModel.cs
- CompilationUtil.cs
- MutexSecurity.cs
- DataSourceConverter.cs
- DataObjectAttribute.cs
- FacetChecker.cs
- PngBitmapDecoder.cs
- InputProcessorProfiles.cs
- XamlClipboardData.cs
- ScriptIgnoreAttribute.cs
- Animatable.cs
- ChtmlFormAdapter.cs
- BindingContext.cs
- Listener.cs
- SerializationHelper.cs
- UrlAuthFailedErrorFormatter.cs
- EntityDesignerDataSourceView.cs
- FrameworkPropertyMetadata.cs
- ProvidePropertyAttribute.cs
- DataColumnCollection.cs
- SqlServer2KCompatibilityAnnotation.cs
- ResourceReferenceKeyNotFoundException.cs
- XsltArgumentList.cs
- IgnorePropertiesAttribute.cs
- _LocalDataStore.cs
- InfoCardClaim.cs
- BodyGlyph.cs
- IisTraceListener.cs
- IDataContractSurrogate.cs
- DataBoundControlHelper.cs
- GC.cs
- HtmlHead.cs
- SqlDataSource.cs
- BindingObserver.cs
- TextEditorMouse.cs
- SecurityTokenResolver.cs
- DataPagerCommandEventArgs.cs
- System.Data.OracleClient_BID.cs
- FlowDocumentView.cs
- WsatServiceAddress.cs
- HttpResponseHeader.cs
- UntypedNullExpression.cs
- CompilationLock.cs
- WindowsListViewGroup.cs
- ByteStorage.cs
- TextEditorDragDrop.cs
- QueueProcessor.cs
- UnionExpr.cs
- ProjectionCamera.cs
- WhitespaceRule.cs
- SerializationHelper.cs
- OdbcConnectionFactory.cs
- GlobalizationAssembly.cs
- DataGridViewCellCancelEventArgs.cs
- CharUnicodeInfo.cs
- AssociatedControlConverter.cs
- ReflectionUtil.cs