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
- UInt64.cs
- ExtensionDataObject.cs
- InvalidOperationException.cs
- JapaneseCalendar.cs
- XmlAttributes.cs
- ExpressionBuilder.cs
- KeyValuePair.cs
- FixedSOMSemanticBox.cs
- DynamicResourceExtension.cs
- AdapterDictionary.cs
- RayHitTestParameters.cs
- ImmComposition.cs
- LinkLabelLinkClickedEvent.cs
- BuildResult.cs
- PeerNameRecord.cs
- SchemaObjectWriter.cs
- TimeZone.cs
- TextTreeExtractElementUndoUnit.cs
- PropertyEntry.cs
- pingexception.cs
- InstanceCreationEditor.cs
- RayMeshGeometry3DHitTestResult.cs
- XmlValueConverter.cs
- XmlSchemaSet.cs
- Filter.cs
- ToolStripSeparatorRenderEventArgs.cs
- Int32Rect.cs
- ScrollItemPattern.cs
- MultidimensionalArrayItemReference.cs
- EndpointIdentity.cs
- SHA256Managed.cs
- DataGridViewColumnHeaderCell.cs
- ZipIOExtraFieldElement.cs
- DataAccessException.cs
- XsdCachingReader.cs
- CodeNamespace.cs
- DataSetUtil.cs
- ScrollChrome.cs
- ViewManager.cs
- HttpCacheParams.cs
- HashMembershipCondition.cs
- COM2FontConverter.cs
- ComponentDispatcher.cs
- Drawing.cs
- UnsafeNativeMethods.cs
- SynchronizingStream.cs
- EvidenceTypeDescriptor.cs
- DesignerCalendarAdapter.cs
- SettingsProviderCollection.cs
- TextCompositionManager.cs
- SchemaCollectionCompiler.cs
- MetadataImporter.cs
- SQLChars.cs
- Size3DConverter.cs
- OdbcEnvironmentHandle.cs
- BitmapEffectDrawingContextWalker.cs
- EntityConnectionStringBuilder.cs
- odbcmetadatacolumnnames.cs
- DBCommand.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- TabControl.cs
- SwitchAttribute.cs
- SmtpDigestAuthenticationModule.cs
- StylusCollection.cs
- MemoryRecordBuffer.cs
- SafeViewOfFileHandle.cs
- RealProxy.cs
- ConfigurationManagerInternalFactory.cs
- TextTreeUndoUnit.cs
- TreeViewEvent.cs
- Constant.cs
- Attribute.cs
- ReflectEventDescriptor.cs
- OdbcConnectionStringbuilder.cs
- CTreeGenerator.cs
- SoapCodeExporter.cs
- WindowsEditBox.cs
- StateMachineDesignerPaint.cs
- DataView.cs
- SourceCollection.cs
- BamlResourceContent.cs
- WorkflowEventArgs.cs
- Main.cs
- ReaderOutput.cs
- TabOrder.cs
- CardSpaceException.cs
- X509InitiatorCertificateClientElement.cs
- messageonlyhwndwrapper.cs
- RegexCharClass.cs
- DiagnosticTrace.cs
- ChooseAction.cs
- PropertyGridCommands.cs
- TreeNode.cs
- TextLine.cs
- ArrayWithOffset.cs
- StateRuntime.cs
- MappingException.cs
- SystemIPAddressInformation.cs
- SelectedDatesCollection.cs
- StreamGeometryContext.cs