Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Model / PropertyChange.cs / 1305376 / PropertyChange.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.Model { using System; using System.Collections.Generic; using System.Text; using System.Globalization; using System.Runtime; class PropertyChange : ModelChange { public ModelItem Owner { get; set; } public string PropertyName { get; set; } public ModelItem OldValue { get; set; } public ModelItem NewValue { get; set; } public ModelTreeManager ModelTreeManager { get; set; } public override string Description { get { return string.Format(CultureInfo.InvariantCulture, "{0} - {1}", SR.PropertyChangeEditingScopeDescription, this.PropertyName); } } public override bool Apply() { Fx.Assert(this.ModelTreeManager != null, "Modeltreemanager cannot be null"); Fx.Assert(this.Owner != null, "Owner modelitem cannot be null"); Fx.Assert(!String.IsNullOrEmpty(this.PropertyName), " property name cannot be null or emptry"); ModelPropertyImpl dataModelProperty = (ModelPropertyImpl)this.Owner.Properties[this.PropertyName]; ModelItem oldValue = dataModelProperty.Value; if ((oldValue == null && this.NewValue == null) || (oldValue != null && this.NewValue != null && oldValue.GetCurrentValue().Equals(this.NewValue.GetCurrentValue()))) { return false; } dataModelProperty.SetValueCore(this.NewValue); this.ModelTreeManager.NotifyPropertyChange(dataModelProperty); return true; } public override Change GetInverse() { return new PropertyChange() { ModelTreeManager = this.ModelTreeManager, Owner = this.Owner, OldValue = this.NewValue, NewValue = this.OldValue, PropertyName = this.PropertyName }; } } } // 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
- HwndHostAutomationPeer.cs
- RowToParametersTransformer.cs
- X509Certificate2Collection.cs
- IsolatedStorageFileStream.cs
- RuntimeHandles.cs
- HtmlInputFile.cs
- ListenDesigner.cs
- XmlDocumentSchema.cs
- TrustManager.cs
- TakeOrSkipWhileQueryOperator.cs
- TextSearch.cs
- DataGridViewTopLeftHeaderCell.cs
- DataServiceQueryOfT.cs
- FixedFindEngine.cs
- BulletChrome.cs
- MenuItem.cs
- DisplayNameAttribute.cs
- SqlNodeAnnotations.cs
- DependencyPropertyAttribute.cs
- ChangeDirector.cs
- RelationshipFixer.cs
- AssertSection.cs
- RegexInterpreter.cs
- SerializerWriterEventHandlers.cs
- CreatingCookieEventArgs.cs
- ZipIOExtraField.cs
- TextBox.cs
- TerminatorSinks.cs
- ExpressionPrinter.cs
- DBConnectionString.cs
- CacheOutputQuery.cs
- TriggerAction.cs
- TabPage.cs
- RemotingAttributes.cs
- MatrixIndependentAnimationStorage.cs
- SizeConverter.cs
- ExplicitDiscriminatorMap.cs
- Attributes.cs
- RSAOAEPKeyExchangeFormatter.cs
- Expression.cs
- MetaChildrenColumn.cs
- fixedPageContentExtractor.cs
- TextDecoration.cs
- CustomValidator.cs
- Accessible.cs
- KeyedCollection.cs
- IPPacketInformation.cs
- HyperLinkField.cs
- Positioning.cs
- SecurityBindingElementImporter.cs
- AmbientProperties.cs
- AssemblyHash.cs
- PageTheme.cs
- IPCCacheManager.cs
- KeyPullup.cs
- WindowsGraphics2.cs
- StreamWriter.cs
- CaretElement.cs
- PartialTrustVisibleAssemblyCollection.cs
- DataGridViewTextBoxEditingControl.cs
- DataGridViewMethods.cs
- GenericRootAutomationPeer.cs
- XmlDataSourceNodeDescriptor.cs
- WS2007FederationHttpBindingElement.cs
- XNodeSchemaApplier.cs
- SkinBuilder.cs
- SqlServices.cs
- FileUpload.cs
- DataRecord.cs
- ToolboxCategoryItems.cs
- FileInfo.cs
- XPathNodeIterator.cs
- RegisteredHiddenField.cs
- SHA512CryptoServiceProvider.cs
- MailDefinition.cs
- StringConcat.cs
- Transform3DGroup.cs
- SignHashRequest.cs
- RowSpanVector.cs
- SortDescriptionCollection.cs
- LinkTarget.cs
- SoapIncludeAttribute.cs
- GeometryConverter.cs
- UrlMappingsSection.cs
- ColumnMapVisitor.cs
- SystemUnicastIPAddressInformation.cs
- MenuItemStyle.cs
- ConfigurationFileMap.cs
- ClosableStream.cs
- Condition.cs
- dbenumerator.cs
- XPathQilFactory.cs
- DynamicMethod.cs
- NamedObject.cs
- PointHitTestParameters.cs
- DockAndAnchorLayout.cs
- ResourceDisplayNameAttribute.cs
- CompoundFileReference.cs
- HashFinalRequest.cs
- __Filters.cs