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
- RuntimeArgument.cs
- BaseCodePageEncoding.cs
- WebColorConverter.cs
- AsyncMethodInvoker.cs
- MemoryMappedView.cs
- IdentityHolder.cs
- MimeReturn.cs
- RootProfilePropertySettingsCollection.cs
- ToolStripPanelRenderEventArgs.cs
- TableLayoutStyleCollection.cs
- ValidationContext.cs
- SetUserPreferenceRequest.cs
- CodeTypeParameterCollection.cs
- Point3DValueSerializer.cs
- CallTemplateAction.cs
- Control.cs
- SqlBuilder.cs
- SafeEventLogReadHandle.cs
- ToolStripItemCollection.cs
- RegisteredHiddenField.cs
- SchemaInfo.cs
- Debugger.cs
- BindStream.cs
- ExpressionVisitor.cs
- RadioButtonFlatAdapter.cs
- WindowsUpDown.cs
- WebEventCodes.cs
- JumpPath.cs
- EventLogConfiguration.cs
- ChannelPoolSettingsElement.cs
- XpsFixedPageReaderWriter.cs
- DataServiceRequest.cs
- LinkTarget.cs
- CardSpaceShim.cs
- activationcontext.cs
- DocumentPaginator.cs
- ByteStreamGeometryContext.cs
- Mouse.cs
- RepeatButton.cs
- WinFormsComponentEditor.cs
- XmlElementList.cs
- ContentType.cs
- SQLDoubleStorage.cs
- Attributes.cs
- metadatamappinghashervisitor.cs
- SoundPlayerAction.cs
- AuthenticationModeHelper.cs
- CryptographicAttribute.cs
- PageAsyncTaskManager.cs
- returneventsaver.cs
- _SSPIWrapper.cs
- BuildResultCache.cs
- AuthorizationRule.cs
- XmlILOptimizerVisitor.cs
- HttpContext.cs
- AdRotator.cs
- ScrollViewerAutomationPeer.cs
- TextEditorSpelling.cs
- PeerPresenceInfo.cs
- WebPartsSection.cs
- RSAPKCS1SignatureDeformatter.cs
- CompilerCollection.cs
- GenericsNotImplementedException.cs
- OdbcHandle.cs
- AttributeInfo.cs
- DoubleUtil.cs
- RoleManagerEventArgs.cs
- WS2007FederationHttpBinding.cs
- FlowLayout.cs
- TextParaLineResult.cs
- TraceFilter.cs
- NavigatorInput.cs
- AsymmetricSignatureFormatter.cs
- XamlTemplateSerializer.cs
- DataKeyCollection.cs
- OdbcConnectionPoolProviderInfo.cs
- DataObject.cs
- ListViewItemSelectionChangedEvent.cs
- NativeMethods.cs
- FontWeights.cs
- UndoManager.cs
- VisualBasicValue.cs
- ReadOnlyCollection.cs
- MultiByteCodec.cs
- DataGridViewCellLinkedList.cs
- AppDomain.cs
- WindowsRegion.cs
- Win32.cs
- Serializer.cs
- DurationConverter.cs
- QilInvoke.cs
- DataGridViewButtonCell.cs
- RTLAwareMessageBox.cs
- LogPolicy.cs
- EntityObject.cs
- MiniParameterInfo.cs
- JavaScriptObjectDeserializer.cs
- VoiceSynthesis.cs
- xmlsaver.cs
- elementinformation.cs