예제 #1
0
파일: Profile.cs 프로젝트: icprog/UcAsp.RPC
        protected virtual void OnChanging(ProfileChangingArgs e)
        {
            if (Changing == null)
            {
                return;
            }

            foreach (ProfileChangingHandler handler in Changing.GetInvocationList())
            {
                handler(this, e);

                // If a particular handler cancels the event, stop
                if (e.Cancel)
                {
                    break;
                }
            }
        }
예제 #2
0
파일: Profile.cs 프로젝트: icprog/UcAsp.RPC
        protected bool RaiseChangeEvent(bool changing, ProfileChangeType changeType, string section, string entry, object value)
        {
            if (changing)
            {
                // Don't even bother if there are no handlers.
                if (Changing == null)
                {
                    return(true);
                }

                ProfileChangingArgs e = new ProfileChangingArgs(changeType, section, entry, value);
                OnChanging(e);
                return(!e.Cancel);
            }

            // Don't even bother if there are no handlers.
            if (Changed != null)
            {
                OnChanged(new ProfileChangedArgs(changeType, section, entry, value));
            }
            return(true);
        }