Exemplo n.º 1
0
 public static void Check <T1, T2, T3>(Ref3Action <T1, T2, T3> action, T1 t1, T2 t2, ref T3 t3)
 {
     try
     {
         action.Invoke(t1, t2, ref t3);
     }
     finally
     {
         WriteDebug(action, t1, t2, t3);
         ThrowIfError(action);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Crée un lien référentiel - Action.
        /// </summary>
        /// <param name="referential">Le référentiel.</param>
        /// <param name="action">L'action</param>
        /// <param name="quantity">La quantité.</param>
        /// <returns>Le lien.</returns>
        public static IReferentialActionLink CreateReferentialActionLink(IMultipleActionReferential referential, KAction action, int quantity)
        {
            IReferentialActionLink al;
            IList list;

            if (referential is Ref1)
            {
                al   = new Ref1Action();
                list = action.Ref1;
            }
            else if (referential is Ref2)
            {
                al   = new Ref2Action();
                list = action.Ref2;
            }
            else if (referential is Ref3)
            {
                al   = new Ref3Action();
                list = action.Ref3;
            }
            else if (referential is Ref4)
            {
                al   = new Ref4Action();
                list = action.Ref4;
            }
            else if (referential is Ref5)
            {
                al   = new Ref5Action();
                list = action.Ref5;
            }
            else if (referential is Ref6)
            {
                al   = new Ref6Action();
                list = action.Ref6;
            }
            else if (referential is Ref7)
            {
                al   = new Ref7Action();
                list = action.Ref7;
            }
            else
            {
                throw new ArgumentOutOfRangeException(nameof(referential));
            }

            al.Action      = action;
            al.Referential = referential;
            al.Quantity    = quantity;

            list.Add(al);

            return(al);
        }