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
- UpDownBaseDesigner.cs
- StringValidatorAttribute.cs
- TreeNodeCollection.cs
- WebPartCatalogCloseVerb.cs
- RemoteWebConfigurationHostServer.cs
- HtmlTableCell.cs
- StyleHelper.cs
- FullTextState.cs
- BitmapEffectGeneralTransform.cs
- Part.cs
- COM2PropertyDescriptor.cs
- AdapterDictionary.cs
- PublisherIdentityPermission.cs
- MailAddress.cs
- ConfigurationPropertyCollection.cs
- XPathChildIterator.cs
- ProbeDuplex11AsyncResult.cs
- unsafenativemethodsother.cs
- Debug.cs
- DetailsViewRowCollection.cs
- CommandHelper.cs
- LocatorPartList.cs
- BitmapCacheBrush.cs
- AddressAlreadyInUseException.cs
- SmtpException.cs
- CorePropertiesFilter.cs
- UIElementAutomationPeer.cs
- SoapSchemaMember.cs
- DesignerHierarchicalDataSourceView.cs
- SecurityListenerSettingsLifetimeManager.cs
- WindowPattern.cs
- StatusBarItemAutomationPeer.cs
- AsymmetricKeyExchangeDeformatter.cs
- FormViewModeEventArgs.cs
- ContentPlaceHolder.cs
- MutexSecurity.cs
- TextBoxBase.cs
- CapabilitiesRule.cs
- Fx.cs
- Control.cs
- DbConnectionStringCommon.cs
- PkcsUtils.cs
- Floater.cs
- VSDExceptions.cs
- UIElementHelper.cs
- WebBrowserDesigner.cs
- ExceptionHandlerDesigner.cs
- ChannelHandler.cs
- ExternalException.cs
- IResourceProvider.cs
- FlowLayout.cs
- ILGenerator.cs
- CompileLiteralTextParser.cs
- HelpHtmlBuilder.cs
- ConfigurationManagerInternalFactory.cs
- FunctionImportElement.cs
- SizeAnimationBase.cs
- HttpPostServerProtocol.cs
- SharedPersonalizationStateInfo.cs
- Focus.cs
- RangeValidator.cs
- ProfileService.cs
- WindowsToolbarItemAsMenuItem.cs
- HttpDebugHandler.cs
- SystemFonts.cs
- MemberPathMap.cs
- UrlParameterWriter.cs
- EventDescriptor.cs
- Evaluator.cs
- TailCallAnalyzer.cs
- DataServiceException.cs
- WebResourceUtil.cs
- OdbcConnectionOpen.cs
- XmlSchemaImporter.cs
- DataGridViewColumn.cs
- RegistrySecurity.cs
- XmlLanguage.cs
- TrackingServices.cs
- TransformedBitmap.cs
- DragEvent.cs
- SchemaSetCompiler.cs
- ModifiableIteratorCollection.cs
- TextBoxView.cs
- ConstraintEnumerator.cs
- COM2PictureConverter.cs
- CodeDomConfigurationHandler.cs
- WindowsListViewSubItem.cs
- DocumentSequence.cs
- DynamicFilter.cs
- MetadataException.cs
- OleDbException.cs
- shaperfactory.cs
- TypeNameConverter.cs
- InputScope.cs
- GlyphShapingProperties.cs
- DBCommand.cs
- ChannelRequirements.cs
- Column.cs
- RequestCachingSection.cs
- WsdlImporterElementCollection.cs