示例#1
0
        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
        }
示例#2
0
        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;
                }
            }
        }
示例#4
0
 public bool ContainsDecision(IScriptDecision decision)
 {
     if (decision == Decision)
     {
         return true;
     }
     else if (Decision is IDecisionList)
     {
         if (((IDecisionList)Decision).Contains(decision))
         {
             return true;
         }
     }
     return false;
 }
示例#5
0
 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);
        }
示例#7
0
 public void AddDecision(IScriptDecision decision)
 {
     throw new System.NotImplementedException();
 }
示例#8
0
 public bool Contains(IScriptDecision decision)
 {
     return false;
 }
示例#9
0
        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;
        }
示例#10
0
 public void AddDecision(IScriptDecision decision)
 {
     _decisions.Add(decision);
 }
 public void AddDecision(IScriptDecision decision)
 {
     throw new System.NotImplementedException();
 }
示例#12
0
        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;
        }
示例#13
0
        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 void AddDecision(IScriptDecision decision)
 {
     _decisions.Add(decision);
 }
 public bool Contains(IScriptDecision decision)
 {
     return(_decisions.Contains(decision));
 }
示例#16
0
 public bool Contains(IScriptDecision decision)
 {
     return _decisions.Contains(decision);
 }
 public bool Contains(IScriptDecision decision)
 {
     return(false);
 }