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
- WindowsListViewGroupSubsetLink.cs
- SubclassTypeValidatorAttribute.cs
- SymDocumentType.cs
- IndentTextWriter.cs
- XmlSchemaSubstitutionGroup.cs
- BindStream.cs
- CompilerLocalReference.cs
- ConfigurationPermission.cs
- DragCompletedEventArgs.cs
- PerfCounters.cs
- TextTreeText.cs
- DateTimePicker.cs
- XamlVector3DCollectionSerializer.cs
- FontSizeConverter.cs
- OperationCanceledException.cs
- UncommonField.cs
- ConsoleKeyInfo.cs
- ClassHandlersStore.cs
- UIElementHelper.cs
- EmbeddedMailObjectsCollection.cs
- Crc32Helper.cs
- NativeWindow.cs
- EntityClassGenerator.cs
- EntityRecordInfo.cs
- XmlNavigatorStack.cs
- JoinSymbol.cs
- ToolStripDropDown.cs
- AsymmetricSignatureFormatter.cs
- WorkflowInstanceContextProvider.cs
- DeploymentSection.cs
- LinkClickEvent.cs
- DesignTimeTemplateParser.cs
- VisualBasicSettingsConverter.cs
- InputGestureCollection.cs
- Matrix3DConverter.cs
- MemberRelationshipService.cs
- AssemblyBuilder.cs
- GregorianCalendar.cs
- ListViewDeletedEventArgs.cs
- EventLogPermissionAttribute.cs
- DataSourceSelectArguments.cs
- xmlformatgeneratorstatics.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- BufferedGraphicsManager.cs
- CodePrimitiveExpression.cs
- XmlComplianceUtil.cs
- Vertex.cs
- StyleXamlTreeBuilder.cs
- SymbolType.cs
- MessageQueuePermission.cs
- NamedPermissionSet.cs
- SqlDependency.cs
- Parser.cs
- DefaultBindingPropertyAttribute.cs
- SequenceNumber.cs
- Exceptions.cs
- MetafileHeaderEmf.cs
- RTLAwareMessageBox.cs
- GregorianCalendar.cs
- ContentType.cs
- CodeGroup.cs
- AtomMaterializerLog.cs
- MenuItemBindingCollection.cs
- BulletedList.cs
- EntityException.cs
- FollowerQueueCreator.cs
- AtlasWeb.Designer.cs
- SessionKeyExpiredException.cs
- MsmqMessageProperty.cs
- QueryAccessibilityHelpEvent.cs
- TreeNodeCollection.cs
- ReferenceSchema.cs
- QuotedPrintableStream.cs
- SiteMapHierarchicalDataSourceView.cs
- Win32SafeHandles.cs
- RuntimeIdentifierPropertyAttribute.cs
- ContainerSelectorBehavior.cs
- PageBuildProvider.cs
- ShaderRenderModeValidation.cs
- HierarchicalDataBoundControl.cs
- Border.cs
- TextDecoration.cs
- DrawListViewSubItemEventArgs.cs
- SQLMoney.cs
- Visitor.cs
- SoapAttributeOverrides.cs
- XPathMultyIterator.cs
- CqlParserHelpers.cs
- ObjectSet.cs
- TabRenderer.cs
- Application.cs
- InvokePattern.cs
- RectangleHotSpot.cs
- XmlBinaryWriter.cs
- WindowsTokenRoleProvider.cs
- OLEDB_Enum.cs
- RangeEnumerable.cs
- XmlSchemaImporter.cs
- SchemaElementDecl.cs
- ProcessModule.cs