Ejemplo n.º 1
0
 private void                    RaiseChangedKeyEvent
 (
     tIndexedItem item,
     tIndexKeyType oldKeyValue,
     tIndexKeyType newKeyValue
 )
 {
     foreach (ChangedKeyDelegate listener in this.changedKeyListeners)
     {
         listener(item, oldKeyValue, newKeyValue);
     }
 }
Ejemplo n.º 2
0
            public void                    SetValue(tIndexKeyType value)
            {
                Throw <System.ArgumentException> .If(value == null, "Indexed list can only hold items with non-null item keys");

                if (value.Equals(this.value))
                {
                    return;
                }

                Throw <System.ArgumentException> .If(this.RaiseChangingKeyEvent(this.item, this.value, value).IsCanceled, "Updated was canceled.  Duplicate key was encountered in a list containing this item.");

                this.RaiseChangedKeyEvent(item, this.value, this.value = value);
            }
Ejemplo n.º 3
0
            private IndexKeyChangingEventArgs   RaiseChangingKeyEvent
            (
                tIndexedItem item,
                tIndexKeyType oldKeyValue,
                tIndexKeyType newKeyValue
            )
            {
                IndexKeyChangingEventArgs args = new IndexKeyChangingEventArgs();

                foreach (ChangingKeyDelegate listener in this.changingKeyListeners)
                {
                    listener(item, oldKeyValue, newKeyValue, args);
                    if (args.IsCanceled)
                    {
                        break;
                    }
                }
                return(args);
            }