Example #1
0
        internal bool InvokeWorldChristmasCheck(ref bool xmasCheck)
        {
            ChristmasCheckEventArgs args = new ChristmasCheckEventArgs
            {
                Xmas = xmasCheck
            };

            this.WorldChristmasCheck.Invoke(args);

            xmasCheck = args.Xmas;
            return(args.Handled);
        }
Example #2
0
        /// <summary>OnXmasCheck - Internal hook fired when the XMasCheck happens.</summary>
        /// <param name="args">args - The ChristmasCheckEventArgs object.</param>
        private void OnXmasCheck(ChristmasCheckEventArgs args)
        {
            if (args.Handled)
                return;

            if (Config.ForceXmas)
            {
                args.Xmas = true;
                args.Handled = true;
            }
        }
Example #3
0
		internal bool InvokeWorldChristmasCheck(ref bool xmasCheck)
		{
			ChristmasCheckEventArgs args = new ChristmasCheckEventArgs
			{
				Xmas = xmasCheck
			};

			this.WorldChristmasCheck.Invoke(args);

			xmasCheck = args.Xmas;
			return args.Handled;
		}
Example #4
0
 /// <summary>
 /// WorldChristmasCheck callback.
 /// </summary>
 /// <param name="args"></param>
 private void OnWorldChristmasCheck(ChristmasCheckEventArgs args)
 {
     lock (this.m_AddonsLock)
     {
         this.m_Addons.ForEach(a =>
             {
                 var ret = a.Value.InvokeEvent("WorldChristmasCheck", args);
                 if (ret != null && ret.Length >= 1)
                 {
                     bool result;
                     if (bool.TryParse(ret[0].ToString(), out result) && result)
                         args.Handled = true;
                 }
             });
     }
 }