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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- _OverlappedAsyncResult.cs
- AuthorizationSection.cs
- IisTraceListener.cs
- HttpConfigurationContext.cs
- BaseCollection.cs
- Int32Converter.cs
- BrowserCapabilitiesCodeGenerator.cs
- ControlUtil.cs
- BinaryFormatterWriter.cs
- MessageSmuggler.cs
- TTSEngineProxy.cs
- AutomationPropertyInfo.cs
- ThemeDirectoryCompiler.cs
- UniqueConstraint.cs
- TableLayoutSettings.cs
- ToolStripLabel.cs
- MultipartContentParser.cs
- CodeIdentifiers.cs
- BreadCrumbTextConverter.cs
- PageParser.cs
- safelinkcollection.cs
- XAMLParseException.cs
- RangeValuePattern.cs
- SqlParameterizer.cs
- ProviderConnectionPoint.cs
- _HelperAsyncResults.cs
- Bidi.cs
- TableChangeProcessor.cs
- CollectionConverter.cs
- PrintingPermissionAttribute.cs
- Point3DCollection.cs
- SecurityException.cs
- UshortList2.cs
- MasterPage.cs
- ScriptManagerProxy.cs
- ModelTreeEnumerator.cs
- RadioButtonAutomationPeer.cs
- RemoteWebConfigurationHostServer.cs
- LineSegment.cs
- Grid.cs
- XmlChildNodes.cs
- SerializationFieldInfo.cs
- UserPreferenceChangingEventArgs.cs
- ExpressionCopier.cs
- Vector3DAnimationUsingKeyFrames.cs
- Coordinator.cs
- FunctionDetailsReader.cs
- BasicAsyncResult.cs
- SqlReferenceCollection.cs
- SolidBrush.cs
- RepeaterItem.cs
- QilNode.cs
- XmlWriterSettings.cs
- BrushConverter.cs
- AuthStoreRoleProvider.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- HwndProxyElementProvider.cs
- DbBuffer.cs
- TextMetrics.cs
- InfoCardProofToken.cs
- WebPartPersonalization.cs
- RemotingAttributes.cs
- BamlVersionHeader.cs
- DataGridLengthConverter.cs
- HttpDictionary.cs
- CommentGlyph.cs
- EncoderParameter.cs
- CalendarDay.cs
- ListViewSelectEventArgs.cs
- PointConverter.cs
- UnmanagedMemoryStream.cs
- _ConnectStream.cs
- AutoResetEvent.cs
- ColumnResizeAdorner.cs
- SizeChangedEventArgs.cs
- NativeMethods.cs
- TextBoxBase.cs
- PerformanceCounterPermission.cs
- JoinTreeSlot.cs
- XmlValidatingReader.cs
- FrameSecurityDescriptor.cs
- StateChangeEvent.cs
- CoreSwitches.cs
- ProxyWebPartConnectionCollection.cs
- ArraySortHelper.cs
- LoadGrammarCompletedEventArgs.cs
- DbParameterCollection.cs
- Collection.cs
- Metafile.cs
- Oid.cs
- ProfessionalColors.cs
- ActivityExecutor.cs
- WebPartEditorOkVerb.cs
- RepeatBehaviorConverter.cs
- NavigatorOutput.cs
- ConsumerConnectionPointCollection.cs
- MetadataPropertyAttribute.cs
- PlatformNotSupportedException.cs
- QuadraticEase.cs
- RemotingConfigParser.cs