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
- ToolStripItemBehavior.cs
- GridViewDeleteEventArgs.cs
- Property.cs
- PageCodeDomTreeGenerator.cs
- OutgoingWebRequestContext.cs
- _AutoWebProxyScriptWrapper.cs
- FixedPageProcessor.cs
- PointAnimation.cs
- UnknownBitmapEncoder.cs
- DirectoryInfo.cs
- TraceSection.cs
- ValueCollectionParameterReader.cs
- InvalidEnumArgumentException.cs
- _IPv6Address.cs
- Section.cs
- Win32.cs
- WhitespaceRuleReader.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- DelegateBodyWriter.cs
- AbsoluteQuery.cs
- ColorConvertedBitmap.cs
- DragCompletedEventArgs.cs
- EventLogger.cs
- COM2EnumConverter.cs
- XsltArgumentList.cs
- TableRow.cs
- CachedResourceDictionaryExtension.cs
- EventInfo.cs
- DiagnosticTraceSchemas.cs
- FixedSOMSemanticBox.cs
- TemplateField.cs
- ImageList.cs
- Enlistment.cs
- ComContractElement.cs
- uribuilder.cs
- LambdaCompiler.Unary.cs
- XmlArrayItemAttribute.cs
- DataBoundControlDesigner.cs
- _SSPISessionCache.cs
- SymDocumentType.cs
- SecurityContextSecurityToken.cs
- ExeConfigurationFileMap.cs
- PointHitTestParameters.cs
- CodeVariableReferenceExpression.cs
- ExceptionWrapper.cs
- DesignerLoader.cs
- CollectionBuilder.cs
- SqlConnectionPoolGroupProviderInfo.cs
- SqlCommand.cs
- DrawingContextDrawingContextWalker.cs
- MdiWindowListItemConverter.cs
- cookiecollection.cs
- CheckoutException.cs
- BitmapEffectInput.cs
- SchemaConstraints.cs
- ParameterCollection.cs
- GeneratedCodeAttribute.cs
- ItemCollection.cs
- InstanceOwner.cs
- UnsafeNativeMethodsTablet.cs
- OverflowException.cs
- SchemaNotation.cs
- ReaderOutput.cs
- BehaviorDragDropEventArgs.cs
- TemplateDefinition.cs
- CopyCodeAction.cs
- OleDbConnectionInternal.cs
- SrgsElementList.cs
- BinHexEncoder.cs
- XmlJsonReader.cs
- login.cs
- COM2ComponentEditor.cs
- PhysicalOps.cs
- Matrix.cs
- CodeGenHelper.cs
- Merger.cs
- BamlReader.cs
- ObjectConverter.cs
- WindowsToolbar.cs
- DiscreteKeyFrames.cs
- Activator.cs
- CodeParameterDeclarationExpressionCollection.cs
- RequestCachingSection.cs
- SemanticResultValue.cs
- OperatingSystem.cs
- GridLengthConverter.cs
- DataColumn.cs
- NaturalLanguageHyphenator.cs
- SessionStateModule.cs
- FlowDocumentPage.cs
- XsltSettings.cs
- XslAstAnalyzer.cs
- MarkupWriter.cs
- AppLevelCompilationSectionCache.cs
- PtsCache.cs
- MergeLocalizationDirectives.cs
- WebControlsSection.cs
- CriticalHandle.cs
- SessionPageStatePersister.cs
- XPathCompiler.cs