User: cneuwirt
Date: 2009/11/21 12:15 PM

Modified:
 
/Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/
  AssemblyInfo.cs, DictionaryAdapterFactoryTestCase.cs
 /Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/
  AssemblyInfo.cs, DictionaryAdapterBase.Notify.cs, IDictionaryNotify.cs

Log:
 Use standard INotifyPropertyChanging

File Changes:

Directory: 
/Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/
=======================================================================================

File [modified]: AssemblyInfo.cs
Delta lines: +6 -6
===================================================================

--- 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/DictionaryAdapterBase.Notify.cs
  2009-11-21 02:00:57 UTC (rev 6344)
+++ 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/DictionaryAdapterBase.Notify.cs
  2009-11-21 19:15:07 UTC (rev 6345)
@@ -28,8 +28,8 @@
                [ThreadStatic]
                private static TrackPropertyChangeScope ReadonlyTrackingScope;
 
+               public event PropertyChangingEventHandler PropertyChanging;
         public event PropertyChangedEventHandler PropertyChanged;
-        public event PropertyChangingEventHandler PropertyChanging;
 
                public bool CanNotify { get; set; }
 
@@ -67,7 +67,7 @@
 
                                if (propertyChanging != null)
                                {
-                                       var eventArgs = new 
PropertyChangingEventArgs(property.PropertyName, oldValue, newValue);
+                                       var eventArgs = new 
PropertyModifyingEventArgs(property.PropertyName, oldValue, newValue);
                                        propertyChanging(this, eventArgs);
                                        return !eventArgs.Cancel;
                                }
@@ -140,9 +140,9 @@
                                        {
                                                
((INotifyPropertyChanged)oldValue).PropertyChanged -= Child_PropertyChanged;
 
-                                               if (oldValue is 
IDictionaryNotify)
+                                               if (oldValue is 
INotifyPropertyChanging)
                                                {
-                                                       
((IDictionaryNotify)oldValue).PropertyChanging -= Child_PropertyChanging;
+                                                       
((INotifyPropertyChanging)oldValue).PropertyChanging -= Child_PropertyChanging;
                                                }
                                        }
                                        else if (oldValue is IBindingList)
@@ -158,9 +158,9 @@
                                {
                                        
((INotifyPropertyChanged)newValue).PropertyChanged += Child_PropertyChanged;
 
-                                       if (newValue is IDictionaryNotify)
+                                       if (newValue is INotifyPropertyChanging)
                                        {
-                                               
((IDictionaryNotify)newValue).PropertyChanging += Child_PropertyChanging;
+                                               
((INotifyPropertyChanging)newValue).PropertyChanging += Child_PropertyChanging;
                                        }
 

File [modified]: DictionaryAdapterBase.Notify.cs
Delta lines: +12 -8
===================================================================

--- 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/IDictionaryNotify.cs
     2009-11-21 02:00:57 UTC (rev 6344)
+++ 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/IDictionaryNotify.cs
     2009-11-21 19:15:07 UTC (rev 6345)
@@ -35,33 +35,37 @@
 
        #endregion
 
-       #region Class PropertyChangingEventArgs
+       #region Class PropertyModifyingEventArgs
 
-       public class PropertyChangingEventArgs : PropertyModifiedEventArgs
+       public class PropertyModifyingEventArgs : PropertyChangingEventArgs
        {
-               public PropertyChangingEventArgs(String propertyName, object 
oldPropertyValue, object newPropertyValue)
-                       : base(propertyName, oldPropertyValue, newPropertyValue)
+               public PropertyModifyingEventArgs(String propertyName, object 
oldPropertyValue, object newPropertyValue)
+                       : base(propertyName)
                {
+                       OldPropertyValue = oldPropertyValue;
+                       NewPropertyValue = newPropertyValue;
                }
 
+               public object OldPropertyValue { get; private set; }
+
+               public object NewPropertyValue { get; private set; }
+
                public bool Cancel { get; set; }
        }
 
-       public delegate void PropertyChangingEventHandler(object sender, 
PropertyChangingEventArgs e);
+       public delegate void PropertyModifyingEventHandler(object sender, 
PropertyModifyingEventArgs e);
 
        #endregion
 
        /// <summary>
        /// Contract for managing Dictionary adapter notifications.
        /// </summary>
-       public interface IDictionaryNotify : INotifyPropertyChanged
+       public interface IDictionaryNotify : INotifyPropertyChanging, 
INotifyPropertyChanged
        {
                bool CanNotify { get; }
 
                bool ShouldNotify { get; }
 
-               event PropertyChangingEventHandler PropertyChanging;
-
                bool PropagateChildNotifications { get; set; }
 

File [modified]: IDictionaryNotify.cs
Delta lines: +1 -1
===================================================================

--- 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/AssemblyInfo.cs
    2009-11-21 02:00:57 UTC (rev 6344)
+++ 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/AssemblyInfo.cs
    2009-11-21 19:15:07 UTC (rev 6345)
@@ -6,7 +6,7 @@
 
//------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.4927
+//     Runtime Version:2.0.50727.3053
 //
 //     Changes to this file may cause incorrect behavior and will be lost if

Directory: 
/Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/
=============================================================================================

File [modified]: AssemblyInfo.cs
Delta lines: +1 -1
===================================================================

--- 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/DictionaryAdapterFactoryTestCase.cs
        2009-11-21 02:00:57 UTC (rev 6344)
+++ 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/DictionaryAdapterFactoryTestCase.cs
        2009-11-21 19:15:07 UTC (rev 6345)
@@ -777,7 +777,7 @@
                        var person = factory.GetAdapter<IPerson>(dictionary);
                        person.PropertyChanging += (s, e) =>
                        {
-                               e.Cancel = true;
+                               ((PropertyModifyingEventArgs)e).Cancel = true;
                        };
 

File [modified]: DictionaryAdapterFactoryTestCase.cs
Delta lines: +0 -0
===================================================================

--

You received this message because you are subscribed to the Google Groups 
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-commits?hl=.


Reply via email to