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
- invalidudtexception.cs
- RowTypeElement.cs
- COSERVERINFO.cs
- SpecialNameAttribute.cs
- CapabilitiesAssignment.cs
- ListenerSingletonConnectionReader.cs
- ResourceDisplayNameAttribute.cs
- DynamicField.cs
- TextBoxDesigner.cs
- ConfigXmlReader.cs
- UnaryNode.cs
- ADMembershipUser.cs
- uribuilder.cs
- Html32TextWriter.cs
- ErrorHandler.cs
- FloatUtil.cs
- ToolStripSplitButton.cs
- TdsParserSafeHandles.cs
- ProviderConnectionPointCollection.cs
- Interlocked.cs
- ThemeableAttribute.cs
- EmbeddedMailObject.cs
- DataColumnMapping.cs
- XPathDocumentBuilder.cs
- TileBrush.cs
- ParallelTimeline.cs
- Evaluator.cs
- SoapHeader.cs
- XamlFigureLengthSerializer.cs
- HttpTransportElement.cs
- ReadOnlyDictionary.cs
- FrameworkContentElement.cs
- XsdBuildProvider.cs
- ProfileSettingsCollection.cs
- RelatedView.cs
- SqlTriggerContext.cs
- HMACSHA512.cs
- Cursor.cs
- LinkLabelLinkClickedEvent.cs
- XmlAttributeOverrides.cs
- ApplicationHost.cs
- RIPEMD160.cs
- NativeMethods.cs
- RadioButton.cs
- HandledMouseEvent.cs
- RectangleGeometry.cs
- BindingContext.cs
- listitem.cs
- GlobalizationSection.cs
- HtmlTableRow.cs
- CompoundFileStorageReference.cs
- ExtenderControl.cs
- RpcResponse.cs
- KeyPressEvent.cs
- RunWorkerCompletedEventArgs.cs
- DBConcurrencyException.cs
- KeyMatchBuilder.cs
- DetailsViewInsertEventArgs.cs
- SqlVersion.cs
- Material.cs
- SerializationObjectManager.cs
- ToolStrip.cs
- ObjectCloneHelper.cs
- translator.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ComplusTypeValidator.cs
- CodeValidator.cs
- ValidationEventArgs.cs
- TextEditorTyping.cs
- CollectionsUtil.cs
- DataServices.cs
- BindableTemplateBuilder.cs
- XmlNode.cs
- MexHttpBindingElement.cs
- ListViewInsertEventArgs.cs
- SafeCoTaskMem.cs
- XPathEmptyIterator.cs
- XmlParser.cs
- SetterBaseCollection.cs
- ExpandSegmentCollection.cs
- SQLUtility.cs
- SingleTagSectionHandler.cs
- Double.cs
- XmlDictionaryReader.cs
- KeyEvent.cs
- ErrorFormatterPage.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ProjectionNode.cs
- Identity.cs
- TreeNodeBindingCollection.cs
- WindowPatternIdentifiers.cs
- TypedRowHandler.cs
- ProxyGenerationError.cs
- TransactedReceiveScope.cs
- StrongNameKeyPair.cs
- WindowsRichEdit.cs
- TypedTableHandler.cs
- SpeechDetectedEventArgs.cs
- SoapInteropTypes.cs