Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / System / ComponentModel / DataObjectMethodAttribute.cs / 1 / DataObjectMethodAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.ComponentModel {
using System;
using System.Security.Permissions;
///
///
[AttributeUsage(AttributeTargets.Method)]
public sealed class DataObjectMethodAttribute : Attribute {
private bool _isDefault;
private DataObjectMethodType _methodType;
public DataObjectMethodAttribute(DataObjectMethodType methodType) : this(methodType, false) {
}
public DataObjectMethodAttribute(DataObjectMethodType methodType, bool isDefault) {
_methodType = methodType;
_isDefault = isDefault;
}
public bool IsDefault {
get {
return _isDefault;
}
}
public DataObjectMethodType MethodType {
get {
return _methodType;
}
}
///
public override bool Equals(object obj) {
if (obj == this) {
return true;
}
DataObjectMethodAttribute other = obj as DataObjectMethodAttribute;
return (other != null) && (other.MethodType == MethodType) && (other.IsDefault == IsDefault);
}
///
public override int GetHashCode() {
return ((int)_methodType).GetHashCode() ^ _isDefault.GetHashCode();
}
///
public override bool Match(object obj) {
if (obj == this) {
return true;
}
DataObjectMethodAttribute other = obj as DataObjectMethodAttribute;
return (other != null) && (other.MethodType == MethodType);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.ComponentModel {
using System;
using System.Security.Permissions;
///
///
[AttributeUsage(AttributeTargets.Method)]
public sealed class DataObjectMethodAttribute : Attribute {
private bool _isDefault;
private DataObjectMethodType _methodType;
public DataObjectMethodAttribute(DataObjectMethodType methodType) : this(methodType, false) {
}
public DataObjectMethodAttribute(DataObjectMethodType methodType, bool isDefault) {
_methodType = methodType;
_isDefault = isDefault;
}
public bool IsDefault {
get {
return _isDefault;
}
}
public DataObjectMethodType MethodType {
get {
return _methodType;
}
}
///
public override bool Equals(object obj) {
if (obj == this) {
return true;
}
DataObjectMethodAttribute other = obj as DataObjectMethodAttribute;
return (other != null) && (other.MethodType == MethodType) && (other.IsDefault == IsDefault);
}
///
public override int GetHashCode() {
return ((int)_methodType).GetHashCode() ^ _isDefault.GetHashCode();
}
///
public override bool Match(object obj) {
if (obj == this) {
return true;
}
DataObjectMethodAttribute other = obj as DataObjectMethodAttribute;
return (other != null) && (other.MethodType == MethodType);
}
}
}
// 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
- UrlAuthFailureHandler.cs
- SqlServer2KCompatibilityAnnotation.cs
- _SSPIWrapper.cs
- XPathNavigator.cs
- DataControlPagerLinkButton.cs
- FormsAuthenticationCredentials.cs
- NavigateEvent.cs
- FormsAuthenticationUserCollection.cs
- SamlAssertion.cs
- CheckableControlBaseAdapter.cs
- ConnectionConsumerAttribute.cs
- DataBoundLiteralControl.cs
- NameObjectCollectionBase.cs
- odbcmetadatacollectionnames.cs
- InfoCardArgumentException.cs
- MulticastIPAddressInformationCollection.cs
- ScrollViewer.cs
- DesignerSelectionListAdapter.cs
- StringBuilder.cs
- XmlJsonWriter.cs
- FunctionQuery.cs
- ToolStripSplitStackLayout.cs
- ValueUtilsSmi.cs
- CompModSwitches.cs
- EmptyReadOnlyDictionaryInternal.cs
- SymmetricSecurityProtocol.cs
- SqlClientFactory.cs
- CompositeDataBoundControl.cs
- PaintValueEventArgs.cs
- WorkflowTimerService.cs
- GrammarBuilderWildcard.cs
- UIElement3D.cs
- BinaryNode.cs
- ToolStripDropDownClosedEventArgs.cs
- ListItemConverter.cs
- BindingValueChangedEventArgs.cs
- SafeNativeMethods.cs
- SmtpNegotiateAuthenticationModule.cs
- StaticSiteMapProvider.cs
- AmbientProperties.cs
- EntityParameterCollection.cs
- CultureTable.cs
- Graph.cs
- FormViewUpdateEventArgs.cs
- PathGeometry.cs
- SequenceDesigner.cs
- ServiceContractGenerator.cs
- FileSystemEventArgs.cs
- Component.cs
- ElementUtil.cs
- RegexCode.cs
- ModelTypeConverter.cs
- _OSSOCK.cs
- CookieParameter.cs
- MimeObjectFactory.cs
- ComponentDispatcher.cs
- HttpProfileBase.cs
- Oid.cs
- Console.cs
- WebPartCancelEventArgs.cs
- FullTextLine.cs
- StickyNoteAnnotations.cs
- EmptyEnumerable.cs
- StringDictionary.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- XmlSchemaAppInfo.cs
- KnownTypes.cs
- SQLInt64Storage.cs
- DataBindingExpressionBuilder.cs
- SignatureResourcePool.cs
- SequentialOutput.cs
- LockRecursionException.cs
- ViewGenResults.cs
- WebBrowserContainer.cs
- SoapAttributeOverrides.cs
- RegexNode.cs
- DependencyPropertyDescriptor.cs
- SkinBuilder.cs
- Reference.cs
- BasePattern.cs
- QueryParameter.cs
- ButtonBase.cs
- Privilege.cs
- MultiSelectRootGridEntry.cs
- Funcletizer.cs
- DbParameterHelper.cs
- SoapAttributeAttribute.cs
- ClientUtils.cs
- GlobalizationSection.cs
- TagMapCollection.cs
- TokenBasedSetEnumerator.cs
- XamlRtfConverter.cs
- RowCache.cs
- PageTheme.cs
- XMLSyntaxException.cs
- InvalidWMPVersionException.cs
- DataGridCell.cs
- CreateRefExpr.cs
- GroupBoxAutomationPeer.cs
- InstancePersistenceCommand.cs