Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------- // // 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
- DataRowChangeEvent.cs
- SmtpMail.cs
- ListViewItemEventArgs.cs
- ByteStream.cs
- ADMembershipProvider.cs
- Executor.cs
- MainMenu.cs
- Action.cs
- EmbeddedMailObjectsCollection.cs
- TextOptions.cs
- DataGridDesigner.cs
- Constraint.cs
- DataTableCollection.cs
- WindowsListViewItem.cs
- TreeNodeCollectionEditorDialog.cs
- OracleDataAdapter.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- OdbcConnectionOpen.cs
- SqlConnectionString.cs
- X509CertificateTrustedIssuerElementCollection.cs
- VariableQuery.cs
- ConditionalAttribute.cs
- NullableIntMinMaxAggregationOperator.cs
- TextDecorationCollectionConverter.cs
- EntityEntry.cs
- AndCondition.cs
- HtmlInputButton.cs
- Graphics.cs
- Size3D.cs
- ObjectManager.cs
- XhtmlBasicListAdapter.cs
- OletxTransactionManager.cs
- ConstraintManager.cs
- HandlerWithFactory.cs
- Control.cs
- SafeNativeMethods.cs
- EventManager.cs
- XmlSerializer.cs
- _SSPIWrapper.cs
- EventProxy.cs
- HexParser.cs
- MissingManifestResourceException.cs
- FixedTextView.cs
- UserInitiatedNavigationPermission.cs
- MulticastNotSupportedException.cs
- RegistryConfigurationProvider.cs
- TileModeValidation.cs
- WpfWebRequestHelper.cs
- CodeRegionDirective.cs
- CodeIndexerExpression.cs
- XmlWrappingReader.cs
- _Win32.cs
- ExpressionValueEditor.cs
- DiffuseMaterial.cs
- LocationReference.cs
- ILGenerator.cs
- ExpressionPrefixAttribute.cs
- DllNotFoundException.cs
- PropertyBuilder.cs
- QilScopedVisitor.cs
- DesignerVerbToolStripMenuItem.cs
- WhitespaceRuleLookup.cs
- CodeSnippetTypeMember.cs
- ResXDataNode.cs
- compensatingcollection.cs
- HttpGetProtocolImporter.cs
- CodeCompileUnit.cs
- InputBindingCollection.cs
- LostFocusEventManager.cs
- TreeViewHitTestInfo.cs
- PreservationFileWriter.cs
- AssociatedControlConverter.cs
- XmlHierarchicalDataSourceView.cs
- JulianCalendar.cs
- PrimitiveType.cs
- itemelement.cs
- ToolTipService.cs
- Timer.cs
- EntityCommand.cs
- AutoResetEvent.cs
- CodePropertyReferenceExpression.cs
- Visual3DCollection.cs
- TransformerConfigurationWizardBase.cs
- WorkflowServiceHost.cs
- XmlToDatasetMap.cs
- WebBaseEventKeyComparer.cs
- SQLInt64Storage.cs
- PropertyDescriptorCollection.cs
- ThreadExceptionEvent.cs
- WebPartConnectVerb.cs
- DelegateHelpers.cs
- EntitySetRetriever.cs
- FilterableAttribute.cs
- HtmlTableCell.cs
- AssertFilter.cs
- Context.cs
- localization.cs
- DataListCommandEventArgs.cs
- HyperLink.cs
- ReferentialConstraintRoleElement.cs