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
- ElementNotAvailableException.cs
- WindowsStatic.cs
- CqlParser.cs
- InputLanguage.cs
- RectKeyFrameCollection.cs
- ControlBuilderAttribute.cs
- WorkflowMessageEventArgs.cs
- ResolveMatchesMessage11.cs
- NumberSubstitution.cs
- SymLanguageVendor.cs
- ConfigurationManagerInternal.cs
- safex509handles.cs
- WindowsComboBox.cs
- WebPartCollection.cs
- PageHandlerFactory.cs
- ControlFilterExpression.cs
- CodeSnippetCompileUnit.cs
- CompressEmulationStream.cs
- RoamingStoreFileUtility.cs
- SafeArrayRankMismatchException.cs
- InternalDuplexBindingElement.cs
- ExpressionNormalizer.cs
- Subtree.cs
- httpstaticobjectscollection.cs
- ActivityDesigner.cs
- Page.cs
- Thumb.cs
- VariableQuery.cs
- SqlBuffer.cs
- RegexCode.cs
- PageSetupDialog.cs
- TableRow.cs
- StsCommunicationException.cs
- IdleTimeoutMonitor.cs
- HMAC.cs
- TdsParameterSetter.cs
- UInt64Converter.cs
- ContextMenuStrip.cs
- TableLayoutPanel.cs
- DataGridViewDesigner.cs
- ApplicationDirectory.cs
- Int64Converter.cs
- AsymmetricAlgorithm.cs
- SettingsPropertyWrongTypeException.cs
- WinEventHandler.cs
- HtmlElementCollection.cs
- FileFormatException.cs
- DockProviderWrapper.cs
- TextServicesCompartmentContext.cs
- SafeArrayTypeMismatchException.cs
- DataGridViewCellStateChangedEventArgs.cs
- MetabaseSettings.cs
- WebResourceAttribute.cs
- MetaType.cs
- WasHostedComPlusFactory.cs
- DoubleAnimation.cs
- SspiSecurityToken.cs
- SvcMapFile.cs
- SqlMethodAttribute.cs
- UnrecognizedPolicyAssertionElement.cs
- FacetChecker.cs
- HttpClientChannel.cs
- ExpressionCopier.cs
- indexingfiltermarshaler.cs
- ListItemCollection.cs
- TransportSecurityProtocolFactory.cs
- AnnotationHighlightLayer.cs
- SqlFormatter.cs
- DataGridViewTextBoxColumn.cs
- RadioButtonList.cs
- Control.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- WebSysDefaultValueAttribute.cs
- InstanceHandleConflictException.cs
- NamedPermissionSet.cs
- DbgCompiler.cs
- AutoGeneratedFieldProperties.cs
- CharEnumerator.cs
- CodeTypeDeclaration.cs
- CalendarAutoFormatDialog.cs
- FacetEnabledSchemaElement.cs
- MatchAllMessageFilter.cs
- StaticContext.cs
- TraceFilter.cs
- Choices.cs
- SortKey.cs
- MissingManifestResourceException.cs
- TakeOrSkipQueryOperator.cs
- LayoutSettings.cs
- Hash.cs
- Automation.cs
- Padding.cs
- EventSourceCreationData.cs
- NumberEdit.cs
- XamlClipboardData.cs
- TTSEngineTypes.cs
- StrokeCollection2.cs
- WorkflowTerminatedException.cs
- AlignmentYValidation.cs
- TypefaceMetricsCache.cs