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
- COM2PropertyBuilderUITypeEditor.cs
- XmlAttributeAttribute.cs
- ProjectionPath.cs
- SecUtil.cs
- DesignerLoader.cs
- ArgumentValidation.cs
- CompoundFileStreamReference.cs
- SqlDataSourceCustomCommandEditor.cs
- NativeRecognizer.cs
- CertificateManager.cs
- TextEditor.cs
- ShaperBuffers.cs
- SQLInt64.cs
- IdentityModelStringsVersion1.cs
- AccessKeyManager.cs
- PassportAuthenticationModule.cs
- AppDomainManager.cs
- CommandValueSerializer.cs
- AppDomainManager.cs
- SchemaSetCompiler.cs
- _ServiceNameStore.cs
- DynamicMetaObjectBinder.cs
- ColumnCollectionEditor.cs
- XmlSchemaGroupRef.cs
- TagNameToTypeMapper.cs
- CodeExpressionRuleDeclaration.cs
- HtmlTernaryTree.cs
- SimpleType.cs
- PixelFormatConverter.cs
- WorkflowMarkupSerializationException.cs
- WsdlInspector.cs
- AuthorizationRule.cs
- HtmlInputButton.cs
- BuildManager.cs
- HtmlFormParameterWriter.cs
- ImmutableCollection.cs
- DesignerAutoFormatStyle.cs
- DataGridItemEventArgs.cs
- _TimerThread.cs
- BulletedList.cs
- TableProvider.cs
- CallbackValidator.cs
- RegisteredHiddenField.cs
- WebBrowserProgressChangedEventHandler.cs
- PageBuildProvider.cs
- Substitution.cs
- AmbiguousMatchException.cs
- DbConnectionPoolGroupProviderInfo.cs
- DbExpressionVisitor.cs
- HideDisabledControlAdapter.cs
- ValidationPropertyAttribute.cs
- XmlAnyElementAttributes.cs
- SystemIcons.cs
- serverconfig.cs
- PersonalizationStateInfo.cs
- ScriptReferenceEventArgs.cs
- loginstatus.cs
- COM2ICategorizePropertiesHandler.cs
- OdbcRowUpdatingEvent.cs
- DataGridViewCellStyleConverter.cs
- RangeValueProviderWrapper.cs
- DeploymentExceptionMapper.cs
- XXXOnTypeBuilderInstantiation.cs
- HeaderCollection.cs
- CapacityStreamGeometryContext.cs
- Point3DCollection.cs
- FormView.cs
- MouseButtonEventArgs.cs
- PriorityBinding.cs
- HttpHandlersSection.cs
- ProfileSettingsCollection.cs
- ObjectParameter.cs
- TempEnvironment.cs
- AttributedMetaModel.cs
- SqlCommandSet.cs
- WeakReferenceKey.cs
- MulticastNotSupportedException.cs
- ConfigurationStrings.cs
- NumberSubstitution.cs
- CustomWebEventKey.cs
- MeshGeometry3D.cs
- DefaultEvaluationContext.cs
- QueryStringParameter.cs
- TableColumn.cs
- LoadedOrUnloadedOperation.cs
- RemoteCryptoRsaServiceProvider.cs
- EdmScalarPropertyAttribute.cs
- Double.cs
- MembershipSection.cs
- OleDbPropertySetGuid.cs
- AutoScrollHelper.cs
- WebRequestModuleElement.cs
- MaskedTextBox.cs
- SecurityDescriptor.cs
- DesignerTransaction.cs
- DynamicFilter.cs
- SafeRightsManagementPubHandle.cs
- PrivilegeNotHeldException.cs
- FontStyles.cs
- RenderTargetBitmap.cs