Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / XmlILStorageConverter.cs / 1305376 / XmlILStorageConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.IO; using System.Xml; using System.Xml.XPath; using System.Xml.Schema; using System.Xml.Xsl; using System.ComponentModel; namespace System.Xml.Xsl.Runtime { ////// This is a simple convenience wrapper internal class that contains static helper methods that get a value /// converter from XmlQueryRuntime and use it convert among several physical Clr representations for /// the same logical Xml type. For example, an external function might have an argument typed as /// xs:integer, with Clr type Decimal. Since ILGen stores xs:integer as Clr type Int64 instead of /// Decimal, a conversion to the desired storage type must take place. /// [EditorBrowsable(EditorBrowsableState.Never)] public static class XmlILStorageConverter { //----------------------------------------------- // ToAtomicValue //----------------------------------------------- public static XmlAtomicValue StringToAtomicValue(string value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue DecimalToAtomicValue(decimal value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue Int64ToAtomicValue(long value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue Int32ToAtomicValue(int value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue BooleanToAtomicValue(bool value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue DoubleToAtomicValue(double value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue SingleToAtomicValue(float value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue DateTimeToAtomicValue(DateTime value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue XmlQualifiedNameToAtomicValue(XmlQualifiedName value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue TimeSpanToAtomicValue(TimeSpan value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static XmlAtomicValue BytesToAtomicValue(byte[] value, int index, XmlQueryRuntime runtime) { return new XmlAtomicValue(runtime.GetXmlType(index).SchemaType, value); } public static IListNavigatorsToItems(IList listNavigators) { // Check to see if the navigator cache implements IList IList listItems = listNavigators as IList ; if (listItems != null) return listItems; // Create XmlQueryNodeSequence, which does implement IList return new XmlQueryNodeSequence(listNavigators); } public static IList ItemsToNavigators(IList listItems) { // Check to see if the navigator cache implements IList IList listNavs = listItems as IList ; if (listNavs != null) return listNavs; // Create XmlQueryNodeSequence, which does implement IList XmlQueryNodeSequence seq = new XmlQueryNodeSequence(listItems.Count); for (int i = 0; i < listItems.Count; i++) seq.Add((XPathNavigator) listItems[i]); return seq; } } } // 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
- IntAverageAggregationOperator.cs
- List.cs
- PageBreakRecord.cs
- PathStreamGeometryContext.cs
- ObjectDataSourceView.cs
- CompiledQuery.cs
- PartitionResolver.cs
- NetworkAddressChange.cs
- NonParentingControl.cs
- ObjectDataSource.cs
- TreeNodeSelectionProcessor.cs
- DataGridViewElement.cs
- InternalPolicyElement.cs
- SqlClientWrapperSmiStream.cs
- Encoder.cs
- StateDesigner.TransitionInfo.cs
- UIElementAutomationPeer.cs
- AndMessageFilter.cs
- DisableDpiAwarenessAttribute.cs
- NullableLongAverageAggregationOperator.cs
- DelegateHelpers.Generated.cs
- GB18030Encoding.cs
- DateTimeOffset.cs
- _TransmitFileOverlappedAsyncResult.cs
- ImageFormatConverter.cs
- _ShellExpression.cs
- TextParentUndoUnit.cs
- VectorValueSerializer.cs
- ChildDocumentBlock.cs
- Parameter.cs
- _NTAuthentication.cs
- XslException.cs
- XmlNodeChangedEventManager.cs
- ScaleTransform3D.cs
- DownloadProgressEventArgs.cs
- RtfControlWordInfo.cs
- GraphicsPathIterator.cs
- CompressedStack.cs
- FixedSOMElement.cs
- EventDescriptorCollection.cs
- FormClosingEvent.cs
- DataPagerFieldItem.cs
- DataSourceProvider.cs
- DesignerTextViewAdapter.cs
- SHA1CryptoServiceProvider.cs
- ColumnCollection.cs
- LinqDataSourceDisposeEventArgs.cs
- ConfigXmlDocument.cs
- Canvas.cs
- ColorConvertedBitmapExtension.cs
- SqlPersonalizationProvider.cs
- ColorConverter.cs
- SqlTopReducer.cs
- XNodeValidator.cs
- ChtmlLinkAdapter.cs
- CopyAction.cs
- TypographyProperties.cs
- ObservableCollection.cs
- QueryExpression.cs
- XmlSerializableWriter.cs
- TextComposition.cs
- ShaperBuffers.cs
- DependencyObjectCodeDomSerializer.cs
- _ConnectionGroup.cs
- ObjectStateManager.cs
- Icon.cs
- HostSecurityManager.cs
- ClientRoleProvider.cs
- MenuItemCollection.cs
- LookupNode.cs
- DataFormats.cs
- ImageProxy.cs
- TimeIntervalCollection.cs
- Repeater.cs
- HitTestFilterBehavior.cs
- AsymmetricSignatureFormatter.cs
- _emptywebproxy.cs
- CommentAction.cs
- DesignerOptions.cs
- OpenTypeLayoutCache.cs
- OleDbEnumerator.cs
- ConnectionStringSettings.cs
- MenuAdapter.cs
- CompoundFileStreamReference.cs
- ColorConvertedBitmap.cs
- PersonalizationStateInfoCollection.cs
- BindingManagerDataErrorEventArgs.cs
- TrackingDataItem.cs
- DelimitedListTraceListener.cs
- MatrixConverter.cs
- IxmlLineInfo.cs
- GrammarBuilderDictation.cs
- OleDbEnumerator.cs
- RelationshipConstraintValidator.cs
- ByteAnimation.cs
- CallbackValidator.cs
- BaseDataList.cs
- RangeValuePatternIdentifiers.cs
- XmlDictionaryString.cs
- DiagnosticTrace.cs