Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- AvtEvent.cs
- DataRowComparer.cs
- EventDriven.cs
- XslAstAnalyzer.cs
- XsltSettings.cs
- EntitySqlException.cs
- ComponentConverter.cs
- JpegBitmapEncoder.cs
- WebPartCollection.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- CollectionDataContract.cs
- GridViewAutoFormat.cs
- ResourcePermissionBaseEntry.cs
- WpfXamlMember.cs
- TextPatternIdentifiers.cs
- PresentationAppDomainManager.cs
- DocumentGrid.cs
- HandlerWithFactory.cs
- CutCopyPasteHelper.cs
- SymmetricKey.cs
- NameSpaceExtractor.cs
- DocumentsTrace.cs
- HostedTransportConfigurationManager.cs
- ChineseLunisolarCalendar.cs
- ObjectListShowCommandsEventArgs.cs
- BinaryMethodMessage.cs
- SqlNamer.cs
- ScriptBehaviorDescriptor.cs
- ClientConfigurationHost.cs
- PipelineModuleStepContainer.cs
- BuildProvider.cs
- DoWorkEventArgs.cs
- webbrowsersite.cs
- WorkflowInstanceQuery.cs
- RegistryKey.cs
- ComponentGlyph.cs
- _IPv4Address.cs
- GeneralTransform2DTo3D.cs
- PointKeyFrameCollection.cs
- TextAnchor.cs
- DragStartedEventArgs.cs
- DataGridViewDesigner.cs
- FixUpCollection.cs
- ExceptionUtil.cs
- SystemIPInterfaceProperties.cs
- StringUtil.cs
- InvalidWMPVersionException.cs
- FormatException.cs
- GenerateDerivedKeyRequest.cs
- DataGridSortCommandEventArgs.cs
- contentDescriptor.cs
- RawStylusInput.cs
- StringPropertyBuilder.cs
- ViewCellRelation.cs
- StorageEndPropertyMapping.cs
- EngineSiteSapi.cs
- EventLogTraceListener.cs
- SystemIcmpV4Statistics.cs
- ProcessHostMapPath.cs
- TailPinnedEventArgs.cs
- TemplateControl.cs
- GridEntry.cs
- selecteditemcollection.cs
- KeyboardEventArgs.cs
- DataSourceView.cs
- FeatureSupport.cs
- ParameterCollection.cs
- BackStopAuthenticationModule.cs
- SiteMapProvider.cs
- IdentityValidationException.cs
- TableSectionStyle.cs
- GlobalizationAssembly.cs
- DeleteMemberBinder.cs
- SecureStringHasher.cs
- PublisherMembershipCondition.cs
- PrintPreviewControl.cs
- HebrewNumber.cs
- Graph.cs
- PanelStyle.cs
- GenericUriParser.cs
- WSFederationHttpBinding.cs
- ClientApiGenerator.cs
- QilPatternVisitor.cs
- VisualStyleElement.cs
- UpdateCommand.cs
- SqlDataSourceView.cs
- SQlBooleanStorage.cs
- TakeQueryOptionExpression.cs
- DefaultPropertyAttribute.cs
- RequestUriProcessor.cs
- DoubleLinkList.cs
- XmlIgnoreAttribute.cs
- Bezier.cs
- ManagementBaseObject.cs
- PresentationSource.cs
- Missing.cs
- TemplateControlParser.cs
- XhtmlBasicValidationSummaryAdapter.cs
- DataGridPagerStyle.cs
- XmlText.cs