Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / Baml2006 / Baml6Assembly.cs / 1305600 / Baml6Assembly.cs
using System; using System.Collections.Generic; using System.Reflection; using MS.Internal.WindowsBase; namespace System.Windows.Baml2006 { class Baml6Assembly { // Information needed to resolve a BamlAssembly to a CLR Assembly public readonly string Name; private Assembly _assembly; ////// /// A fully qualified assembly name public Baml6Assembly(string name) { if (name == null) { throw new ArgumentNullException("name"); } Name = name; _assembly = null; } public Baml6Assembly(Assembly assembly) { if (assembly == null) { throw new ArgumentNullException("assembly"); } Name = null; _assembly = assembly; } public Assembly Assembly { get { if (_assembly != null) { return _assembly; } AssemblyName assemblyName = new AssemblyName(Name); _assembly = SafeSecurityHelper.GetLoadedAssembly(assemblyName); if (_assembly == null) { byte[] publicKeyToken = assemblyName.GetPublicKeyToken(); if (assemblyName.Version != null || assemblyName.CultureInfo != null || publicKeyToken != null) { try { _assembly = Assembly.Load(assemblyName.FullName); } catch { AssemblyName shortName = new AssemblyName(assemblyName.Name); if (publicKeyToken != null) { shortName.SetPublicKeyToken(publicKeyToken); } _assembly = Assembly.Load(shortName); } } else { _assembly = Assembly.LoadWithPartialName(assemblyName.Name); } } return _assembly; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections.Generic; using System.Reflection; using MS.Internal.WindowsBase; namespace System.Windows.Baml2006 { class Baml6Assembly { // Information needed to resolve a BamlAssembly to a CLR Assembly public readonly string Name; private Assembly _assembly; ////// /// A fully qualified assembly name public Baml6Assembly(string name) { if (name == null) { throw new ArgumentNullException("name"); } Name = name; _assembly = null; } public Baml6Assembly(Assembly assembly) { if (assembly == null) { throw new ArgumentNullException("assembly"); } Name = null; _assembly = assembly; } public Assembly Assembly { get { if (_assembly != null) { return _assembly; } AssemblyName assemblyName = new AssemblyName(Name); _assembly = SafeSecurityHelper.GetLoadedAssembly(assemblyName); if (_assembly == null) { byte[] publicKeyToken = assemblyName.GetPublicKeyToken(); if (assemblyName.Version != null || assemblyName.CultureInfo != null || publicKeyToken != null) { try { _assembly = Assembly.Load(assemblyName.FullName); } catch { AssemblyName shortName = new AssemblyName(assemblyName.Name); if (publicKeyToken != null) { shortName.SetPublicKeyToken(publicKeyToken); } _assembly = Assembly.Load(shortName); } } else { _assembly = Assembly.LoadWithPartialName(assemblyName.Name); } } return _assembly; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DBDataPermission.cs
- ComponentResourceKey.cs
- XmlSchemaAnnotated.cs
- ComponentEditorForm.cs
- DiscoveryServiceExtension.cs
- SiteMembershipCondition.cs
- BinaryObjectReader.cs
- XmlName.cs
- StringResourceManager.cs
- RecordConverter.cs
- ConfigurationProperty.cs
- SystemTcpStatistics.cs
- AttributeTableBuilder.cs
- NamespaceImport.cs
- CustomExpression.cs
- CompositeCollectionView.cs
- TransactionInformation.cs
- AlignmentYValidation.cs
- Rules.cs
- SerialPinChanges.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- PersonalizationDictionary.cs
- ResXFileRef.cs
- ImageCollectionCodeDomSerializer.cs
- SessionStateSection.cs
- InputLangChangeRequestEvent.cs
- TargetException.cs
- CommandSet.cs
- InProcStateClientManager.cs
- TextRangeSerialization.cs
- PersonalizationProvider.cs
- HandleCollector.cs
- PropertyItemInternal.cs
- HtmlElementCollection.cs
- TextContainer.cs
- TraceSection.cs
- HMACSHA256.cs
- FrameworkTemplate.cs
- X509Certificate2Collection.cs
- HtmlForm.cs
- StreamSecurityUpgradeInitiatorBase.cs
- JoinSymbol.cs
- BatchParser.cs
- PermissionSetEnumerator.cs
- PathGeometry.cs
- PageFunction.cs
- SoapFormatterSinks.cs
- GridViewColumnCollection.cs
- LayoutEngine.cs
- FieldToken.cs
- XNodeNavigator.cs
- UnmanagedHandle.cs
- PersistenceProviderFactory.cs
- ExpressionBindingCollection.cs
- VideoDrawing.cs
- PassportPrincipal.cs
- TraceInternal.cs
- sitestring.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- SqlInternalConnectionSmi.cs
- ProviderCommandInfoUtils.cs
- EndpointInfoCollection.cs
- MenuItem.cs
- Block.cs
- ColumnMapCopier.cs
- ExpressionBinding.cs
- FormatterConverter.cs
- StringUtil.cs
- TableLayout.cs
- ListBase.cs
- SystemIPAddressInformation.cs
- AdapterDictionary.cs
- ControlUtil.cs
- WorkflowDesignerMessageFilter.cs
- ConfigurationLockCollection.cs
- PlaceHolder.cs
- SaveLedgerEntryRequest.cs
- QueueTransferProtocol.cs
- CodeCastExpression.cs
- HandleRef.cs
- ComEventsInfo.cs
- EndOfStreamException.cs
- CreateParams.cs
- MultiTrigger.cs
- Underline.cs
- FacetChecker.cs
- AuthenticatingEventArgs.cs
- Pkcs7Signer.cs
- ConnectionPointConverter.cs
- ReadWriteObjectLock.cs
- BitFlagsGenerator.cs
- SettingsPropertyWrongTypeException.cs
- SpellerStatusTable.cs
- Delay.cs
- XPathNodeIterator.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- TypeUsage.cs
- AddInAdapter.cs
- ErrorWrapper.cs
- NavigationWindowAutomationPeer.cs