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
- WebHeaderCollection.cs
- ItemType.cs
- NameTable.cs
- TypeNameConverter.cs
- Timeline.cs
- WebServiceData.cs
- CompilerGlobalScopeAttribute.cs
- HostExecutionContextManager.cs
- CookieProtection.cs
- Parsers.cs
- MultipleFilterMatchesException.cs
- HtmlInputHidden.cs
- DesignTimeSiteMapProvider.cs
- DebugControllerThread.cs
- HebrewCalendar.cs
- EntitySet.cs
- DataBindingList.cs
- ServiceElementCollection.cs
- EntityParameterCollection.cs
- DescendantQuery.cs
- ProgressBarAutomationPeer.cs
- DiscardableAttribute.cs
- ObjectDataSourceEventArgs.cs
- FunctionUpdateCommand.cs
- IdentitySection.cs
- MediaCommands.cs
- SupportingTokenProviderSpecification.cs
- MDIWindowDialog.cs
- SafeMarshalContext.cs
- RenderData.cs
- SelectionListComponentEditor.cs
- PreApplicationStartMethodAttribute.cs
- XsltSettings.cs
- IteratorFilter.cs
- TimeEnumHelper.cs
- DesignerGenericWebPart.cs
- ToolStripItemRenderEventArgs.cs
- Clipboard.cs
- MethodExpr.cs
- DateTimeValueSerializerContext.cs
- AxisAngleRotation3D.cs
- ServiceObjectContainer.cs
- Parallel.cs
- WinFormsSecurity.cs
- IsolatedStorageSecurityState.cs
- EmbeddedMailObjectsCollection.cs
- XmlBaseWriter.cs
- ParameterCollection.cs
- OdbcCommand.cs
- RegexCapture.cs
- UnorderedHashRepartitionStream.cs
- InvalidOleVariantTypeException.cs
- ExceptionRoutedEventArgs.cs
- _emptywebproxy.cs
- WebBaseEventKeyComparer.cs
- TimeEnumHelper.cs
- Transform3D.cs
- DataViewSettingCollection.cs
- LogManagementAsyncResult.cs
- UserNameSecurityToken.cs
- TrustLevelCollection.cs
- oledbmetadatacolumnnames.cs
- ServiceErrorHandler.cs
- EntityDataSourceChangingEventArgs.cs
- TimeZoneInfo.cs
- ObjectSet.cs
- ErrorHandlingAcceptor.cs
- ElementNotAvailableException.cs
- DispatchChannelSink.cs
- FlowLayoutSettings.cs
- EventLog.cs
- ListBoxItem.cs
- SqlMethodCallConverter.cs
- ContainerAction.cs
- CodeMemberEvent.cs
- DataGridToolTip.cs
- DeploymentSection.cs
- AcceptorSessionSymmetricTransportSecurityProtocol.cs
- DictionaryEditChange.cs
- XmlTextReaderImpl.cs
- BaseCollection.cs
- ActivatableWorkflowsQueryResult.cs
- PLINQETWProvider.cs
- ListViewEditEventArgs.cs
- ScopeCollection.cs
- StylusPointPropertyUnit.cs
- XmlNodeChangedEventArgs.cs
- TypeBuilder.cs
- PermissionToken.cs
- SqlAliaser.cs
- RoleBoolean.cs
- TreeViewItemAutomationPeer.cs
- CodeExpressionStatement.cs
- SAPICategories.cs
- EndpointReference.cs
- UserPersonalizationStateInfo.cs
- ButtonField.cs
- XmlNamespaceDeclarationsAttribute.cs
- Decoder.cs
- DisplayMemberTemplateSelector.cs