Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Base / Extensibility / Model / PropertyIdentifier.cs / 1305376 / PropertyIdentifier.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Activities.Presentation.Model {
using System;
using System.Windows;
using System.Runtime;
using System.Activities.Presentation;
using System.Diagnostics.CodeAnalysis;
///
/// A PropertyIdentifier is an object that represents a property. Properties
/// can be identified by name or by dependency property. Where possible,
/// you should use dependency properties as they provide higher fidelity.
///
[SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUninstantiatedInternalClasses, Justification = "False posistive, used as generic parameter.")]
[Fx.Tag.XamlVisible(false)]
class PropertyIdentifier
{
private string _name;
private DependencyProperty _property;
///
/// Creates a new PropertyIdentifier.
///
public PropertyIdentifier(string name) {
if (name == null) throw FxTrace.Exception.ArgumentNull("name");
_name = name;
}
///
/// Creates a new PropertyIdentifier.
///
public PropertyIdentifier(DependencyProperty property) {
if (property == null) throw FxTrace.Exception.ArgumentNull("property");
_property = property;
_name = _property.Name;
}
///
/// The property name. This will either be the supplied name or the
/// name of the dependency property. It will never be null.
///
public string Name {
get { return _name; }
}
///
/// The dependency property this identifier represents. This
/// can be null if the property identifier was not initialized
/// with a dependency property.
///
public DependencyProperty DependencyProperty {
get { return _property; }
}
///
/// Overrride of GetHashCode.
///
public override int GetHashCode() {
return _name.GetHashCode();
}
///
/// Override of Equals to properly implement object equality for
/// PropertyIdentifier.
///
public override bool Equals(object obj) {
PropertyIdentifier other = obj as PropertyIdentifier;
if (other == null) return false;
if (_property != null && _property == other._property) return true;
if (_name.Equals(other._name, StringComparison.Ordinal)) return true;
return false;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Activities.Presentation.Model {
using System;
using System.Windows;
using System.Runtime;
using System.Activities.Presentation;
using System.Diagnostics.CodeAnalysis;
///
/// A PropertyIdentifier is an object that represents a property. Properties
/// can be identified by name or by dependency property. Where possible,
/// you should use dependency properties as they provide higher fidelity.
///
[SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUninstantiatedInternalClasses, Justification = "False posistive, used as generic parameter.")]
[Fx.Tag.XamlVisible(false)]
class PropertyIdentifier
{
private string _name;
private DependencyProperty _property;
///
/// Creates a new PropertyIdentifier.
///
public PropertyIdentifier(string name) {
if (name == null) throw FxTrace.Exception.ArgumentNull("name");
_name = name;
}
///
/// Creates a new PropertyIdentifier.
///
public PropertyIdentifier(DependencyProperty property) {
if (property == null) throw FxTrace.Exception.ArgumentNull("property");
_property = property;
_name = _property.Name;
}
///
/// The property name. This will either be the supplied name or the
/// name of the dependency property. It will never be null.
///
public string Name {
get { return _name; }
}
///
/// The dependency property this identifier represents. This
/// can be null if the property identifier was not initialized
/// with a dependency property.
///
public DependencyProperty DependencyProperty {
get { return _property; }
}
///
/// Overrride of GetHashCode.
///
public override int GetHashCode() {
return _name.GetHashCode();
}
///
/// Override of Equals to properly implement object equality for
/// PropertyIdentifier.
///
public override bool Equals(object obj) {
PropertyIdentifier other = obj as PropertyIdentifier;
if (other == null) return false;
if (_property != null && _property == other._property) return true;
if (_name.Equals(other._name, StringComparison.Ordinal)) return true;
return false;
}
}
}
// 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
- MessageQueuePermissionAttribute.cs
- HwndSubclass.cs
- XomlSerializationHelpers.cs
- _SingleItemRequestCache.cs
- BindingExpressionUncommonField.cs
- Parser.cs
- PtsHelper.cs
- DataGridLinkButton.cs
- ReachFixedDocumentSerializer.cs
- CheckBoxFlatAdapter.cs
- RtfNavigator.cs
- WebAdminConfigurationHelper.cs
- BrushValueSerializer.cs
- DocumentOrderComparer.cs
- FilterException.cs
- DuplicateWaitObjectException.cs
- StaticSiteMapProvider.cs
- TypeConstant.cs
- OdbcConnectionPoolProviderInfo.cs
- ClickablePoint.cs
- ConstraintEnumerator.cs
- HtmlTableRowCollection.cs
- PropertyInformation.cs
- WinEventHandler.cs
- ToolStripItemEventArgs.cs
- IIS7UserPrincipal.cs
- XPathBinder.cs
- Math.cs
- InputBindingCollection.cs
- NTAccount.cs
- OrderByBuilder.cs
- TextOnlyOutput.cs
- AssertFilter.cs
- prefixendpointaddressmessagefiltertable.cs
- ListViewCancelEventArgs.cs
- regiisutil.cs
- HighlightVisual.cs
- DetailsViewPageEventArgs.cs
- SymbolType.cs
- Tile.cs
- WebUtil.cs
- AnnotationResource.cs
- TableHeaderCell.cs
- AssertUtility.cs
- StrongNameKeyPair.cs
- GacUtil.cs
- PictureBox.cs
- SkewTransform.cs
- GreenMethods.cs
- OdbcTransaction.cs
- SqlDataSourceView.cs
- NewArray.cs
- TerminatorSinks.cs
- DataSourceCacheDurationConverter.cs
- FocusWithinProperty.cs
- DesignerRegion.cs
- XmlUtf8RawTextWriter.cs
- InstanceView.cs
- Pointer.cs
- OpenTypeLayout.cs
- XmlSchemaSimpleType.cs
- TextFormatterImp.cs
- CodeCompileUnit.cs
- PriorityQueue.cs
- IISMapPath.cs
- DbDataSourceEnumerator.cs
- DocumentSchemaValidator.cs
- ObjectStateFormatter.cs
- AutomationProperties.cs
- RegexStringValidator.cs
- SqlWebEventProvider.cs
- TimeSpanConverter.cs
- EventEntry.cs
- ConnectionStringSettingsCollection.cs
- LinearGradientBrush.cs
- EditableRegion.cs
- HitTestWithGeometryDrawingContextWalker.cs
- LinearGradientBrush.cs
- GreenMethods.cs
- IFlowDocumentViewer.cs
- XmlCharType.cs
- SafeHandle.cs
- EventsTab.cs
- SqlGenericUtil.cs
- SafeTimerHandle.cs
- MdiWindowListItemConverter.cs
- TreeNodeClickEventArgs.cs
- SmtpDigestAuthenticationModule.cs
- NativeMethods.cs
- DtdParser.cs
- Triangle.cs
- DataControlCommands.cs
- DisplayMemberTemplateSelector.cs
- GreenMethods.cs
- dataobject.cs
- File.cs
- DataGridViewSelectedColumnCollection.cs
- WorkflowMessageEventArgs.cs
- TCPClient.cs
- Color.cs