Example #1
0
        static bool RaiseMainWorldChangingEvent(World oldWorld, World newWorld)
        {
            var h = MainWorldChanging;

            if (h == null)
            {
                return(false);
            }
            var e = new MainWorldChangingEventArgs(oldWorld, newWorld);

            h(null, e);
            return(e.Cancel);
        }
Example #2
0
        private static bool RaiseMainWorldChangingEvent(World oldWorld, [NotNull] World newWorld)
        {
            if (newWorld == null)
            {
                throw new ArgumentNullException("newWorld");
            }
            var h = MainWorldChanging;

            if (h == null)
            {
                return(false);
            }
            var e = new MainWorldChangingEventArgs(oldWorld, newWorld);

            h(null, e);
            return(e.Cancel);
        }
Example #3
0
        static bool RaiseMainWorldChangingEvent(World oldWorld, [NotNull] World newWorld)
        {
            if (newWorld == null)
            {
                throw new ArgumentNullException("newWorld");
            }
            var handler = MainWorldChanging;

            if (handler == null)
            {
                return(true);
            }
            var e = new MainWorldChangingEventArgs(oldWorld, newWorld);

            handler(null, e);
            return(!e.Cancel);
        }