Esempio n. 1
0
 private void Select_Click(object sender, RoutedEventArgs e)
 {
     vm.Plugin.Start();
     GenericTools.Minimize(GenericTools.MainWindow);
     GenericTools.Minimize(this);
     OpenRPA.Input.InputDriver.Instance.onCancel += OnCancel;
 }
Esempio n. 2
0
        private void Select_Click(object sender, RoutedEventArgs e)
        {
            vm.Plugin.Start();
            GenericTools.Minimize();
            GenericTools.Minimize(this);
            // OpenRPA.Input.InputDriver.Instance.CallNext = false;

            OpenRPA.Input.InputDriver.Instance.onCancel += OnCancel;
            StartOverlay();
        }
Esempio n. 3
0
        internal void OnPlay(object _item)
        {
            Workflow workflow = null;

            if (_item != null && _item is Workflow)
            {
                workflow = _item as Workflow;
            }
            if (SelectedContent is Views.AgentViewProjects view)
            {
                if (view != null)
                {
                    var val = view.listWorkflows.SelectedValue;
                    if (val == null)
                    {
                        return;
                    }
                    if (!(view.listWorkflows.SelectedValue is Workflow wf))
                    {
                        return;
                    }
                    workflow = wf;
                }
            }
            if (workflow != null)
            {
                string errormessage = "";
                try
                {
                    GenericTools.Minimize();
                    IWorkflowInstance instance;
                    var param = new Dictionary <string, object>();
                    instance = workflow.CreateInstance(param, null, null, IdleOrComplete, null);
                    instance.Run();
                }
                catch (Exception ex)
                {
                    errormessage = ex.Message;
                    Log.Error(ex.ToString());
                }
                if (Config.local.notify_on_workflow_end && !string.IsNullOrEmpty(errormessage))
                {
                    App.notifyIcon.ShowBalloonTip(1000, "", errormessage, System.Windows.Forms.ToolTipIcon.Error);
                    GenericTools.Restore();
                }
                else if (!string.IsNullOrEmpty(errormessage))
                {
                    GenericTools.Restore();
                    MessageBox.Show("onPlay " + errormessage);
                }
                return;
            }
        }
Esempio n. 4
0
        protected override void Execute(CodeActivityContext context)
        {
            var el = Element.Get(context);

            if (el == null)
            {
                throw new ArgumentException("element cannot be null");
            }
            var screen      = Screen.Get(context);
            var x           = X.Get(context);
            var y           = Y.Get(context);
            var width       = Width.Get(context);
            var height      = Height.Get(context);
            var animatemove = AnimateMove.Get(context);
            var windowstate = WindowState.Get(context);

            if (width <= 30 || height <= 10)
            {
            }
            else
            {
                var allScreens = System.Windows.Forms.Screen.AllScreens.ToList();
                if (screen < 0)
                {
                    Log.Warning("screen cannot be below 0, using screen 0");
                    screen = 0;
                }
                if (screen >= allScreens.Count)
                {
                    Log.Warning("screen " + screen + " does not exists, using " + (allScreens.Count - 1) + " instead");
                    screen = allScreens.Count - 1;
                }
                x += allScreens[screen].WorkingArea.X;
                y += allScreens[screen].WorkingArea.Y;
                var _window = ((UIElement)el).GetWindow();
                var window  = new UIElement(_window);
                if (_window.Properties.NativeWindowHandle.IsSupported)
                {
                    GenericTools.Restore(_window.Properties.NativeWindowHandle.Value);
                }
                if (animatemove)
                {
                    window.MoveWindowTo(x, y, width, height);
                }
                if (!animatemove)
                {
                    window.SetWindowSize(width, height);
                    window.SetWindowPosition(x, y);
                }
                if (!string.IsNullOrEmpty(windowstate) && _window.Properties.NativeWindowHandle.IsSupported)
                {
                    switch (windowstate)
                    {
                    case "Normal": GenericTools.Restore(_window.Properties.NativeWindowHandle.Value); break;

                    case "Minimized": GenericTools.Minimize(_window.Properties.NativeWindowHandle.Value); break;

                    case "Maximized": GenericTools.Maximized(_window.Properties.NativeWindowHandle.Value); break;
                    }
                }
            }
        }