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
- Input.cs
- X509KeyIdentifierClauseType.cs
- CryptographicAttribute.cs
- ExternalCalls.cs
- PreviewPrintController.cs
- SystemColors.cs
- OleDbDataReader.cs
- DefaultAssemblyResolver.cs
- MenuScrollingVisibilityConverter.cs
- TextSelectionProcessor.cs
- shaperfactoryquerycacheentry.cs
- InvalidDataException.cs
- RemotingService.cs
- ObfuscationAttribute.cs
- EdmConstants.cs
- TextBoxDesigner.cs
- SqlDataSourceConfigureSortForm.cs
- TreeNodeClickEventArgs.cs
- PolyLineSegment.cs
- InternalConfigSettingsFactory.cs
- TimeSpanOrInfiniteConverter.cs
- PreservationFileWriter.cs
- SamlConditions.cs
- Triangle.cs
- HttpListenerRequest.cs
- ClientSettings.cs
- __Error.cs
- XmlAnyElementAttributes.cs
- CriticalExceptions.cs
- safelinkcollection.cs
- IndentTextWriter.cs
- XmlSecureResolver.cs
- SiteMapPath.cs
- ForEachAction.cs
- IsolatedStorageFilePermission.cs
- Parser.cs
- PerformanceCounterManager.cs
- Filter.cs
- ForEachDesigner.xaml.cs
- SqlStatistics.cs
- WindowManager.cs
- SemanticBasicElement.cs
- XMLSyntaxException.cs
- ToolStripPanelRenderEventArgs.cs
- FixedFindEngine.cs
- InvalidComObjectException.cs
- StatusBarItem.cs
- Journaling.cs
- DataColumnPropertyDescriptor.cs
- BrowserTree.cs
- FileInfo.cs
- NumericPagerField.cs
- OperationValidationEventArgs.cs
- NameValueCollection.cs
- DataRecord.cs
- Popup.cs
- ProcessProtocolHandler.cs
- GPPOINTF.cs
- UnmanagedHandle.cs
- RSAPKCS1SignatureFormatter.cs
- ManipulationStartedEventArgs.cs
- __Filters.cs
- AssemblyHash.cs
- WebPartConnectionCollection.cs
- HtmlLabelAdapter.cs
- IntSecurity.cs
- FileDialogCustomPlacesCollection.cs
- GridViewDeletedEventArgs.cs
- WindowsBrush.cs
- MappingException.cs
- XAMLParseException.cs
- InputBindingCollection.cs
- ListViewDataItem.cs
- ArraySubsetEnumerator.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- ListBoxItemWrapperAutomationPeer.cs
- ListItemCollection.cs
- XmlSchemaAll.cs
- XmlSchemaSimpleTypeList.cs
- COM2TypeInfoProcessor.cs
- GridLength.cs
- XamlUtilities.cs
- RoleBoolean.cs
- GeometryCollection.cs
- DataTablePropertyDescriptor.cs
- HttpRequestCacheValidator.cs
- FontStyleConverter.cs
- ToolStripCustomTypeDescriptor.cs
- PassportPrincipal.cs
- TextDecoration.cs
- odbcmetadatacolumnnames.cs
- ClientBuildManager.cs
- PropertyItemInternal.cs
- PackageRelationship.cs
- ToolStripInSituService.cs
- JournalEntryListConverter.cs
- AuthStoreRoleProvider.cs
- SiteMapHierarchicalDataSourceView.cs
- DispatchRuntime.cs
- storepermission.cs