コード例 #1
0
        /// <summary>
        /// Callback for changes in the property given to the MonitorProperty(...) method.
        /// Used to print out all changes in the console.
        /// </summary>
        /// <param name="e">The callback arguments.</param>
        private static void PropertyChangeCallback(PropertyChangedCallbackArgs e)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Property \"{0}\" of source \"{1}\" changed from ", e.Handle.Path, e.Handle.Source);

            if (e.OldValue != null)
            {
                sb.AppendFormat("\"{0}\"", e.OldValue.ToString());
            }
            else
            {
                sb.Append("null");
            }

            sb.Append(" to ");
            if (e.NewValue != null)
            {
                sb.AppendFormat("\"{0}\".", e.NewValue.ToString());
            }
            else
            {
                sb.Append("null.");
            }

            Debug.WriteLine(sb.ToString());
        }
コード例 #2
0
        public UniversalEventCallbackArgs(UniversalEventHandle handle, PropertyChangedCallbackArgs args)
        {
            if (handle == null)
            {
                throw new ArgumentNullException("handle");
            }
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            this.Handle = handle;
            this.PropertyChangedCallbackArgs = args;
        }
コード例 #3
0
ファイル: DumbBinding.cs プロジェクト: SmaSTra/SmaSTra
 /// <summary>
 /// Called when the source property's value changed.
 /// </summary>
 /// <param name="args">The PropertyChangedCallbackArgs.</param>
 private void OnSourceValueChanged(PropertyChangedCallbackArgs args)
 {
     this.UpdateTarget();
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CollectionObservationCallbackArgs"/> class.
 /// </summary>
 /// <param name="handle">The CollectionObservationHandle instance that is assiciated with the callback.</param>
 /// <param name="propertyChangedCallbackArgs">The PropertyChangedCallbackArgs instance that was caused by a property change.</param>
 public CollectionObservationCallbackArgs(CollectionObservationHandle handle, PropertyChangedCallbackArgs propertyChangedCallbackArgs)
 {
     this.ChangeType = ChangeType.PropertyChanged;
     this.Handle     = handle;
     this.PropertyChangedCallbackArgs = propertyChangedCallbackArgs;
 }
コード例 #5
0
 /// <summary>
 /// Called when the monitored property changes its' value.
 /// </summary>
 /// <param name="e">The callback arguments of the property change.</param>
 private void OnMonitoredPropertyChanged(PropertyChangedCallbackArgs e)
 {
     this.UpdateCollectionChangedEventHandler(e.OldValue as INotifyCollectionChanged, e.NewValue as INotifyCollectionChanged);
     this.Callback(new CollectionObservationCallbackArgs(this, e));
 }
コード例 #6
0
 private void OnPropertyChanged(PropertyChangedCallbackArgs args)
 {
     this.Callback(new UniversalEventCallbackArgs(this, args));
 }
コード例 #7
0
 public void OnPropertyChanged(PropertyChangedCallbackArgs args)
 {
     this.Owner.OnPropertyChanged(this.Index, args.NewValue);
 }