Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Server / System / Data / Services / MimeTypeAttribute.cs / 1305376 / MimeTypeAttribute.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a class to decorate properties and custom service // operations with a MIME type. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services { using System; using System.Diagnostics; using System.Linq; using System.Reflection; ////// Use this attribute on a DataService service operation method /// or a data object property to indicate than the type returned is /// of a specific MIME type. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public sealed class MimeTypeAttribute : Attribute { ///Name of the attributed method or property. private readonly string memberName; ///MIME type for the attributed method or property. private readonly string mimeType; ////// Initializes a new /// Name of the attributed method or property. /// MIME type for the attributed method or property. public MimeTypeAttribute(string memberName, string mimeType) { this.memberName = memberName; this.mimeType = mimeType; } ///instance with /// the specified MIME type. /// Name of the attributed method or property. public string MemberName { get { return this.memberName; } } ////// MIME type for the attributed method or property. /// public string MimeType { get { return this.mimeType; } } ////// Gets the MIME type declared on the specified /// Member to check. ///. /// /// The MIME type declared on the specified internal static MimeTypeAttribute GetMimeTypeAttribute(MemberInfo member) { Debug.Assert(member != null, "member != null"); return member.ReflectedType.GetCustomAttributes(typeof(MimeTypeAttribute), true) .Cast; null /// if no attribute is declared. /// () .FirstOrDefault(o => o.MemberName == member.Name); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ADMembershipProvider.cs
- XhtmlConformanceSection.cs
- DisplayNameAttribute.cs
- BaseTemplateParser.cs
- XDRSchema.cs
- PtsHost.cs
- CodeMemberMethod.cs
- Automation.cs
- DBConnection.cs
- Stack.cs
- OneOfElement.cs
- basevalidator.cs
- DataGridViewColumnConverter.cs
- AttributeUsageAttribute.cs
- WebSysDefaultValueAttribute.cs
- DetailsViewInsertedEventArgs.cs
- BamlTreeMap.cs
- FileLoadException.cs
- LinkedList.cs
- IInstanceTable.cs
- FirstMatchCodeGroup.cs
- PerformanceCountersElement.cs
- TextServicesCompartmentContext.cs
- ConvertEvent.cs
- SQLInt16.cs
- DesignerResources.cs
- EventLogEntry.cs
- UIPermission.cs
- HtmlSelect.cs
- Win32Native.cs
- UpdatePanelTriggerCollection.cs
- SystemGatewayIPAddressInformation.cs
- _TimerThread.cs
- XmlElement.cs
- TrackingMemoryStream.cs
- SiteMap.cs
- DispatcherExceptionFilterEventArgs.cs
- HttpProfileBase.cs
- OracleConnectionFactory.cs
- XmlWriterTraceListener.cs
- UxThemeWrapper.cs
- MachineSettingsSection.cs
- AssociationTypeEmitter.cs
- oledbmetadatacollectionnames.cs
- GregorianCalendarHelper.cs
- DataGridView.cs
- NumberFunctions.cs
- MenuBase.cs
- ListViewSelectEventArgs.cs
- SessionStateItemCollection.cs
- XhtmlBasicValidationSummaryAdapter.cs
- DateTimeOffsetStorage.cs
- PriorityItem.cs
- Exceptions.cs
- TreeViewHitTestInfo.cs
- DataServiceProcessingPipeline.cs
- New.cs
- WebPartMenuStyle.cs
- CornerRadiusConverter.cs
- TextBlock.cs
- StaticResourceExtension.cs
- ForeignKeyFactory.cs
- DataContractAttribute.cs
- EndPoint.cs
- DefaultTextStore.cs
- AutomationIdentifier.cs
- ComplexTypeEmitter.cs
- WindowsGraphicsCacheManager.cs
- WindowsGraphics.cs
- XmlUnspecifiedAttribute.cs
- SearchForVirtualItemEventArgs.cs
- VerticalAlignConverter.cs
- WebBrowserNavigatedEventHandler.cs
- CurrencyManager.cs
- WindowsTab.cs
- CodeAttributeArgumentCollection.cs
- SafeCoTaskMem.cs
- FontConverter.cs
- HttpServerVarsCollection.cs
- CacheOutputQuery.cs
- ToolStripItemBehavior.cs
- RawAppCommandInputReport.cs
- SqlRowUpdatingEvent.cs
- _AutoWebProxyScriptWrapper.cs
- XmlQualifiedNameTest.cs
- ComboBoxItem.cs
- XmlName.cs
- DesignerProperties.cs
- ServiceOperationViewControl.cs
- CheckBoxAutomationPeer.cs
- DownloadProgressEventArgs.cs
- ImmComposition.cs
- DataGridRowClipboardEventArgs.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- HwndSubclass.cs
- DbInsertCommandTree.cs
- EventMap.cs
- recordstate.cs
- TextSpan.cs
- Geometry.cs