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
- AuthenticateEventArgs.cs
- RangeExpression.cs
- AutoGeneratedFieldProperties.cs
- UnitySerializationHolder.cs
- ToolStripSeparator.cs
- XmlSerializableServices.cs
- SystemResources.cs
- RuleRefElement.cs
- SimpleBitVector32.cs
- Paragraph.cs
- HandlerBase.cs
- WorkflowOperationFault.cs
- InstanceHandleReference.cs
- TransactionFilter.cs
- HuffModule.cs
- HostProtectionException.cs
- XPathDocumentNavigator.cs
- DecoderReplacementFallback.cs
- ClrPerspective.cs
- WindowsComboBox.cs
- ExcCanonicalXml.cs
- OperationAbortedException.cs
- LineServices.cs
- NetSectionGroup.cs
- CachedPathData.cs
- Intellisense.cs
- IDictionary.cs
- ThicknessAnimation.cs
- BuildProvidersCompiler.cs
- DataSourceGroupCollection.cs
- CompositeScriptReferenceEventArgs.cs
- ControlUtil.cs
- Model3DCollection.cs
- CodeDelegateInvokeExpression.cs
- SqlBooleanizer.cs
- AddressHeader.cs
- StrongName.cs
- CollectionTypeElement.cs
- UpdateProgress.cs
- InfoCardBaseException.cs
- GenericAuthenticationEventArgs.cs
- FontResourceCache.cs
- SiteIdentityPermission.cs
- SQLBoolean.cs
- PermissionAttributes.cs
- AQNBuilder.cs
- DataViewManager.cs
- PropertyValueUIItem.cs
- DataListItemEventArgs.cs
- ObjectStateManagerMetadata.cs
- ResetableIterator.cs
- WebPartChrome.cs
- GridViewEditEventArgs.cs
- XmlnsCache.cs
- DeleteIndexBinder.cs
- RepeaterItemCollection.cs
- ButtonPopupAdapter.cs
- RoleServiceManager.cs
- EditorPartCollection.cs
- XamlSerializerUtil.cs
- AnimationClockResource.cs
- Expr.cs
- xamlnodes.cs
- DependencyObjectType.cs
- XdrBuilder.cs
- LoginCancelEventArgs.cs
- MDIClient.cs
- AxHost.cs
- PrintPageEvent.cs
- RequestQueryProcessor.cs
- OleDbRowUpdatedEvent.cs
- cryptoapiTransform.cs
- DeobfuscatingStream.cs
- Win32Native.cs
- EncoderBestFitFallback.cs
- ObjectDataSourceWizardForm.cs
- Byte.cs
- SchemaElementDecl.cs
- ScopedMessagePartSpecification.cs
- basemetadatamappingvisitor.cs
- SmtpDigestAuthenticationModule.cs
- PreservationFileReader.cs
- CodeDOMUtility.cs
- precedingsibling.cs
- ExitEventArgs.cs
- StandardBindingElement.cs
- TableItemStyle.cs
- StaticExtensionConverter.cs
- BrowserCapabilitiesCodeGenerator.cs
- TextFormatter.cs
- EndpointDiscoveryMetadataCD1.cs
- XmlSecureResolver.cs
- PackWebResponse.cs
- SessionStateUtil.cs
- BasePropertyDescriptor.cs
- ApplicationManager.cs
- PropertyNames.cs
- DataSourceNameHandler.cs
- BitmapMetadata.cs
- DBCommandBuilder.cs