Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / UseAttributeSetsAction.cs / 1305376 / UseAttributeSetsAction.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 System.Collections; internal class UseAttributeSetsAction : CompiledAction { private XmlQualifiedName[] useAttributeSets; private string useString; private const int ProcessingSets = 2; internal XmlQualifiedName[] UsedSets { get { return this.useAttributeSets; } } internal override void Compile(Compiler compiler) { Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets)); this.useString = compiler.Input.Value; Debug.Assert(this.useAttributeSets == null); if (this.useString.Length == 0) { // Split creates empty node is spliting empty string this.useAttributeSets = new XmlQualifiedName[0]; return; } string[] qnames = XmlConvert.SplitString(this.useString); try { this.useAttributeSets = new XmlQualifiedName[qnames.Length]; { for (int i = 0; i < qnames.Length; i++) { this.useAttributeSets[i] = compiler.CreateXPathQName(qnames[i]); } } } catch (XsltException) { if (!compiler.ForwardCompatibility) { // Rethrow the exception if we're not in forwards-compatible mode throw; } // Ignore the whole list in forwards-compatible mode this.useAttributeSets = new XmlQualifiedName[0]; } } internal override void Execute(Processor processor, ActionFrame frame) { switch(frame.State) { case Initialized: frame.Counter = 0; frame.State = ProcessingSets; goto case ProcessingSets; case ProcessingSets: if (frame.Counter < this.useAttributeSets.Length) { AttributeSetAction action = processor.RootAction.GetAttributeSet(this.useAttributeSets[frame.Counter]); frame.IncrementCounter(); processor.PushActionFrame(action, frame.NodeSet); } else { frame.Finished(); } break; default: Debug.Fail("Invalid Container action 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.Diagnostics; using System.Xml; using System.Xml.XPath; using System.Collections; internal class UseAttributeSetsAction : CompiledAction { private XmlQualifiedName[] useAttributeSets; private string useString; private const int ProcessingSets = 2; internal XmlQualifiedName[] UsedSets { get { return this.useAttributeSets; } } internal override void Compile(Compiler compiler) { Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets)); this.useString = compiler.Input.Value; Debug.Assert(this.useAttributeSets == null); if (this.useString.Length == 0) { // Split creates empty node is spliting empty string this.useAttributeSets = new XmlQualifiedName[0]; return; } string[] qnames = XmlConvert.SplitString(this.useString); try { this.useAttributeSets = new XmlQualifiedName[qnames.Length]; { for (int i = 0; i < qnames.Length; i++) { this.useAttributeSets[i] = compiler.CreateXPathQName(qnames[i]); } } } catch (XsltException) { if (!compiler.ForwardCompatibility) { // Rethrow the exception if we're not in forwards-compatible mode throw; } // Ignore the whole list in forwards-compatible mode this.useAttributeSets = new XmlQualifiedName[0]; } } internal override void Execute(Processor processor, ActionFrame frame) { switch(frame.State) { case Initialized: frame.Counter = 0; frame.State = ProcessingSets; goto case ProcessingSets; case ProcessingSets: if (frame.Counter < this.useAttributeSets.Length) { AttributeSetAction action = processor.RootAction.GetAttributeSet(this.useAttributeSets[frame.Counter]); frame.IncrementCounter(); processor.PushActionFrame(action, frame.NodeSet); } else { frame.Finished(); } break; default: Debug.Fail("Invalid Container action 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
- TextElementEnumerator.cs
- CoreSwitches.cs
- DiagnosticsConfiguration.cs
- PointCollection.cs
- XmlReaderDelegator.cs
- PackWebResponse.cs
- RuleInfoComparer.cs
- ConfigurationSectionGroup.cs
- MessageHeaders.cs
- XPathQilFactory.cs
- _ListenerAsyncResult.cs
- HierarchicalDataSourceControl.cs
- SoapConverter.cs
- ComboBoxDesigner.cs
- KeyGesture.cs
- X509CertificateCollection.cs
- TextProviderWrapper.cs
- _FtpDataStream.cs
- _ConnectStream.cs
- autovalidator.cs
- DecoderReplacementFallback.cs
- RecognizedWordUnit.cs
- CodePageUtils.cs
- SoapInteropTypes.cs
- XmlAttributes.cs
- SafeReversePInvokeHandle.cs
- SystemIPv6InterfaceProperties.cs
- FreezableCollection.cs
- JournalEntry.cs
- SpeechRecognizer.cs
- ProxyManager.cs
- UpdatePanelTriggerCollection.cs
- DataColumnPropertyDescriptor.cs
- ConditionChanges.cs
- DesignerRegionCollection.cs
- followingquery.cs
- FontWeight.cs
- PeerService.cs
- ToolStripDropTargetManager.cs
- SqlDataSourceFilteringEventArgs.cs
- EditableTreeList.cs
- SharedPersonalizationStateInfo.cs
- UnSafeCharBuffer.cs
- PeerNearMe.cs
- InputMethodStateChangeEventArgs.cs
- SkipStoryboardToFill.cs
- ExpressionEditorAttribute.cs
- XmlComplianceUtil.cs
- OdbcParameter.cs
- Wildcard.cs
- PackWebResponse.cs
- FileDataSourceCache.cs
- DropShadowBitmapEffect.cs
- TraceSwitch.cs
- Timer.cs
- FormViewPagerRow.cs
- ProxyWebPart.cs
- ConnectionModeReader.cs
- XmlSubtreeReader.cs
- IndependentAnimationStorage.cs
- PropertyToken.cs
- RoleManagerSection.cs
- SqlRowUpdatingEvent.cs
- FilterQueryOptionExpression.cs
- PnrpPermission.cs
- PrivilegeNotHeldException.cs
- ViewManagerAttribute.cs
- IncrementalCompileAnalyzer.cs
- Block.cs
- ScrollChangedEventArgs.cs
- DiscoveryViaBehavior.cs
- BaseParser.cs
- DataGridItemEventArgs.cs
- MimeFormReflector.cs
- PerSessionInstanceContextProvider.cs
- dbdatarecord.cs
- ParameterBuilder.cs
- DefaultSection.cs
- SQLBytes.cs
- ObjectViewEntityCollectionData.cs
- OleDbStruct.cs
- GlyphRun.cs
- DataContractSerializer.cs
- MouseGesture.cs
- Listener.cs
- DataBoundLiteralControl.cs
- Vector3D.cs
- CodeConstructor.cs
- CursorConverter.cs
- _HeaderInfo.cs
- ObjectListComponentEditor.cs
- SqlDeflator.cs
- AvTraceFormat.cs
- Imaging.cs
- LayoutEngine.cs
- AvTrace.cs
- HMACSHA256.cs
- ColumnPropertiesGroup.cs
- SessionEndedEventArgs.cs
- followingsibling.cs