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
- IOThreadTimer.cs
- HebrewCalendar.cs
- ToolstripProfessionalRenderer.cs
- ContourSegment.cs
- SecurityElement.cs
- KnownTypesHelper.cs
- IntranetCredentialPolicy.cs
- SecurityTokenProviderContainer.cs
- PipelineModuleStepContainer.cs
- GcHandle.cs
- QuaternionAnimationBase.cs
- XmlMapping.cs
- CommandManager.cs
- GenericRootAutomationPeer.cs
- SqlDataSourceQuery.cs
- ActionFrame.cs
- RectangleF.cs
- EventWaitHandle.cs
- Compress.cs
- CreateUserErrorEventArgs.cs
- DocumentSequence.cs
- PrintPreviewControl.cs
- DrawingContext.cs
- ArraySegment.cs
- XmlNamespaceDeclarationsAttribute.cs
- DependencyPropertyHelper.cs
- FunctionQuery.cs
- TextEditor.cs
- ProfileServiceManager.cs
- DBCSCodePageEncoding.cs
- ScriptingWebServicesSectionGroup.cs
- JoinTreeSlot.cs
- IFlowDocumentViewer.cs
- TabControlCancelEvent.cs
- ResourceDefaultValueAttribute.cs
- DefaultValidator.cs
- TemplatePagerField.cs
- BindableTemplateBuilder.cs
- SqlUtils.cs
- SqlStatistics.cs
- Calendar.cs
- SQLGuidStorage.cs
- ObjectDataSourceDesigner.cs
- WindowsProgressbar.cs
- OLEDB_Util.cs
- SoapElementAttribute.cs
- DataGridHeaderBorder.cs
- PhonemeEventArgs.cs
- XPathItem.cs
- SiteMapDataSourceView.cs
- InvalidateEvent.cs
- XmlSchemaElement.cs
- NavigationProgressEventArgs.cs
- Separator.cs
- ValidationEventArgs.cs
- LeafCellTreeNode.cs
- RoleManagerModule.cs
- TemplateColumn.cs
- SQLByteStorage.cs
- Literal.cs
- Stylesheet.cs
- FormsAuthenticationModule.cs
- RestHandlerFactory.cs
- ExitEventArgs.cs
- MouseButtonEventArgs.cs
- LexicalChunk.cs
- TemplatedMailWebEventProvider.cs
- DoubleLinkList.cs
- RootNamespaceAttribute.cs
- SqlTransaction.cs
- DesignerActionList.cs
- InkCanvasAutomationPeer.cs
- SubclassTypeValidator.cs
- GenericIdentity.cs
- MarkedHighlightComponent.cs
- altserialization.cs
- DbBuffer.cs
- AttachedPropertyBrowsableAttribute.cs
- UICuesEvent.cs
- FieldMetadata.cs
- XPathSelectionIterator.cs
- IOException.cs
- ImageClickEventArgs.cs
- ProviderCommandInfoUtils.cs
- Identity.cs
- WebPartPersonalization.cs
- DefinitionUpdate.cs
- Converter.cs
- RegularExpressionValidator.cs
- _ListenerResponseStream.cs
- TriggerCollection.cs
- LoginView.cs
- StrongNameMembershipCondition.cs
- Models.cs
- InputReport.cs
- Vector3DValueSerializer.cs
- UnicodeEncoding.cs
- HttpCapabilitiesSectionHandler.cs
- ProtocolsInstallComponent.cs
- NeutralResourcesLanguageAttribute.cs