public GeneralDecision CreateGeneralDecision(Func <bool> func, string displayText) { GeneralDecision generalDecision = new GeneralDecision(); generalDecision.ConditionFunc = func; #if DEBUG && (PC || WINDOWS) if (string.IsNullOrEmpty(displayText)) { StackTrace stackTrace = new StackTrace(); StackFrame[] stackFrames = stackTrace.GetFrames(); generalDecision.Name = stackFrames[2].GetMethod().Name; } else { generalDecision.Name = displayText; } #endif AddDecision(generalDecision); return(generalDecision); }
public GeneralDecision CreateGeneralDecision(Func<bool> func, string displayText) { GeneralDecision generalDecision = new GeneralDecision(); generalDecision.ConditionFunc = func; #if DEBUG && (PC || WINDOWS) if (string.IsNullOrEmpty(displayText)) { StackTrace stackTrace = new StackTrace(); StackFrame[] stackFrames = stackTrace.GetFrames(); generalDecision.Name = stackFrames[2].GetMethod().Name; } else { generalDecision.Name = displayText; } #endif AddDecision(generalDecision); return generalDecision; }