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
- DataGridHelper.cs
- WinEventWrap.cs
- HGlobalSafeHandle.cs
- HttpCacheParams.cs
- TextBoxBase.cs
- CheckBoxField.cs
- UriTemplateVariableQueryValue.cs
- ObjectStateFormatter.cs
- MessageBuilder.cs
- WindowsAltTab.cs
- SimpleBitVector32.cs
- mediaclock.cs
- WebPartVerbsEventArgs.cs
- Directory.cs
- IconHelper.cs
- ObsoleteAttribute.cs
- BrushMappingModeValidation.cs
- DBCommand.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- RegexInterpreter.cs
- NumberFunctions.cs
- MethodSignatureGenerator.cs
- CalculatedColumn.cs
- ArraySet.cs
- UpdateProgress.cs
- EdmToObjectNamespaceMap.cs
- SafeHandles.cs
- _ConnectStream.cs
- TextTreeNode.cs
- AutoCompleteStringCollection.cs
- LicenseException.cs
- Decoder.cs
- CodeMethodInvokeExpression.cs
- SelectionListComponentEditor.cs
- ADConnectionHelper.cs
- CompilationUtil.cs
- DependsOnAttribute.cs
- SettingsSavedEventArgs.cs
- RemotingConfigParser.cs
- CuspData.cs
- WebServiceEnumData.cs
- DiffuseMaterial.cs
- TabItemWrapperAutomationPeer.cs
- MenuItemStyleCollection.cs
- StateInitialization.cs
- MissingSatelliteAssemblyException.cs
- EnumBuilder.cs
- SqlUserDefinedAggregateAttribute.cs
- CodeMemberMethod.cs
- DecimalAnimationUsingKeyFrames.cs
- AccessControlEntry.cs
- EncoderParameter.cs
- TemplateField.cs
- OleTxTransactionInfo.cs
- MemberHolder.cs
- VScrollProperties.cs
- DoubleAnimationBase.cs
- DbMetaDataFactory.cs
- Clipboard.cs
- RecognizedAudio.cs
- Light.cs
- CompletedAsyncResult.cs
- ToolStripMenuItem.cs
- ReadWriteControlDesigner.cs
- QilLiteral.cs
- UIPermission.cs
- ZipFileInfoCollection.cs
- Literal.cs
- Identifier.cs
- XmlSchemaAttributeGroupRef.cs
- ZipIOLocalFileBlock.cs
- InstanceStore.cs
- EditorPartCollection.cs
- TextEndOfLine.cs
- BitmapSource.cs
- XPathDescendantIterator.cs
- AuthenticationModuleElement.cs
- NameValueFileSectionHandler.cs
- EpmCustomContentSerializer.cs
- FormsAuthenticationCredentials.cs
- FixedStringLookup.cs
- LayoutInformation.cs
- PriorityChain.cs
- SizeConverter.cs
- safesecurityhelperavalon.cs
- WindowInteropHelper.cs
- PolicyManager.cs
- HttpCookiesSection.cs
- RuleSetDialog.Designer.cs
- SqlError.cs
- FormatSelectingMessageInspector.cs
- MbpInfo.cs
- RandomDelaySendsAsyncResult.cs
- LinqDataSourceDisposeEventArgs.cs
- MobileUserControlDesigner.cs
- PointLight.cs
- AssemblyEvidenceFactory.cs
- ConfigurationSchemaErrors.cs
- NamedPipeChannelListener.cs
- ParsedAttributeCollection.cs