Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / MS / Internal / Resources / ContentFileHelper.cs / 1 / ContentFileHelper.cs
// Copyright (c) Microsoft Corporation, 2001 // // File: ContentFileHelper.cs // //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Windows.Resources; using System.Windows.Navigation; using System.Collections.Generic; namespace MS.Internal.Resources { //// ContentFileHelper class provides helper method to get assembly // associated content files. // internal static class ContentFileHelper { internal static bool IsContentFile(string partName) { if (_contentFiles == null) { _contentFiles = GetContentFiles(BaseUriHelper.ResourceAssembly); } if (_contentFiles != null && _contentFiles.Count > 0) { if (_contentFiles.ContainsKey(partName)) { return true; } } return false; } // // Get a list of Content Files for a given Assembly. // static internal DictionaryGetContentFiles(Assembly asm) { Dictionary contentFiles = null; Attribute[] assemblyAttributes; if (asm == null) { asm = BaseUriHelper.ResourceAssembly; if (asm == null) { // If we have no entry assembly return an empty list because // we can't have any content files. return new Dictionary (); } } assemblyAttributes = Attribute.GetCustomAttributes( asm, typeof(AssemblyAssociatedContentFileAttribute)); if (assemblyAttributes != null && assemblyAttributes.Length > 0) { contentFiles = new Dictionary (assemblyAttributes.Length, StringComparer.OrdinalIgnoreCase); for (int i=0; i _contentFiles; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. // Copyright (c) Microsoft Corporation, 2001 // // File: ContentFileHelper.cs // //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Windows.Resources; using System.Windows.Navigation; using System.Collections.Generic; namespace MS.Internal.Resources { // // ContentFileHelper class provides helper method to get assembly // associated content files. // internal static class ContentFileHelper { internal static bool IsContentFile(string partName) { if (_contentFiles == null) { _contentFiles = GetContentFiles(BaseUriHelper.ResourceAssembly); } if (_contentFiles != null && _contentFiles.Count > 0) { if (_contentFiles.ContainsKey(partName)) { return true; } } return false; } // // Get a list of Content Files for a given Assembly. // static internal DictionaryGetContentFiles(Assembly asm) { Dictionary contentFiles = null; Attribute[] assemblyAttributes; if (asm == null) { asm = BaseUriHelper.ResourceAssembly; if (asm == null) { // If we have no entry assembly return an empty list because // we can't have any content files. return new Dictionary (); } } assemblyAttributes = Attribute.GetCustomAttributes( asm, typeof(AssemblyAssociatedContentFileAttribute)); if (assemblyAttributes != null && assemblyAttributes.Length > 0) { contentFiles = new Dictionary (assemblyAttributes.Length, StringComparer.OrdinalIgnoreCase); for (int i=0; i _contentFiles; } } // 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
- objectresult_tresulttype.cs
- AppDomainAttributes.cs
- WebPartMovingEventArgs.cs
- InkCollectionBehavior.cs
- EnumerableCollectionView.cs
- ReliableSessionBindingElementImporter.cs
- CodeDOMProvider.cs
- PrincipalPermission.cs
- CollectionEditor.cs
- AsyncOperation.cs
- DeviceContext2.cs
- PageThemeCodeDomTreeGenerator.cs
- EnumBuilder.cs
- SQLByteStorage.cs
- SQLSingle.cs
- ISessionStateStore.cs
- EntityClientCacheKey.cs
- CharEntityEncoderFallback.cs
- ViewGenResults.cs
- ControlPropertyNameConverter.cs
- CqlLexerHelpers.cs
- ValidationPropertyAttribute.cs
- FormClosingEvent.cs
- IPEndPoint.cs
- CompilerError.cs
- WebConfigManager.cs
- Button.cs
- UriSection.cs
- EventManager.cs
- ApplicationContext.cs
- CustomSignedXml.cs
- Animatable.cs
- URLMembershipCondition.cs
- MiniAssembly.cs
- Token.cs
- PropertyFilterAttribute.cs
- DbMetaDataColumnNames.cs
- LinkLabel.cs
- OrCondition.cs
- TcpChannelListener.cs
- ToolboxItemCollection.cs
- XpsFontSubsetter.cs
- LinqDataSourceView.cs
- DoubleLinkList.cs
- safex509handles.cs
- BufferedGraphics.cs
- FunctionImportElement.cs
- UTF8Encoding.cs
- MetadataArtifactLoaderCompositeFile.cs
- DomNameTable.cs
- Atom10FormatterFactory.cs
- ComponentChangingEvent.cs
- TrustManagerMoreInformation.cs
- LineServicesCallbacks.cs
- DrawingContextWalker.cs
- DataGridViewRowConverter.cs
- UserPersonalizationStateInfo.cs
- BindingExpression.cs
- ButtonBaseAdapter.cs
- WebPartConnectionsCancelEventArgs.cs
- LowerCaseStringConverter.cs
- RuntimeIdentifierPropertyAttribute.cs
- RecognizedWordUnit.cs
- sqlstateclientmanager.cs
- TransactionTraceIdentifier.cs
- RefreshEventArgs.cs
- _UriTypeConverter.cs
- ThemeInfoAttribute.cs
- MulticastDelegate.cs
- AlphabetConverter.cs
- AnimationClock.cs
- BitmapEffectGeneralTransform.cs
- DataPointer.cs
- MemberBinding.cs
- BaseCAMarshaler.cs
- _IPv6Address.cs
- PaintEvent.cs
- AQNBuilder.cs
- TableLayout.cs
- ImageCodecInfoPrivate.cs
- FamilyTypefaceCollection.cs
- OdbcParameter.cs
- StickyNoteContentControl.cs
- DataGridHelper.cs
- UInt64Storage.cs
- SHA384Managed.cs
- SystemFonts.cs
- ProxySimple.cs
- DefaultParameterValueAttribute.cs
- ManagementOperationWatcher.cs
- MaxSessionCountExceededException.cs
- Model3DGroup.cs
- SamlSubjectStatement.cs
- SimpleWebHandlerParser.cs
- DataList.cs
- MachinePropertyVariants.cs
- Table.cs
- TimeStampChecker.cs
- HierarchicalDataSourceControl.cs
- HtmlButton.cs