Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / CopyAction.cs / 1 / CopyAction.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.Diagnostics; using System.Xml; using System.Xml.XPath; using MS.Internal.Xml.XPath; internal class CopyAction : ContainerAction { // Local execution states private const int CopyText = 4; private const int NamespaceCopy = 5; private const int ContentsCopy = 6; private const int ProcessChildren = 7; private const int ChildrenOnly = 8; private string useAttributeSets; private bool empty; internal override void Compile(Compiler compiler) { CompileAttributes(compiler); if (compiler.Recurse()) { CompileTemplate(compiler); compiler.ToParent(); } if (this.containedActions == null) this.empty = true; } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Keywords.Equals(name, compiler.Atoms.UseAttributeSets)) { this.useAttributeSets = value; AddAction(compiler.CreateUseAttributeSetsAction()); } else { return false; } return true; } internal override void Execute(Processor processor, ActionFrame frame) { Debug.Assert(processor != null && frame != null); while (processor.CanContinue) { switch (frame.State) { case Initialized: if (Processor.IsRoot(frame.Node)) { processor.PushActionFrame(frame); frame.State = ChildrenOnly; break; } if (processor.CopyBeginEvent(frame.Node, this.empty) == false) { // This event wasn't processed break; } frame.State = NamespaceCopy; continue; case NamespaceCopy: frame.State = ContentsCopy; if ( frame.Node.NodeType == XPathNodeType.Element ) { processor.PushActionFrame(CopyNamespacesAction.GetAction(), frame.NodeSet); break; } continue; case ContentsCopy: if (frame.Node.NodeType == XPathNodeType.Element && !this.empty) { //Debug.Assert(frame.Node.HasValue == false); processor.PushActionFrame(frame); frame.State = ProcessChildren; break; } else { if (processor.CopyTextEvent(frame.Node)) { frame.State = ProcessChildren; continue; } else { // This event wasn't processed break; } } case ProcessChildren: if (processor.CopyEndEvent(frame.Node)) { frame.Finished(); } break; case ChildrenOnly: frame.Finished(); break; default: Debug.Fail("Invalid CopyAction execution state"); break; } 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.Diagnostics; using System.Xml; using System.Xml.XPath; using MS.Internal.Xml.XPath; internal class CopyAction : ContainerAction { // Local execution states private const int CopyText = 4; private const int NamespaceCopy = 5; private const int ContentsCopy = 6; private const int ProcessChildren = 7; private const int ChildrenOnly = 8; private string useAttributeSets; private bool empty; internal override void Compile(Compiler compiler) { CompileAttributes(compiler); if (compiler.Recurse()) { CompileTemplate(compiler); compiler.ToParent(); } if (this.containedActions == null) this.empty = true; } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Keywords.Equals(name, compiler.Atoms.UseAttributeSets)) { this.useAttributeSets = value; AddAction(compiler.CreateUseAttributeSetsAction()); } else { return false; } return true; } internal override void Execute(Processor processor, ActionFrame frame) { Debug.Assert(processor != null && frame != null); while (processor.CanContinue) { switch (frame.State) { case Initialized: if (Processor.IsRoot(frame.Node)) { processor.PushActionFrame(frame); frame.State = ChildrenOnly; break; } if (processor.CopyBeginEvent(frame.Node, this.empty) == false) { // This event wasn't processed break; } frame.State = NamespaceCopy; continue; case NamespaceCopy: frame.State = ContentsCopy; if ( frame.Node.NodeType == XPathNodeType.Element ) { processor.PushActionFrame(CopyNamespacesAction.GetAction(), frame.NodeSet); break; } continue; case ContentsCopy: if (frame.Node.NodeType == XPathNodeType.Element && !this.empty) { //Debug.Assert(frame.Node.HasValue == false); processor.PushActionFrame(frame); frame.State = ProcessChildren; break; } else { if (processor.CopyTextEvent(frame.Node)) { frame.State = ProcessChildren; continue; } else { // This event wasn't processed break; } } case ProcessChildren: if (processor.CopyEndEvent(frame.Node)) { frame.Finished(); } break; case ChildrenOnly: frame.Finished(); break; default: Debug.Fail("Invalid CopyAction execution state"); break; } 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
- EditingScopeUndoUnit.cs
- IPGlobalProperties.cs
- FieldToken.cs
- ConfigurationUtility.cs
- UnaryExpression.cs
- DiscoveryMessageProperty.cs
- PolyLineSegment.cs
- ProviderCommandInfoUtils.cs
- EntityDataSourceContainerNameItem.cs
- Cursor.cs
- DeclaredTypeElementCollection.cs
- DbParameterCollectionHelper.cs
- TraceHwndHost.cs
- TableCell.cs
- DockAndAnchorLayout.cs
- SmtpFailedRecipientException.cs
- WorkflowApplicationIdleEventArgs.cs
- HwndSource.cs
- DirectoryNotFoundException.cs
- HighlightComponent.cs
- FreezableDefaultValueFactory.cs
- LogWriteRestartAreaAsyncResult.cs
- MemberHolder.cs
- SortExpressionBuilder.cs
- DbException.cs
- HashMembershipCondition.cs
- XPathSingletonIterator.cs
- MembershipUser.cs
- HyperLinkDesigner.cs
- DefaultWorkflowTransactionService.cs
- UICuesEvent.cs
- PaintEvent.cs
- CookielessHelper.cs
- WindowCollection.cs
- ObjectNotFoundException.cs
- SynchronousSendBindingElement.cs
- RelationshipDetailsCollection.cs
- DbConnectionPoolGroup.cs
- HtmlHistory.cs
- HebrewNumber.cs
- CompleteWizardStep.cs
- XPathException.cs
- CodeSnippetStatement.cs
- GridErrorDlg.cs
- SystemGatewayIPAddressInformation.cs
- ToolZone.cs
- ColumnBinding.cs
- TargetControlTypeAttribute.cs
- SpeechAudioFormatInfo.cs
- Matrix.cs
- FixedSOMTable.cs
- ElementInit.cs
- ColorMap.cs
- LineServicesCallbacks.cs
- HttpCapabilitiesEvaluator.cs
- basecomparevalidator.cs
- TemplatePropertyEntry.cs
- TrackingDataItem.cs
- RelationshipEndCollection.cs
- ConditionalBranch.cs
- XmlNamespaceManager.cs
- XmlQueryType.cs
- Encoding.cs
- DelegateTypeInfo.cs
- GenerateTemporaryTargetAssembly.cs
- BrowserCapabilitiesFactoryBase.cs
- ColorDialog.cs
- ErrorEventArgs.cs
- PrinterResolution.cs
- ClientFormsIdentity.cs
- AnnotationMap.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- DbParameterCollectionHelper.cs
- SqlPersonalizationProvider.cs
- ScaleTransform3D.cs
- LabelExpression.cs
- WorkItem.cs
- TemplateModeChangedEventArgs.cs
- _SslState.cs
- DbConnectionStringBuilder.cs
- OleDbConnectionFactory.cs
- QuotedPrintableStream.cs
- dsa.cs
- DropDownList.cs
- KnownTypes.cs
- RenderTargetBitmap.cs
- Int64AnimationBase.cs
- SqlOuterApplyReducer.cs
- FirstMatchCodeGroup.cs
- DictionaryContent.cs
- StrokeDescriptor.cs
- HttpWriter.cs
- DbDataReader.cs
- Renderer.cs
- HtmlControlDesigner.cs
- _HelperAsyncResults.cs
- ping.cs
- XmlnsDefinitionAttribute.cs
- DataGridViewCellFormattingEventArgs.cs
- ImpersonateTokenRef.cs