Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ProfileSettings.cs
- DoubleCollectionValueSerializer.cs
- DetailsViewInsertEventArgs.cs
- TreeNode.cs
- RtfNavigator.cs
- DateTimeSerializationSection.cs
- DisplayClaim.cs
- TraceLog.cs
- IriParsingElement.cs
- CodeParameterDeclarationExpression.cs
- Debug.cs
- NamedObject.cs
- DbReferenceCollection.cs
- NavigationPropertyAccessor.cs
- FaultContractAttribute.cs
- PixelFormats.cs
- CompModSwitches.cs
- InputScopeNameConverter.cs
- SimpleFieldTemplateFactory.cs
- KeyConverter.cs
- IntPtr.cs
- DbDataRecord.cs
- InvalidOleVariantTypeException.cs
- ExceptionRoutedEventArgs.cs
- Expressions.cs
- EmissiveMaterial.cs
- CompilerLocalReference.cs
- RuleSetBrowserDialog.cs
- TextControl.cs
- PanelContainerDesigner.cs
- ToolStripProgressBar.cs
- ToolStripDropDownButton.cs
- PreviewPageInfo.cs
- EnumMemberAttribute.cs
- IndexedString.cs
- DbException.cs
- AsymmetricAlgorithm.cs
- DescendentsWalker.cs
- PriorityQueue.cs
- TabControlAutomationPeer.cs
- SqlDataSource.cs
- ProtocolsConfigurationEntry.cs
- Domain.cs
- Parser.cs
- TTSVoice.cs
- Journaling.cs
- BitmapEffectInput.cs
- GridViewColumn.cs
- Deflater.cs
- IndexedString.cs
- IPEndPoint.cs
- ObjectDataSource.cs
- MulticastNotSupportedException.cs
- SizeAnimationClockResource.cs
- NetPeerTcpBindingElement.cs
- ToggleButton.cs
- TypedDatasetGenerator.cs
- StreamInfo.cs
- UdpTransportBindingElement.cs
- DbConnectionPoolCounters.cs
- ECDsaCng.cs
- DbConnectionPoolOptions.cs
- DependencyObjectType.cs
- HashCoreRequest.cs
- OdbcEnvironment.cs
- SqlDeflator.cs
- Mutex.cs
- ListMarkerSourceInfo.cs
- LockedAssemblyCache.cs
- SafeEventLogReadHandle.cs
- DataGridViewBindingCompleteEventArgs.cs
- RequestQueue.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- XmlAnyElementAttribute.cs
- Pool.cs
- GroupedContextMenuStrip.cs
- SrgsOneOf.cs
- SvcMapFileLoader.cs
- TableLayoutPanelCellPosition.cs
- ImageClickEventArgs.cs
- InheritanceContextHelper.cs
- Selection.cs
- DetailsViewModeEventArgs.cs
- DynamicDiscoSearcher.cs
- ParserStack.cs
- XmlAnyAttributeAttribute.cs
- TextDecorationCollectionConverter.cs
- DashStyle.cs
- QueryValue.cs
- HttpRawResponse.cs
- BindingValueChangedEventArgs.cs
- AlternateView.cs
- MetadataException.cs
- ObjectHandle.cs
- SqlColumnizer.cs
- Vector3DCollectionConverter.cs
- CodeObjectCreateExpression.cs
- SqlClientPermission.cs
- DoubleAnimationBase.cs
- MatrixConverter.cs