Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Globalization / GlobalizationAssembly.cs / 1305376 / GlobalizationAssembly.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System.Globalization { using System; using System.Reflection; using System.Collections; using System.Collections.Generic; using System.Threading; using System.Security; using System.Security.Principal; using System.Security.Permissions; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; using System.IO; using System.Diagnostics.Contracts; /*=================================GlobalizationAssembly========================== ** ** This class provides the table loading wrapper that calls GetManifestResourceStream ** ** It used to provide an idea for sort versioning, but that proved to not work ** ============================================================================*/ internal sealed class GlobalizationAssembly { // ---------------------------------------------------------------------------------------------------- // // Instance data members and instance methods. // // --------------------------------------------------------------------------------------------------- [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Process)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Process)] internal unsafe static byte* GetGlobalizationResourceBytePtr(Assembly assembly, String tableName) { Contract.Assert(assembly != null, "assembly can not be null. This should be generally the mscorlib.dll assembly."); Contract.Assert(tableName != null, "table name can not be null"); Stream stream = assembly.GetManifestResourceStream(tableName); UnmanagedMemoryStream bytesStream = stream as UnmanagedMemoryStream; if (bytesStream != null) { byte* bytes = bytesStream.PositionPointer; if (bytes != null) { return (bytes); } } Contract.Assert( false, String.Format( CultureInfo.CurrentCulture, "Didn't get the resource table {0} for System.Globalization from {1}", tableName, assembly)); // We can not continue if we can't get the resource. throw new InvalidOperationException(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System.Globalization { using System; using System.Reflection; using System.Collections; using System.Collections.Generic; using System.Threading; using System.Security; using System.Security.Principal; using System.Security.Permissions; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; using System.IO; using System.Diagnostics.Contracts; /*=================================GlobalizationAssembly========================== ** ** This class provides the table loading wrapper that calls GetManifestResourceStream ** ** It used to provide an idea for sort versioning, but that proved to not work ** ============================================================================*/ internal sealed class GlobalizationAssembly { // ---------------------------------------------------------------------------------------------------- // // Instance data members and instance methods. // // --------------------------------------------------------------------------------------------------- [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Process)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Process)] internal unsafe static byte* GetGlobalizationResourceBytePtr(Assembly assembly, String tableName) { Contract.Assert(assembly != null, "assembly can not be null. This should be generally the mscorlib.dll assembly."); Contract.Assert(tableName != null, "table name can not be null"); Stream stream = assembly.GetManifestResourceStream(tableName); UnmanagedMemoryStream bytesStream = stream as UnmanagedMemoryStream; if (bytesStream != null) { byte* bytes = bytesStream.PositionPointer; if (bytes != null) { return (bytes); } } Contract.Assert( false, String.Format( CultureInfo.CurrentCulture, "Didn't get the resource table {0} for System.Globalization from {1}", tableName, assembly)); // We can not continue if we can't get the resource. throw new InvalidOperationException(); } } } // 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
- PeerName.cs
- PropertySet.cs
- ProcessManager.cs
- Accessible.cs
- BufferedGraphicsContext.cs
- PermissionRequestEvidence.cs
- ResourceWriter.cs
- ItemsPresenter.cs
- DependencyObject.cs
- StorageSetMapping.cs
- XmlBinaryReader.cs
- GridViewRowCollection.cs
- RegistrationServices.cs
- AvTraceFormat.cs
- DataSourceCacheDurationConverter.cs
- SecuritySessionFilter.cs
- MethodRental.cs
- ReflectPropertyDescriptor.cs
- DependentList.cs
- SafeWaitHandle.cs
- FrameworkContextData.cs
- HtmlButton.cs
- ImageSourceValueSerializer.cs
- MeasureItemEvent.cs
- StdValidatorsAndConverters.cs
- BaseAppDomainProtocolHandler.cs
- ControlBuilderAttribute.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- AspProxy.cs
- TaskExtensions.cs
- TableRow.cs
- DataGridViewComboBoxCell.cs
- Positioning.cs
- ISO2022Encoding.cs
- UInt64Converter.cs
- PropertyRef.cs
- OdbcConnection.cs
- CompoundFileStorageReference.cs
- IpcChannelHelper.cs
- DeclaredTypeValidator.cs
- PropagatorResult.cs
- EncodingDataItem.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- CacheSection.cs
- NetworkInformationPermission.cs
- SrgsRule.cs
- RemoteWebConfigurationHostStream.cs
- KeyInfo.cs
- WorkItem.cs
- TypeLoadException.cs
- TextPointerBase.cs
- MouseWheelEventArgs.cs
- DependencyPropertyValueSerializer.cs
- Unit.cs
- CharEntityEncoderFallback.cs
- RangeBaseAutomationPeer.cs
- CompleteWizardStep.cs
- ExpressionContext.cs
- FontConverter.cs
- DataObjectEventArgs.cs
- OutOfMemoryException.cs
- GorillaCodec.cs
- PriorityQueue.cs
- HashRepartitionStream.cs
- BitVec.cs
- WebPartMenu.cs
- DataRecordInfo.cs
- ObjectDataSourceMethodEventArgs.cs
- SiteMembershipCondition.cs
- Margins.cs
- TokenBasedSet.cs
- PersistNameAttribute.cs
- CodeDOMUtility.cs
- PerspectiveCamera.cs
- ApplicationSettingsBase.cs
- ReflectionHelper.cs
- ArrayElementGridEntry.cs
- FixedSOMFixedBlock.cs
- PeerInputChannel.cs
- ConnectionStringsExpressionBuilder.cs
- _NTAuthentication.cs
- ThreadPool.cs
- _NetworkingPerfCounters.cs
- InvalidFilterCriteriaException.cs
- WebPartEditorApplyVerb.cs
- WpfWebRequestHelper.cs
- XmlSchemaObjectCollection.cs
- RawStylusInputCustomDataList.cs
- ResolveCriteriaCD1.cs
- Geometry.cs
- QueryResults.cs
- TreeViewItem.cs
- EventHandlerList.cs
- OpenTypeLayoutCache.cs
- ProjectionCamera.cs
- UserControlParser.cs
- XhtmlBasicValidatorAdapter.cs
- ThaiBuddhistCalendar.cs
- SyndicationDeserializer.cs
- GridViewRowCollection.cs