Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / Script / Services / WebServiceEnumData.cs / 1 / WebServiceEnumData.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Globalization; namespace System.Web.Script.Services { using System; internal class WebServiceEnumData : WebServiceTypeData { bool isULong; string[] names; long[] values; internal WebServiceEnumData(string typeName, string typeNamespace, string[] names, long[] values, bool isULong) : base(typeName, typeNamespace) { InitWebServiceEnumData(names, values, isULong); } internal WebServiceEnumData(string typeName, string typeNamespace, Type t, string[] names, long[] values, bool isULong) : base(typeName, typeNamespace, t) { InitWebServiceEnumData(names, values, isULong); } internal WebServiceEnumData(string typeName, string typeNamespace, string[] names, Array values, bool isULong) : base(typeName, typeNamespace) { InitWebServiceEnumData(names, values, isULong); } internal WebServiceEnumData(string typeName, string typeNamespace, Type t, string[] names, Array values, bool isULong) : base(typeName, typeNamespace) { InitWebServiceEnumData(names, values, isULong); } internal bool IsULong { get { return isULong; } } internal string[] Names { get { return names; } } internal long[] Values { get { return values; } } private void InitWebServiceEnumData(string[] names, long[] values, bool isULong) { System.Diagnostics.Debug.Assert(names != null); System.Diagnostics.Debug.Assert(values != null); System.Diagnostics.Debug.Assert(names.Length == values.Length); this.names = names; this.values = values; this.isULong = isULong; } private void InitWebServiceEnumData(string[] names, Array values, bool isULong) { System.Diagnostics.Debug.Assert(names != null); System.Diagnostics.Debug.Assert(values != null); System.Diagnostics.Debug.Assert(names.Length == values.Length); this.names = names; this.values = new long[values.Length]; for (int i = 0; i < values.Length; i++) { object enumValue = values.GetValue(i); if (isULong) { this.values[i] = (long)((IConvertible)enumValue).ToUInt64(CultureInfo.InvariantCulture); } else { this.values[i] = ((IConvertible)enumValue).ToInt64(CultureInfo.InvariantCulture); } } this.isULong = isULong; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Globalization; namespace System.Web.Script.Services { using System; internal class WebServiceEnumData : WebServiceTypeData { bool isULong; string[] names; long[] values; internal WebServiceEnumData(string typeName, string typeNamespace, string[] names, long[] values, bool isULong) : base(typeName, typeNamespace) { InitWebServiceEnumData(names, values, isULong); } internal WebServiceEnumData(string typeName, string typeNamespace, Type t, string[] names, long[] values, bool isULong) : base(typeName, typeNamespace, t) { InitWebServiceEnumData(names, values, isULong); } internal WebServiceEnumData(string typeName, string typeNamespace, string[] names, Array values, bool isULong) : base(typeName, typeNamespace) { InitWebServiceEnumData(names, values, isULong); } internal WebServiceEnumData(string typeName, string typeNamespace, Type t, string[] names, Array values, bool isULong) : base(typeName, typeNamespace) { InitWebServiceEnumData(names, values, isULong); } internal bool IsULong { get { return isULong; } } internal string[] Names { get { return names; } } internal long[] Values { get { return values; } } private void InitWebServiceEnumData(string[] names, long[] values, bool isULong) { System.Diagnostics.Debug.Assert(names != null); System.Diagnostics.Debug.Assert(values != null); System.Diagnostics.Debug.Assert(names.Length == values.Length); this.names = names; this.values = values; this.isULong = isULong; } private void InitWebServiceEnumData(string[] names, Array values, bool isULong) { System.Diagnostics.Debug.Assert(names != null); System.Diagnostics.Debug.Assert(values != null); System.Diagnostics.Debug.Assert(names.Length == values.Length); this.names = names; this.values = new long[values.Length]; for (int i = 0; i < values.Length; i++) { object enumValue = values.GetValue(i); if (isULong) { this.values[i] = (long)((IConvertible)enumValue).ToUInt64(CultureInfo.InvariantCulture); } else { this.values[i] = ((IConvertible)enumValue).ToInt64(CultureInfo.InvariantCulture); } } this.isULong = isULong; } } } // 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
- DynamicILGenerator.cs
- AnimationTimeline.cs
- SimpleHandlerBuildProvider.cs
- DataGridItem.cs
- SocketElement.cs
- Rules.cs
- ParserOptions.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SchemaElement.cs
- ImageInfo.cs
- XmlnsDictionary.cs
- WpfKnownType.cs
- ComponentSerializationService.cs
- CurrencyWrapper.cs
- Models.cs
- CreateRefExpr.cs
- InvalidFilterCriteriaException.cs
- LogEntrySerializer.cs
- EasingQuaternionKeyFrame.cs
- Publisher.cs
- ProjectionPruner.cs
- MaterialCollection.cs
- GlobalizationSection.cs
- ExpressionEvaluator.cs
- NamespaceEmitter.cs
- ChoiceConverter.cs
- RawAppCommandInputReport.cs
- WebZone.cs
- WebAdminConfigurationHelper.cs
- Transform.cs
- ToolboxItemAttribute.cs
- WebPartManager.cs
- CompoundFileDeflateTransform.cs
- WebReferencesBuildProvider.cs
- InternalMappingException.cs
- CommonServiceBehaviorElement.cs
- GradientSpreadMethodValidation.cs
- DataRowChangeEvent.cs
- ToolBarButtonClickEvent.cs
- URL.cs
- MatrixKeyFrameCollection.cs
- MatrixTransform3D.cs
- ToolStripItemRenderEventArgs.cs
- X509Certificate.cs
- CompilerScope.Storage.cs
- SafeCryptoHandles.cs
- CodeGroup.cs
- FirewallWrapper.cs
- GridView.cs
- DataSourceView.cs
- SmiEventSink.cs
- DesignBindingValueUIHandler.cs
- SoapTypeAttribute.cs
- DataGridViewBindingCompleteEventArgs.cs
- DescendantQuery.cs
- MarshalDirectiveException.cs
- WarningException.cs
- OutputCacheSettingsSection.cs
- ManipulationDevice.cs
- LoginCancelEventArgs.cs
- ListViewCancelEventArgs.cs
- EntityAdapter.cs
- C14NUtil.cs
- documentation.cs
- RangeValidator.cs
- TextEncodedRawTextWriter.cs
- Button.cs
- XmlDataSourceDesigner.cs
- LocalizableResourceBuilder.cs
- PeekCompletedEventArgs.cs
- ScriptManager.cs
- XPathParser.cs
- ValidationVisibilityAttribute.cs
- DBConcurrencyException.cs
- Encoding.cs
- ToolbarAUtomationPeer.cs
- ServiceOperationDetailViewControl.cs
- AttributedMetaModel.cs
- MenuItemStyleCollection.cs
- ListViewTableCell.cs
- BindingSource.cs
- ISO2022Encoding.cs
- Instrumentation.cs
- WmlLiteralTextAdapter.cs
- PointAnimationBase.cs
- MultipartContentParser.cs
- InstanceOwner.cs
- StorageAssociationSetMapping.cs
- TransformCollection.cs
- WasNotInstalledException.cs
- Overlapped.cs
- InvalidCastException.cs
- AxWrapperGen.cs
- QilReference.cs
- TransformerTypeCollection.cs
- DocumentGrid.cs
- ProxyHwnd.cs
- RefType.cs
- GraphicsContainer.cs
- Point3DAnimation.cs