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
- Cursors.cs
- _Rfc2616CacheValidators.cs
- DropTarget.cs
- WebServiceParameterData.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- MenuItemCollection.cs
- EntityContainerEmitter.cs
- ConnectionPoint.cs
- SignatureDescription.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- InputBindingCollection.cs
- HttpContext.cs
- SqlDataReader.cs
- Compilation.cs
- OutputScopeManager.cs
- MetadataReference.cs
- CodeGenHelper.cs
- EntityProxyFactory.cs
- PageContentAsyncResult.cs
- ConfigXmlSignificantWhitespace.cs
- path.cs
- SystemSounds.cs
- shaperfactory.cs
- XMLUtil.cs
- SoapParser.cs
- DictionaryContent.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- NetMsmqBindingElement.cs
- WpfKnownTypeInvoker.cs
- SplashScreen.cs
- HGlobalSafeHandle.cs
- CssTextWriter.cs
- UpdateCommandGenerator.cs
- WebUtil.cs
- ValueQuery.cs
- ColorAnimation.cs
- MetadataUtilsSmi.cs
- OletxDependentTransaction.cs
- HttpBrowserCapabilitiesWrapper.cs
- TabletCollection.cs
- HtmlSelect.cs
- VisualBasicValue.cs
- UDPClient.cs
- RequestStatusBarUpdateEventArgs.cs
- MSAAWinEventWrap.cs
- InputElement.cs
- XmlIgnoreAttribute.cs
- PolyBezierSegment.cs
- SqlBulkCopyColumnMapping.cs
- RemoteArgument.cs
- TemplateLookupAction.cs
- BitmapImage.cs
- TextPattern.cs
- MimeParameters.cs
- DbParameterCollectionHelper.cs
- Sentence.cs
- AuthenticatedStream.cs
- StorageSetMapping.cs
- SystemPens.cs
- Triplet.cs
- OciLobLocator.cs
- CapiHashAlgorithm.cs
- SqlDataSourceSelectingEventArgs.cs
- BoundField.cs
- EntityDataSourceUtil.cs
- SqlClientWrapperSmiStreamChars.cs
- CodeGeneratorAttribute.cs
- EventLogPermissionEntry.cs
- EntityViewContainer.cs
- SettingsPropertyNotFoundException.cs
- SignerInfo.cs
- SchemeSettingElementCollection.cs
- ProtectedConfigurationSection.cs
- FormView.cs
- AddToCollection.cs
- UnsettableComboBox.cs
- DuplicateWaitObjectException.cs
- ADConnectionHelper.cs
- XmlSchemaDatatype.cs
- ListControlBuilder.cs
- ADMembershipProvider.cs
- Command.cs
- BinaryObjectWriter.cs
- RetrieveVirtualItemEventArgs.cs
- AppDomainFactory.cs
- CodeIdentifiers.cs
- LateBoundBitmapDecoder.cs
- ISFClipboardData.cs
- CompositeDuplexBindingElementImporter.cs
- MethodMessage.cs
- JumpTask.cs
- RightNameExpirationInfoPair.cs
- DeviceContexts.cs
- IntegerValidator.cs
- CommandPlan.cs
- TiffBitmapDecoder.cs
- AnnotationResource.cs
- TypePropertyEditor.cs
- DeflateStream.cs
- ReadOnlyDictionary.cs