示例#1
0
        public bool Equals(CoResult <T> b)
        {
            bool excEqual, valEqual;

            if (!Object.ReferenceEquals(Exception, null))
            {
                if (!Object.ReferenceEquals(b.Exception, null))
                {
                    excEqual = b.Exception.GetType() == Exception.GetType();
                }
                excEqual = false;
            }
            else
            {
                excEqual = Object.ReferenceEquals(b.Exception, null);
            }
            if (!Object.ReferenceEquals(ReturnValue, null))
            {
                valEqual = ReturnValue.Equals(b.ReturnValue);
            }
            else
            {
                valEqual = Object.ReferenceEquals(b.ReturnValue, null);
            }
            return(excEqual && valEqual && b.Status == Status);
        }
示例#2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            CoResult <T>?b = obj as CoResult <T>?;

            if ((System.Object)b == null)
            {
                return(false);
            }

            bool excEqual, valEqual;

            if (!Object.ReferenceEquals(Exception, null))
            {
                if (!Object.ReferenceEquals(b.Value.Exception, null))
                {
                    excEqual = b.Value.Exception.GetType() == Exception.GetType();
                }
                excEqual = false;
            }
            else
            {
                excEqual = Object.ReferenceEquals(b.Value.Exception, null);
            }
            if (!Object.ReferenceEquals(ReturnValue, null))
            {
                valEqual = ReturnValue.Equals(b.Value.ReturnValue);
            }
            else
            {
                valEqual = Object.ReferenceEquals(b.Value.ReturnValue, null);
            }
            return(excEqual && valEqual && b.Value.Status == Status);
        }