Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- JpegBitmapDecoder.cs
- Script.cs
- MachineKeyConverter.cs
- RijndaelCryptoServiceProvider.cs
- UnsafeNativeMethods.cs
- PropertyDescriptor.cs
- SerializerProvider.cs
- DynamicObjectAccessor.cs
- XmlReader.cs
- IERequestCache.cs
- SqlVisitor.cs
- SizeAnimationUsingKeyFrames.cs
- TreeViewItem.cs
- HitTestWithGeometryDrawingContextWalker.cs
- SignedInfo.cs
- SelectionPattern.cs
- ToolStripRendererSwitcher.cs
- PerformanceCounterPermissionEntry.cs
- DbParameterHelper.cs
- ItemCollectionEditor.cs
- TypeSystem.cs
- DataGridTable.cs
- FormView.cs
- CacheHelper.cs
- WebPartVerbCollection.cs
- SerializationInfoEnumerator.cs
- Point3DAnimationUsingKeyFrames.cs
- OrderedDictionary.cs
- TokenCreationException.cs
- RegexCharClass.cs
- MaskInputRejectedEventArgs.cs
- TextContainer.cs
- Int16Animation.cs
- PropertyGrid.cs
- XmlSchemaAll.cs
- UIEndRequest.cs
- ShutDownListener.cs
- EDesignUtil.cs
- SendKeys.cs
- XmlRootAttribute.cs
- ClientTarget.cs
- UrlPropertyAttribute.cs
- WindowsListViewItem.cs
- DefaultWorkflowLoaderService.cs
- CellIdBoolean.cs
- DataSourceControlBuilder.cs
- ColorContextHelper.cs
- ParseChildrenAsPropertiesAttribute.cs
- ServiceModelConfigurationSectionCollection.cs
- RoutingEndpointTrait.cs
- ItemContainerProviderWrapper.cs
- XmlParserContext.cs
- IdentityReference.cs
- OracleEncoding.cs
- WrapPanel.cs
- EmptyReadOnlyDictionaryInternal.cs
- InvalidDataException.cs
- PEFileEvidenceFactory.cs
- DataGridViewCheckBoxColumn.cs
- InnerItemCollectionView.cs
- BaseAutoFormat.cs
- XmlSchemaSequence.cs
- Geometry.cs
- TreeChangeInfo.cs
- RegexCaptureCollection.cs
- KeyFrames.cs
- WebScriptEnablingBehavior.cs
- CollectionsUtil.cs
- BoundField.cs
- GCHandleCookieTable.cs
- ActivityTypeResolver.xaml.cs
- MenuRendererClassic.cs
- MenuItemBinding.cs
- TabControlCancelEvent.cs
- OperationCanceledException.cs
- CodeAssignStatement.cs
- TransformerInfoCollection.cs
- SecurityRuntime.cs
- PermissionListSet.cs
- DashStyles.cs
- LeftCellWrapper.cs
- SynchronousReceiveBehavior.cs
- ProcessModelSection.cs
- LingerOption.cs
- TextUtf8RawTextWriter.cs
- listitem.cs
- DeferredTextReference.cs
- DefaultMemberAttribute.cs
- DuplicateWaitObjectException.cs
- ResourceDictionary.cs
- WmlLabelAdapter.cs
- DesignerTransaction.cs
- StructureChangedEventArgs.cs
- CacheEntry.cs
- RadioButton.cs
- ConnectionPoint.cs
- SemaphoreSecurity.cs
- DesigntimeLicenseContext.cs
- DecimalConstantAttribute.cs
- CompilerScope.Storage.cs