Ejemplo n.º 1
0
        /// <summary>Concatenates the invocation lists of two delegates.</summary><returns>A new delegate with an invocation list that concatenates the invocation lists of <paramref name="a" /> and <paramref name="b" /> in that order. Returns <paramref name="a" /> if <paramref name="b" /> is null, returns <paramref name="b" /> if <paramref name="a" /> is a null reference, and returns a null reference if both <paramref name="a" /> and <paramref name="b" /> are null references.</returns><param name="a">The delegate whose invocation list comes first. </param><param name="b">The delegate whose invocation list comes last. </param><exception cref="T:System.ArgumentException">Both <paramref name="a" /> and <paramref name="b" /> are not null, and <paramref name="a" /> and <paramref name="b" /> are not instances of the same delegate type. </exception><filterpriority>1</filterpriority>
        public static Delegate Combine(Delegate a, Delegate b)
        {
            if (a == null)
            {
                if (b == null)
                {
                    return(null);
                }
                else
                {
                    return(b);
                }
            }
            else if (b == null)
            {
                return(a);
            }

            if (a.getClass().getName() != b.getClass().getName())
            {
                throw new ArgumentException(Local.GetText("Incompatible Delegate Types. First is {0} second is {1}.", a.getClass().getName(), b.getClass().getName()));
            }

            return(a.CombineImpl(b));
        }
Ejemplo n.º 2
0
 public RuntimeTypeHandle GetNextArgType()
 {
     if (current >= arglist.Length)
     {
         throw new InvalidOperationException(Local.GetText("An attempt was made to read beyond the end of the list."));
     }
     return(new RuntimeTypeHandle(arglist[current].getClass().Unbox()));
 }
Ejemplo n.º 3
0
        public RuntimeMethodHandle(java.lang.reflect.AccessibleObject method)
        {
            if ((!(method is javaConstructor)) && (!(method is javaMethod)))
            {
                throw new ArgumentException(Local.GetText("method must be java.lang.reflect.Method or java.lang.reflect.Constructor"), "method");
            }

            this.method = method;
        }
Ejemplo n.º 4
0
        public TypedReference GetNextArg()
        {
            if (current >= arglist.Length)
            {
                throw new InvalidOperationException(Local.GetText("An attempt was made to read beyond the end of the list."));
            }
            TypedReference result = new TypedReference(Intrinsics.CreatePointerToArray(arglist, current), Intrinsics.GetClass(typeof(object)));

            current++;
            return(result);
        }
Ejemplo n.º 5
0
        public override string ToString()
        {
            java.lang.StringBuilder builder = new java.lang.StringBuilder(GetClassName());
            builder.append(": ").append(Message);

            if (innerException != null)
            {
                builder.append(" ---> ").append(innerException.ToString())
                .append(Environment.NewLine).append(Local.GetText("  --- End of inner exception stack trace ---"));
            }
            if (StackTrace != null)
            {
                builder.append(Environment.NewLine).append(StackTrace);
            }
            return(builder.ToString());
        }
Ejemplo n.º 6
0
 public ArithmeticException()
     : base(Local.GetText("Overflow or underflow in the arithmetic operation."))
 {
     HResult = Result;
 }
 public MulticastNotSupportedException()
     : base(Local.GetText("This operation cannot be performed with the specified delagates."))
 {
 }
Ejemplo n.º 8
0
 public OverflowException()
     : base(Local.GetText("Number overflow."))
 {
     HResult = Result;
 }
Ejemplo n.º 9
0
 public NotImplementedException()
     : base(Local.GetText("The method or operation is not implemented."))
 {
     HResult = __HResults.E_NOTIMPL;
 }
Ejemplo n.º 10
0
 public SystemException()
     : base(Local.GetText("A system exception has occurred."))
 {
     HResult = Result;
 }