Beispiel #1
0
        protected override void StartLoop(NativeActivityContext context)
        {
            Interfaces.VT.ITerminalSession session = null;
            var timeout = Timeout.Get(context);

            if (Timeout == null || Timeout.Expression == null)
            {
                timeout = TimeSpan.FromSeconds(3);
            }
            string WorkflowInstanceId = context.WorkflowInstanceId.ToString();

            GenericTools.RunUI(() =>
            {
                //
                termOpen3270Config Config = new termOpen3270Config();
                Config.Hostname           = Hostname.Get(context);
                Config.TermType           = TermType.Get(context);
                Config.Port = Port.Get(context);

                session = RunPlugin.GetRecorderWindow(Config);
                if (string.IsNullOrEmpty(session.WorkflowInstanceId))
                {
                    session.WorkflowInstanceId = WorkflowInstanceId;
                }
                context.SetValue(_elements, session);
                if (!HideUI.Get(context))
                {
                    session.Show();
                }
                if (session.Terminal == null || !session.Terminal.IsConnected)
                {
                    session.Connect();
                }
            });
            var sw = new Stopwatch();

            sw.Start();
            while (!session.Terminal.IsConnected && sw.Elapsed < timeout)
            {
                System.Threading.Thread.Sleep(50);
            }
            Log.Output(string.Format("Connected to {0} in {1:mm\\:ss\\.fff}", session.Config.Hostname, sw.Elapsed));
            if (!session.Terminal.IsConnected)
            {
                throw new Exception("Timeout connecting to " + Hostname.Get(context) + ":" + Port.Get(context));
            }
            session.Refresh();
            context.ScheduleAction(Body, session, OnBodyComplete);
        }
Beispiel #2
0
    private void HideDialogueUI(HideUI data)
    {
        if (lineUI)
        {
            lineUI.enabled = false;
        }

        foreach (DialogueButtonData button in activeButtons)
        {
            button.button.SetActive(false);
            createdButtons.Enqueue(button);
        }

        activeButtons.Clear();
    }
Beispiel #3
0
    // Start is called before the first frame update
    void Start()
    {
        //Requires buttons to be in the same order as the toolmode enum
        //We could fully generate the buttons instead if we have icons with file names matching the enums
        var buttons = GetComponentsInChildren <Button>();

        Buttons      = buttons.OrderBy(x => x.transform.position.x).ToArray();
        ParentCanvas = GetComponentInParent <Canvas>();
        for (int i = 0; i < Buttons.Length; ++i)
        {
            int copiedIndex = i; //this is important
            var button      = Buttons[i];
            button.onClick.AddListener(() => Select(copiedIndex));
        }


        Buttons[GadgetManager.activeGadget.id].transform.localScale *= activeGadgetScaleFactor;
        UIManager = GetComponentInParent <HideUI>();
    }
 public override void Hide()
 {
     gameObject.SetActive(false);
     HideUI.Invoke();
 }
Beispiel #5
0
 public void Start()
 {
     hideUI = this;
     cg = this.GetComponent<CanvasGroup>();
 }