Exemplo n.º 1
0
 public override void In(FlowScriptEngine.FlowEventArgs e)
 {
     SetArrayList();
     if (ArrayList != null)
     {
         SetValue(nameof(Value));
         SetValue(nameof(StartIndex));
         SetValue(nameof(Count));
         var comparer = new CallbackComparer((x, y) =>
         {
             X = x;
             Y = y;
             FireEvent(Compare, true);
             ProcessChildEvent();
             SetValue(nameof(Result));
             return(Result);
         });
         FoundIndex = ArrayList.BinarySearch(StartIndex, Count, Value, comparer);
         OnSuccess();
     }
     else
     {
         OnFailed();
     }
 }
Exemplo n.º 2
0
 public override void In(FlowScriptEngine.FlowEventArgs e)
 {
     SetArray();
     if (Array != null)
     {
         SetValue(nameof(Items));
         SetValue(nameof(StartIndex));
         SetValue(nameof(Length));
         var comparer = new CallbackComparer((x, y) =>
         {
             X = x;
             Y = y;
             FireEvent(Compare, true);
             ProcessChildEvent();
             SetValue(nameof(Result));
             return(Result);
         });
         System.Array.Sort(Array, Items, StartIndex, Length, comparer);
         OnSuccess();
     }
     else
     {
         OnFailed();
     }
 }
Exemplo n.º 3
0
 public override void In(FlowScriptEngine.FlowEventArgs e)
 {
     SetValue(nameof(Text));
     SetValue(nameof(Caption));
     System.Windows.Forms.MessageBox.Show(Text, Caption);
     OnSuccess();
 }
Exemplo n.º 4
0
        private void ProcessEvent(EventSet eventSet, FlowEventArgs eventArgs)
        {
            if (nextOperation == OperationType.Abort)
            {
                return;
            }

            try
            {
                var source = GetTargetSource(eventSet.EventHandler);
                Evaluate(source);
                eventSet.EventHandler.Invoke(eventArgs);
                Evaluate(source);
            }
            catch (FlowExecutionException e)
            {
                Error?.Invoke(e);
                ProcessError(e);
                if (debugMode)
                {
                    throw;
                }
            }
            catch (ThreadAbortException)
            {
            }
            catch (Exception e)
            {
                var error = new FlowExecutionException(e, eventSet.Source);
                Error?.Invoke(error);
                ProcessError(error);
            }
        }
Exemplo n.º 5
0
        public override void In(FlowScriptEngine.FlowEventArgs e)
        {
            if (closed)
            {
                return;
            }

            closed = true;
            FireEvent(Out);
        }
Exemplo n.º 6
0
        public override void In(FlowScriptEngine.FlowEventArgs e)
        {
            SetValue(nameof(Setting));
            var window = new SettingWindow();

            Setting.Initialize();
            window.DataContext = Setting;
            Result             = window.ShowDialog() == true ? DialogResult.OK : DialogResult.Cancel;
            OnSuccess();
        }
Exemplo n.º 7
0
 public override void In(FlowScriptEngine.FlowEventArgs e)
 {
     SetArrayList();
     if (ArrayList != null)
     {
         FoundIndex = ArrayList.FindIndex(obj =>
         {
             Value = obj;
             FireEvent(Predicate, true);
             ProcessChildEvent();
             SetValue(nameof(Result));
             return(Result);
         });
         OnSuccess();
     }
     else
     {
         OnFailed();
     }
 }
Exemplo n.º 8
0
 public override void In(FlowScriptEngine.FlowEventArgs e)
 {
     SetArrayList();
     if (ArrayList != null)
     {
         var comparer = new CallbackComparer((x, y) =>
         {
             X = x;
             Y = y;
             FireEvent(Compare, true);
             ProcessChildEvent();
             SetValue(nameof(Result));
             return(Result);
         });
         ArrayList.Sort(comparer);
         OnSuccess();
     }
     else
     {
         OnFailed();
     }
 }
Exemplo n.º 9
0
 public override void In(FlowScriptEngine.FlowEventArgs e)
 {
     SetArray();
     if (Array != null)
     {
         SetValue(nameof(StartIndex));
         SetValue(nameof(Count));
         FoundIndex = System.Array.FindLastIndex(Array, StartIndex, Count, obj =>
         {
             Value = obj;
             FireEvent(Predicate, true);
             ProcessChildEvent();
             SetValue(nameof(Result));
             return(Result);
         });
         OnSuccess();
     }
     else
     {
         OnFailed();
     }
 }
Exemplo n.º 10
0
        public override void In(FlowScriptEngine.FlowEventArgs e)
        {
            bool anyFired = false;

            SetValue(nameof(Value));
            if (IsConnected("Target1", true) && !anyFired)
            {
                SetValue(nameof(Target1));
                if (CheckEquals(Value, Target1))
                {
                    FireEvent(Out1);
                    anyFired = true;
                }
            }
            if (IsConnected("Target2", true) && !anyFired)
            {
                SetValue(nameof(Target2));
                if (CheckEquals(Value, Target2))
                {
                    FireEvent(Out2);
                    anyFired = true;
                }
            }
            if (IsConnected("Target3", true) && !anyFired)
            {
                SetValue(nameof(Target3));
                if (CheckEquals(Value, Target3))
                {
                    FireEvent(Out3);
                    anyFired = true;
                }
            }
            if (IsConnected("Target4", true) && !anyFired)
            {
                SetValue(nameof(Target4));
                if (CheckEquals(Value, Target4))
                {
                    FireEvent(Out4);
                    anyFired = true;
                }
            }
            if (IsConnected("Target5", true) && !anyFired)
            {
                SetValue(nameof(Target5));
                if (CheckEquals(Value, Target5))
                {
                    FireEvent(Out5);
                    anyFired = true;
                }
            }
            if (IsConnected("Target6", true) && !anyFired)
            {
                SetValue(nameof(Target6));
                if (CheckEquals(Value, Target6))
                {
                    FireEvent(Out6);
                    anyFired = true;
                }
            }
            if (!anyFired)
            {
                FireEvent(Default);
            }
        }
Exemplo n.º 11
0
 public void In(FlowScriptEngine.FlowEventArgs e)
 {
     SetValue(nameof(Length));
     Value = new object[Length];
 }