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
- TableParaClient.cs
- TemplateContent.cs
- FormsAuthentication.cs
- COM2IDispatchConverter.cs
- AsyncCompletedEventArgs.cs
- HitTestFilterBehavior.cs
- RemoveFromCollection.cs
- WmlValidationSummaryAdapter.cs
- XmlSchemaImporter.cs
- ValidatorCollection.cs
- RewritingValidator.cs
- XamlPoint3DCollectionSerializer.cs
- IsolatedStorageFileStream.cs
- RoutedEventHandlerInfo.cs
- TextServicesCompartmentContext.cs
- SharedConnectionWorkflowTransactionService.cs
- UIElement.cs
- TextRunCacheImp.cs
- MetadataArtifactLoaderResource.cs
- EnumValAlphaComparer.cs
- SmiRecordBuffer.cs
- FormCollection.cs
- MissingSatelliteAssemblyException.cs
- KoreanCalendar.cs
- ScalarType.cs
- Int64.cs
- safelinkcollection.cs
- ConfigUtil.cs
- FileInfo.cs
- MatrixCamera.cs
- WSHttpSecurity.cs
- CodeArgumentReferenceExpression.cs
- LinkedResource.cs
- SafeCryptoHandles.cs
- Hex.cs
- AppDomainUnloadedException.cs
- Track.cs
- Validator.cs
- PeerTransportElement.cs
- KnownBoxes.cs
- WebPartConnectVerb.cs
- CheckBoxList.cs
- DownloadProgressEventArgs.cs
- WebHttpSecurityElement.cs
- PrivilegedConfigurationManager.cs
- ResizingMessageFilter.cs
- NegotiateStream.cs
- WebResourceUtil.cs
- CalendarDateChangedEventArgs.cs
- NGCPageContentSerializerAsync.cs
- OdbcReferenceCollection.cs
- CustomErrorsSection.cs
- PagerSettings.cs
- XsltOutput.cs
- SafeHandles.cs
- BinaryMethodMessage.cs
- SchemaCreator.cs
- CharacterBuffer.cs
- ToolTipService.cs
- DrawingDrawingContext.cs
- SoapElementAttribute.cs
- GlobalAllocSafeHandle.cs
- Duration.cs
- XmlTextAttribute.cs
- HttpListenerContext.cs
- Permission.cs
- XmlDownloadManager.cs
- MonitorWrapper.cs
- TraceHandler.cs
- MimeTextImporter.cs
- MetadataHelper.cs
- MetadataItemSerializer.cs
- AssociationSetEnd.cs
- LingerOption.cs
- EventData.cs
- CreateRefExpr.cs
- DataSourceUtil.cs
- GenericTypeParameterBuilder.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- DPCustomTypeDescriptor.cs
- CompoundFileIOPermission.cs
- MinimizableAttributeTypeConverter.cs
- DataGridTextBoxColumn.cs
- CacheDict.cs
- SqlGatherProducedAliases.cs
- QueryOperationResponseOfT.cs
- MetadataArtifactLoaderComposite.cs
- TextSelectionHelper.cs
- WebRequestModuleElementCollection.cs
- CharacterBuffer.cs
- ValidationErrorCollection.cs
- PageAsyncTaskManager.cs
- SQLDateTime.cs
- RootBrowserWindowAutomationPeer.cs
- PrefixHandle.cs
- Object.cs
- ScriptResourceAttribute.cs
- UpdateManifestForBrowserApplication.cs
- SqlFormatter.cs
- CharConverter.cs