Exemplo n.º 1
0
        protected void ClearAllEvents()
        {
            if (PropertyChanged != null)
            {
                foreach (var eventhandler in PropertyChanged.GetInvocationList())
                {
                    PropertyChanged -= (PropertyChangedEventHandler)eventhandler;
                }

                PropertyChanged = null;
            }

            if (NotifyDirty != null)
            {
                foreach (var eventhandler in NotifyDirty.GetInvocationList())
                {
                    NotifyDirty -= (System.EventHandler)eventhandler;
                }

                NotifyDirty = null;
            }

            if (ObjectChanged != null)
            {
                foreach (var eventhandler in ObjectChanged.GetInvocationList())
                {
                    ObjectChanged -= (ObjectChangedEventHandler)eventhandler;
                }

                ObjectChanged = null;
            }
        }
Exemplo n.º 2
0
        protected void NotifyPropertyChanged(string propertyName)
        {
            VerifyHasProperty(propertyName);
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));

            // Changing any property fires the NotifyDirty event.
            NotifyDirty?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="observer">Delegate to notify about settings changes</param>
 public ScannerSettings(NotifyDirty notify)
 {
     notifyDirty_ = notify;
 }