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
- CommonGetThemePartSize.cs
- ConfigurationSectionHelper.cs
- InputMethodStateTypeInfo.cs
- Util.cs
- AffineTransform3D.cs
- SmtpCommands.cs
- MatrixKeyFrameCollection.cs
- WebPartCatalogAddVerb.cs
- StyleModeStack.cs
- DataGridColumn.cs
- MemberRelationshipService.cs
- FtpCachePolicyElement.cs
- DesignerTransactionCloseEvent.cs
- SqlProfileProvider.cs
- TextLineResult.cs
- VersionedStreamOwner.cs
- RuntimeArgumentHandle.cs
- commandenforcer.cs
- KeyNotFoundException.cs
- BaseTemplateBuildProvider.cs
- DataViewManager.cs
- RootBrowserWindow.cs
- IDictionary.cs
- PassportAuthenticationEventArgs.cs
- DependencyPropertyAttribute.cs
- Message.cs
- ProgressBar.cs
- ContentPlaceHolder.cs
- HashCodeCombiner.cs
- ASCIIEncoding.cs
- DataStreamFromComStream.cs
- TypeToStringValueConverter.cs
- CaseStatementProjectedSlot.cs
- NativeMethods.cs
- ConfigurationHelpers.cs
- Stylesheet.cs
- CodeEntryPointMethod.cs
- ConfigurationException.cs
- FormParameter.cs
- UnsafeCollabNativeMethods.cs
- AnimationClock.cs
- Vector3DConverter.cs
- HMACSHA384.cs
- ClientConfigPaths.cs
- CoTaskMemSafeHandle.cs
- ScrollBar.cs
- OdbcErrorCollection.cs
- WebServiceData.cs
- PropertyChangeTracker.cs
- XmlRawWriter.cs
- LingerOption.cs
- TagPrefixInfo.cs
- TransformValueSerializer.cs
- WebServicesSection.cs
- ContainerParagraph.cs
- RelatedEnd.cs
- PagerSettings.cs
- Point.cs
- HMACMD5.cs
- KeyedCollection.cs
- WebBrowserNavigatingEventHandler.cs
- AffineTransform3D.cs
- TimelineGroup.cs
- CompoundFileStorageReference.cs
- DataGridViewSelectedColumnCollection.cs
- SaveFileDialog.cs
- ContactManager.cs
- CompletedAsyncResult.cs
- ImageKeyConverter.cs
- ExpressionBindingCollection.cs
- WizardPanelChangingEventArgs.cs
- ElementUtil.cs
- Viewport3DVisual.cs
- XmlDictionaryWriter.cs
- FileUpload.cs
- brushes.cs
- TraceHwndHost.cs
- SmtpMail.cs
- EncryptedReference.cs
- ScrollBarRenderer.cs
- WebDisplayNameAttribute.cs
- DocumentViewer.cs
- SqlConnectionString.cs
- GC.cs
- WebServiceReceive.cs
- ProcessThread.cs
- SequentialUshortCollection.cs
- XmlDataSource.cs
- EngineSiteSapi.cs
- AdornerDecorator.cs
- HtmlForm.cs
- EntityException.cs
- XmlSchemaImport.cs
- FloatAverageAggregationOperator.cs
- SamlAuthorityBinding.cs
- UrlPropertyAttribute.cs
- HttpCookiesSection.cs
- ArcSegment.cs
- LinkedList.cs
- OpenTypeLayoutCache.cs