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
- SqlConnection.cs
- PageCodeDomTreeGenerator.cs
- SafeNativeMethods.cs
- ProfilePropertyMetadata.cs
- InstanceCreationEditor.cs
- ZipIOCentralDirectoryBlock.cs
- WebPartEditorCancelVerb.cs
- MenuItemAutomationPeer.cs
- WebPartMenuStyle.cs
- shaperfactory.cs
- TypeBuilder.cs
- CallbackHandler.cs
- Pen.cs
- TraceHandlerErrorFormatter.cs
- BinaryFormatter.cs
- CLSCompliantAttribute.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- CurrencyWrapper.cs
- MaskInputRejectedEventArgs.cs
- MessageBox.cs
- RoutedCommand.cs
- ContainerActivationHelper.cs
- DataKeyCollection.cs
- RC2.cs
- Quaternion.cs
- MimeReturn.cs
- InfiniteIntConverter.cs
- XslAstAnalyzer.cs
- GenericRootAutomationPeer.cs
- NativeMethods.cs
- SqlDataAdapter.cs
- BoolLiteral.cs
- ReadOnlyHierarchicalDataSourceView.cs
- WebPartTransformer.cs
- WsdlBuildProvider.cs
- SqlInternalConnectionSmi.cs
- DataSetMappper.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- Fault.cs
- InternalEnumValidator.cs
- GAC.cs
- HttpListenerResponse.cs
- ChannelManager.cs
- MetadataArtifactLoader.cs
- HtmlTextArea.cs
- _BaseOverlappedAsyncResult.cs
- DispatchWrapper.cs
- SqlDataSource.cs
- XmlEncodedRawTextWriter.cs
- StylusOverProperty.cs
- GroupBox.cs
- Variant.cs
- CodeTypeMemberCollection.cs
- arabicshape.cs
- OdbcConnectionHandle.cs
- TextParaLineResult.cs
- Encoding.cs
- CryptoProvider.cs
- TextElementEnumerator.cs
- CompositeFontFamily.cs
- HostSecurityManager.cs
- GiveFeedbackEvent.cs
- SplineKeyFrames.cs
- EntryIndex.cs
- RootBrowserWindowAutomationPeer.cs
- TextFormatterHost.cs
- OleDbEnumerator.cs
- ReferencedAssembly.cs
- HuffmanTree.cs
- ConditionalDesigner.cs
- WebPartActionVerb.cs
- Int16AnimationBase.cs
- DataContractSerializerSection.cs
- ItemChangedEventArgs.cs
- QuadraticEase.cs
- NameValueConfigurationCollection.cs
- DataMisalignedException.cs
- MemoryRecordBuffer.cs
- BamlLocalizationDictionary.cs
- RegexRunner.cs
- QilCloneVisitor.cs
- Sql8ExpressionRewriter.cs
- SocketInformation.cs
- TreeNode.cs
- PaperSize.cs
- PrintEvent.cs
- EntityKeyElement.cs
- ReadOnlyAttribute.cs
- Guid.cs
- Int16AnimationUsingKeyFrames.cs
- CodeGotoStatement.cs
- CombinedTcpChannel.cs
- MobileResource.cs
- RegexStringValidator.cs
- ReliabilityContractAttribute.cs
- ExpressionBuilder.cs
- NameSpaceExtractor.cs
- WindowsListBox.cs
- WmpBitmapDecoder.cs
- AutomationAttributeInfo.cs