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
- URLIdentityPermission.cs
- ListItemCollection.cs
- TreeNodeStyleCollectionEditor.cs
- AutomationPatternInfo.cs
- CssClassPropertyAttribute.cs
- BaseCAMarshaler.cs
- MouseEventArgs.cs
- XmlAttributeProperties.cs
- TemplateEditingFrame.cs
- ToolStripAdornerWindowService.cs
- ReachFixedDocumentSerializer.cs
- SapiGrammar.cs
- SelectQueryOperator.cs
- DataGridViewColumn.cs
- HorizontalAlignConverter.cs
- NonClientArea.cs
- MatrixValueSerializer.cs
- MaterialCollection.cs
- EditorZoneAutoFormat.cs
- QueryResponse.cs
- LookupNode.cs
- ExpressionDumper.cs
- TemplateBindingExtension.cs
- odbcmetadatacolumnnames.cs
- FormsIdentity.cs
- Int32CAMarshaler.cs
- FrugalMap.cs
- TargetControlTypeAttribute.cs
- StylusPointPropertyUnit.cs
- ISAPIApplicationHost.cs
- ConstructorNeedsTagAttribute.cs
- PrefixQName.cs
- CompiledQueryCacheEntry.cs
- VSWCFServiceContractGenerator.cs
- WebPartDeleteVerb.cs
- Int64Animation.cs
- TraceUtils.cs
- GeneralTransform3DGroup.cs
- TdsParserHelperClasses.cs
- SystemUnicastIPAddressInformation.cs
- ExpandCollapsePattern.cs
- XmlUnspecifiedAttribute.cs
- XPathQilFactory.cs
- DbConnectionPoolIdentity.cs
- Thumb.cs
- RangeEnumerable.cs
- Trace.cs
- PhoneCall.cs
- XPathMultyIterator.cs
- Inline.cs
- DefaultHttpHandler.cs
- MetadataExporter.cs
- StylusOverProperty.cs
- XmlCodeExporter.cs
- QilReplaceVisitor.cs
- XmlDigitalSignatureProcessor.cs
- XPathNavigatorReader.cs
- RoleManagerEventArgs.cs
- AsmxEndpointPickerExtension.cs
- DirectoryNotFoundException.cs
- CodeGenerationManager.cs
- ArraySegment.cs
- ListViewContainer.cs
- DBConcurrencyException.cs
- EditingMode.cs
- URLAttribute.cs
- SqlDependencyListener.cs
- Blend.cs
- PropertyMetadata.cs
- TreeNodeStyle.cs
- Matrix.cs
- XamlStyleSerializer.cs
- SqlTopReducer.cs
- DataGridViewImageColumn.cs
- SpecularMaterial.cs
- XmlNamedNodeMap.cs
- FrugalMap.cs
- InternalResources.cs
- XmlnsPrefixAttribute.cs
- DocumentXPathNavigator.cs
- NativeCompoundFileAPIs.cs
- CqlParser.cs
- CodeMemberMethod.cs
- GlobalizationSection.cs
- ObservableDictionary.cs
- DataGridRow.cs
- XamlStream.cs
- filewebresponse.cs
- OleDbCommandBuilder.cs
- WizardForm.cs
- BindingContext.cs
- DataGridPagerStyle.cs
- CommonObjectSecurity.cs
- HttpWrapper.cs
- SecurityState.cs
- RedistVersionInfo.cs
- SqlUdtInfo.cs
- RTTrackingProfile.cs
- DbMetaDataColumnNames.cs
- Binding.cs