public override string ToString() { #if DEBUG && (WINDOWS || PC) string decisionString = null; IScriptDecision decisionToUse = Decision; if (Decision is DecisionOrList) { bool isFirst = true; foreach (var decision in ((DecisionOrList)Decision).Decisions) { if (isFirst) { isFirst = false; } else { decisionString += " || "; } decisionString += GetStringForScriptDecision(decision); } } else { decisionString = GetStringForScriptDecision(decisionToUse); } return(decisionString + " (" + Actions.Count + ")"); #else return("Script with " + " (" + Actions.Count + ")"); #endif }
private static string GetStringForScriptDecision(IScriptDecision decisionToUse) { string decisionString = ""; if (decisionToUse is GeneralDecision) { decisionString = ((GeneralDecision)decisionToUse).Name; } // Handled in DecisionAndList.cs //else if (decisionToUse is DecisionAndList) //{ // decisionString = GetDecisionAndToString(decisionToUse); //} if (string.IsNullOrEmpty(decisionString)) { Type type = decisionToUse.GetType(); Type toStringDeclaringType = type.GetMethod("ToString").DeclaringType; if (toStringDeclaringType != typeof(object) && toStringDeclaringType != typeof(Script)) { decisionString = decisionToUse.ToString(); } else { decisionString = decisionToUse.GetType().Name; } } return(decisionString); }
protected void RemoveScriptByDecision(IScriptDecision decision) { for (int i = 0; i < Scripts.Count; i++) { Script script = Scripts[i]; if (script.ContainsDecision(decision)) { Scripts.RemoveAt(i); break; } } }
public bool ContainsDecision(IScriptDecision decision) { if (decision == Decision) { return true; } else if (Decision is IDecisionList) { if (((IDecisionList)Decision).Contains(decision)) { return true; } } return false; }
public bool ContainsDecision(IScriptDecision decision) { if (decision == Decision) { return(true); } else if (Decision is IDecisionList) { if (((IDecisionList)Decision).Contains(decision)) { return(true); } } return(false); }
public IScriptDecision AddDecision(IScriptDecision decision) { //Need to end do section when in simple mode EndActiveIf(); if (_inActionRegion) { var oldScript = CurrentScript; CurrentScript = new Script { Parent = oldScript }; oldScript.Actions.Add(CurrentScript); } CurrentDecision.AddDecision(decision); return(decision); }
public void AddDecision(IScriptDecision decision) { throw new System.NotImplementedException(); }
public bool Contains(IScriptDecision decision) { return false; }
private static string GetStringForScriptDecision(IScriptDecision decisionToUse) { string decisionString = ""; if (decisionToUse is GeneralDecision) { decisionString = ((GeneralDecision)decisionToUse).Name; } // Handled in DecisionAndList.cs //else if (decisionToUse is DecisionAndList) //{ // decisionString = GetDecisionAndToString(decisionToUse); //} if (string.IsNullOrEmpty(decisionString)) { Type type = decisionToUse.GetType(); Type toStringDeclaringType = type.GetMethod("ToString").DeclaringType; if (toStringDeclaringType != typeof(object) && toStringDeclaringType != typeof(Script)) { decisionString = decisionToUse.ToString(); } else { decisionString = decisionToUse.GetType().Name; } } return decisionString; }
public void AddDecision(IScriptDecision decision) { _decisions.Add(decision); }
public IScriptDecision AddDecision(IScriptDecision decision) { //Need to end do section when in simple mode EndActiveIf(); if (_inActionRegion) { var oldScript = CurrentScript; CurrentScript = new Script {Parent = oldScript}; oldScript.Actions.Add(CurrentScript); } CurrentDecision.AddDecision(decision); return decision; }
public bool Contains(IScriptDecision decision) { return(_decisions.Contains(decision)); }
public bool Contains(IScriptDecision decision) { return _decisions.Contains(decision); }
public bool Contains(IScriptDecision decision) { return(false); }