protected override object RunBlock() { object obj = (base.paramBlocks[0] == null) ? base.DefaultParamVals[0] : base.paramBlocks[0].Run(); object obj2 = (base.paramBlocks[1] == null) ? base.DefaultParamVals[1] : base.paramBlocks[1].Run(); try { return(BloxUtil.IsEqual(obj, obj2, true)); } catch (Exception ex) { base.LogError("The values [" + obj + "] and [" + obj2 + "] can't be compared. " + ex.Message, null); return(false); } }
public static int ArrayIndexOf(Array arr, object value) { if (arr == null) { return(-1); } Type elementType = arr.GetType().GetElementType(); if (value != null && value.GetType() != elementType) { BloxUtil.TryConvert(value, elementType, out value); } for (int i = 0; i < arr.Length; i++) { if (BloxUtil.IsEqual(arr.GetValue(i), value, false)) { return(i); } } return(-1); }