Example #1
0
 /// <summary>
 /// Return Flow Object hosted in QsObject
 /// </summary>
 /// <param name="stepName"></param>
 /// <returns></returns>
 public QsValue this[string stepName]
 {
     get
     {
         Flow FlowStateMachine = ThisFlow[stepName];
         return(QsObject.CreateNativeObject(FlowStateMachine));
     }
 }
Example #2
0
        public override QsValue GetIndexedItem(QsParameter[] indices)
        {
            var t = indices[0].QsNativeValue as QsText;

            // if the passed indexer is text then return the Flow Object itself pointed to this step name .. for all the functionality of Passive Flow engine
            if (t != null)
            {
                Flow FlowStateMachine = ThisFlow[t.Text];
                return(QsObject.CreateNativeObject(FlowStateMachine));
            }
            else
            {
                // or get the integer number from this parameter and get the value associated of this step index

                int ix = (int)((QsScalar)indices[0].QsNativeValue).NumericalQuantity.Value;
                if (ix < 0)
                {
                    ix = ThisFlow.FlowSteps.Length + ix;
                }

                return(ValueToQsValue(ThisFlow.FlowSteps[ix].Value));
            }
        }