Skip Ribbon Commands
Skip to main content

Ondrej Sevecek's English Pages


Comments: One further change

Engineering and troubleshooting by Directory Master!
MCM: Directory

Sorry comments are disable due to the constant load of spam



One further change


Doug Kaye (


Actually if one of o1 and o2 is a value type and the other is not then my code throws an exception. The following solves that issue;

          static new bool Equals(object o1, object o2)
            if (o1?.GetType().IsValueType.Equals(o2?.GetType().IsValueType) ?? false)
                System.Reflection.MethodInfo method = o1.GetType().GetMethod("Equals", new Type[] { o1.GetType() });
                if (method == null) method = o1.GetType().GetMethod("Equals");
                if (method != null)
                    return (bool)method.Invoke(o1, new object[] { o2 });
                    return false;
                return (o1 is null && o2 is null);


Created at 28/09/2018 21:44 by  
Last modified at 28/09/2018 21:44 by