Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / XPathExpr.cs / 1305376 / XPathExpr.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.XPath { using System; using System.Xml; using System.Collections; using MS.Internal.Xml.XPath; public enum XmlSortOrder { Ascending = 1, Descending = 2, } public enum XmlCaseOrder { None = 0, UpperFirst = 1, LowerFirst = 2, } public enum XmlDataType { Text = 1, Number = 2, } public enum XPathResultType { Number = 0 , String = 1, Boolean = 2, NodeSet = 3, Navigator = XPathResultType.String, Any = 5, Error }; public abstract class XPathExpression { internal XPathExpression(){} public abstract string Expression { get; } public abstract void AddSort(object expr, IComparer comparer); public abstract void AddSort(object expr, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType); public abstract XPathExpression Clone(); public abstract void SetContext(XmlNamespaceManager nsManager); public abstract void SetContext(IXmlNamespaceResolver nsResolver); public abstract XPathResultType ReturnType { get; } public static XPathExpression Compile(string xpath) { return Compile(xpath, /*nsResolver:*/null); } public static XPathExpression Compile(string xpath, IXmlNamespaceResolver nsResolver) { bool hasPrefix; Query query = new QueryBuilder().Build(xpath, out hasPrefix); CompiledXpathExpr expr = new CompiledXpathExpr(query, xpath, hasPrefix); if (null != nsResolver) { expr.SetContext(nsResolver); } return expr; } private void PrintQuery(XmlWriter w) { ((CompiledXpathExpr)this).QueryTree.PrintQuery(w); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.XPath { using System; using System.Xml; using System.Collections; using MS.Internal.Xml.XPath; public enum XmlSortOrder { Ascending = 1, Descending = 2, } public enum XmlCaseOrder { None = 0, UpperFirst = 1, LowerFirst = 2, } public enum XmlDataType { Text = 1, Number = 2, } public enum XPathResultType { Number = 0 , String = 1, Boolean = 2, NodeSet = 3, Navigator = XPathResultType.String, Any = 5, Error }; public abstract class XPathExpression { internal XPathExpression(){} public abstract string Expression { get; } public abstract void AddSort(object expr, IComparer comparer); public abstract void AddSort(object expr, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType); public abstract XPathExpression Clone(); public abstract void SetContext(XmlNamespaceManager nsManager); public abstract void SetContext(IXmlNamespaceResolver nsResolver); public abstract XPathResultType ReturnType { get; } public static XPathExpression Compile(string xpath) { return Compile(xpath, /*nsResolver:*/null); } public static XPathExpression Compile(string xpath, IXmlNamespaceResolver nsResolver) { bool hasPrefix; Query query = new QueryBuilder().Build(xpath, out hasPrefix); CompiledXpathExpr expr = new CompiledXpathExpr(query, xpath, hasPrefix); if (null != nsResolver) { expr.SetContext(nsResolver); } return expr; } private void PrintQuery(XmlWriter w) { ((CompiledXpathExpr)this).QueryTree.PrintQuery(w); } } } // 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
- RadioButton.cs
- PagedDataSource.cs
- InputProviderSite.cs
- ASCIIEncoding.cs
- WindowsTreeView.cs
- WindowsListViewGroupHelper.cs
- Duration.cs
- CounterCreationData.cs
- DropDownButton.cs
- Hash.cs
- EventHandlerList.cs
- RectIndependentAnimationStorage.cs
- FileLevelControlBuilderAttribute.cs
- TransformGroup.cs
- HttpListenerResponse.cs
- Utils.cs
- ZoomPercentageConverter.cs
- RequestQueue.cs
- DataRow.cs
- DirectoryNotFoundException.cs
- GiveFeedbackEventArgs.cs
- DispatcherOperation.cs
- DbSourceCommand.cs
- AuthorizationRule.cs
- SettingsPropertyIsReadOnlyException.cs
- RenderTargetBitmap.cs
- XPathDocument.cs
- PathGeometry.cs
- DateTimeFormatInfo.cs
- InvalidCastException.cs
- WindowHideOrCloseTracker.cs
- ListenerTraceUtility.cs
- CallId.cs
- HitTestWithPointDrawingContextWalker.cs
- ImageAutomationPeer.cs
- StringExpressionSet.cs
- EllipseGeometry.cs
- UnknownMessageReceivedEventArgs.cs
- DesignBindingConverter.cs
- DispatcherTimer.cs
- WebDisplayNameAttribute.cs
- ActionFrame.cs
- ProcessingInstructionAction.cs
- SocketPermission.cs
- XPathParser.cs
- DataGridComboBoxColumn.cs
- UnionCodeGroup.cs
- PropertyToken.cs
- Triangle.cs
- StreamingContext.cs
- DesignerActionMethodItem.cs
- SqlFacetAttribute.cs
- FieldNameLookup.cs
- CodeDirectoryCompiler.cs
- PowerStatus.cs
- DataGridViewDataErrorEventArgs.cs
- WebHeaderCollection.cs
- HttpModuleActionCollection.cs
- Emitter.cs
- DocumentScope.cs
- CallInfo.cs
- DataBindingCollection.cs
- InstanceKeyCollisionException.cs
- BStrWrapper.cs
- RestClientProxyHandler.cs
- ContentControl.cs
- EditorPartDesigner.cs
- WindowsIPAddress.cs
- AutomationIdentifier.cs
- FontStyles.cs
- Style.cs
- DispatcherSynchronizationContext.cs
- XamlGridLengthSerializer.cs
- ViewGenerator.cs
- ReflectionTypeLoadException.cs
- Authorization.cs
- XmlProcessingInstruction.cs
- SoapServerMessage.cs
- MouseButtonEventArgs.cs
- SQLUtility.cs
- TypedDatasetGenerator.cs
- SchemaExporter.cs
- CalendarTable.cs
- HttpModulesSection.cs
- ClientSideQueueItem.cs
- AppliedDeviceFiltersEditor.cs
- ComponentSerializationService.cs
- RichTextBox.cs
- TextFindEngine.cs
- CodeDomConfigurationHandler.cs
- ProxyWebPartManager.cs
- HtmlImage.cs
- BrowserDefinitionCollection.cs
- ToolstripProfessionalRenderer.cs
- SkinBuilder.cs
- SecondaryIndex.cs
- RecipientInfo.cs
- ServiceHttpHandlerFactory.cs
- SqlUtils.cs
- DateTimeValueSerializerContext.cs