Exemplo n.º 1
0
        public string getExcuse()
        {
            string hereItIs   = "";
            int    numExcuses = Settings.Default.ExcuseList.Count;
            int    indx       = rand.Next(0, numExcuses);
            bool   allSeen    = checkAllSeenExcuses();

            if (allSeen)
            {
                ExcuseText.Hide();
                RestartExcuses.Show();
                ExcuseNotification.Text = "You've seen all the excuses!";
                ExcuseButton.Hide();
                SendToEmail.Hide();
                CopyButton.Hide();
                BackButton.Hide();
                ForwardButton.Hide();
            }
            else
            {
                if (Settings.Default.ExcuseSeen[indx] == "0")
                {
                    hereItIs = Settings.Default.ExcuseList[indx].ToString();
                }
                else
                {
                    hereItIs = findNextUnseenExcuse();
                }

                Settings.Default.CurrentExcuse    = indx;
                Settings.Default.ExcuseSeen[indx] = "1";
                Settings.Default.Save();
            }
            return(hereItIs);
        }
Exemplo n.º 2
0
        private void TapGestureRecognizerOnTapped(object sender, EventArgs e)
        {
            var genericCommand = BindingContext as IGenericCommand;

            genericCommand?.SendCommand(Utils.GlobalMessages.CopyToClipbard.ToString());
            CopyButton.FadeTo(0, 200, Easing.CubicOut).ContinueWith(t => Device.BeginInvokeOnMainThread(() => CopyButton.Opacity  = 1)).ConfigureAwait(false);
            CopyButton.ScaleTo(1.5, 200, Easing.CubicOut).ContinueWith(t => Device.BeginInvokeOnMainThread(() => CopyButton.Scale = 1)).ConfigureAwait(false);
        }
Exemplo n.º 3
0
        public Form1()
        {
            InitializeComponent();
            txtSource.Text  = @"C:\Users\LG\Desktop\개발\View복사리스트";
            targetSrc.Text  = @"C:\Users\LG\Desktop\개발\View복사파일";
            ViewSource.Text = @"C:\Users\LG\Desktop\프로젝트\배포용_LGC_MES\MES_WEB\Views";

            CopyButton.Focus();
        }
Exemplo n.º 4
0
        public Form1(string[] args)
        {
            InitializeComponent();

            DataChanged += Set_Unsaved_Flag;
            DataChanged += Enable_Save_Button;

            SaveTableButton.BringToFront();
            CopyButton.BringToFront();

            Read_Settings_File();
            Apply_Settings();

            try
            {
                FormTranslationDictionary = Read_Translation_File(Settings[TRANSLATION_DIRECTORY_PARAMETR]);
                Apply_Translation(this, FormTranslationDictionary[this.GetType().Name]);
            }
            catch
            { }

            programName = Text;

            string tmp;

            try
            {
                StreamReader SR = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + "/" + DICTIONARY_FILE_NAME);
                tmp = SR.ReadToEnd();
                SR.Close();
            }
            catch
            {
                tmp = Properties.Resources.defaultDictionary;
                StreamWriter SW = new StreamWriter("dictionary.json");
                SW.Write(tmp);
                SW.Close();
            }

            GeneratorDictionary = JsonConvert.DeserializeObject <Dictionary <string, string> >(tmp);

            if (args != null && args.Length > 0)
            {
                Open_File(args[0]);
            }

            AddToTableButton.Enabled     = false;
            EditSelectedButton.Enabled   = false;
            DeleteSelectedButton.Enabled = false;
            SaveTableButton.Enabled      = false;
            UpButton.Enabled             = false;
            DownButton.Enabled           = false;
            SortButton.Enabled           = false;
            URLButton.Enabled            = false;
            LoginButton.Enabled          = false;
            CopyButton.Enabled           = false;
        }
        public bool OnHotkey(Keys keyData)
        {
            if (!keyData.HasFlag(Keys.Control))
            {
                return(false);
            }

            var key = keyData & ~Keys.Control;

            switch (key)
            {
            case Keys.N:
                ClearAllPixelsButton.PerformClick();
                return(true);

            case Keys.I:
                InverseButton.PerformClick();
                return(true);

            case Keys.R:
                ResizeButton.PerformClick();
                return(true);

            case Keys.C:
                CopyButton.PerformClick();
                return(true);

            case Keys.V:
                PasteButton.PerformClick();
                return(true);

            case Keys.A:
                ImageListBox.BeginUpdate();
                ImageListBox.SelectedIndices.Clear();
                ImageListBox.SelectedIndices.AddRange(Enumerable.Range(0, ImageListBox.Items.Count));
                ImageListBox.EndUpdate();
                return(true);

            case Keys.Up:
                ShiftUpButton.PerformClick();
                return(true);

            case Keys.Down:
                ShiftDownButton.PerformClick();
                return(true);

            case Keys.Left:
                ShiftLeftButton.PerformClick();
                return(true);

            case Keys.Right:
                ShiftRightButton.PerformClick();
                return(true);
            }
            return(false);
        }
Exemplo n.º 6
0
    private void CopyActionPointDryRunCallback(string _, string data)
    {
        CopyActionPointResponse response = JsonConvert.DeserializeObject <CopyActionPointResponse>(data);

        if (response.Result)
        {
            CopyButton.SetInteractivity(true);
        }
        else
        {
            CopyButton.SetInteractivity(false, response.Messages.FirstOrDefault());
        }
    }
Exemplo n.º 7
0
        private void CreateTooltips()
        {
            ShowErrorToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleErrorInputGesture);
            ShowWarningToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleWarningInputGesture);
            ShowInfoToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleInfoInputGesture);
            ShowDebugToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleDebugInputGesture);

            EnableTimestampToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleTimestampInputGesture, "Show timestamps");
            FilterBox.SetTooltip(LogViewerCommands.Logging.FilterInputGesture);

            ClearButton.SetTooltip(LogViewerCommands.Logging.ClearInputGesture);
            CopyButton.SetTooltip(LogViewerCommands.Logging.CopyToClipboardInputGesture);
            OpenButton.SetTooltip(LogViewerCommands.Logging.OpenInEditorInputGesture);
        }
Exemplo n.º 8
0
        public void CreateUi()
        {
            var copyButton = new CopyButton();

            copyButton.SetCommand(Execute(new CopyCommand(_activeEditor, this)));
            var cutButton = new CutButton();

            cutButton.SetCommand(Execute(new CutCommand(_activeEditor, this)));
            var pasteButton = new PasteButton();

            pasteButton.SetCommand(Execute(new PasteCommand(_activeEditor, this)));
            var undoButton = new UndoButton();

            undoButton.SetCommand(Execute(new UndoCommand(_activeEditor, this)));
        }
Exemplo n.º 9
0
        private void ExcuseButton_Click(object sender, EventArgs e)
        {
            if (Count > 0)
            {
                BackBox.Items.Insert(0, ExcuseText.Text);
                BackBox.EndUpdate();
            }
            ExcuseNotification.ForeColor = Color.BlanchedAlmond;
            ExcuseNotification.Text      = "Excuse #" + (Settings.Default.CurrentExcuse + 1).ToString() + "/" + TotExcuses;
            CopyButton.Show();
            SendToEmail.Show();
            BackButton.Show();
            ForwardButton.Show();
            string excuse = getExcuse();

            ExcuseText.Text = excuse;
            Count          += 1;
            ForwardBox.Items.Clear();
            ForwardBox.EndUpdate();
        }
        void ReleaseDesignerOutlets()
        {
            if (CopyButton != null)
            {
                CopyButton.Dispose();
                CopyButton = null;
            }

            if (DoneLabel != null)
            {
                DoneLabel.Dispose();
                DoneLabel = null;
            }

            if (ShareButton != null)
            {
                ShareButton.Dispose();
                ShareButton = null;
            }
        }
Exemplo n.º 11
0
 private void ResetExcuses_Click(object sender, EventArgs e)
 {
     RestartExcuses.Hide();
     ExcuseText.Show();
     ExcuseButton.Show();
     BackButton.Hide();
     ForwardButton.Hide();
     CopyButton.Hide();
     SendToEmail.Hide();
     ExcuseNotification.Text = "";
     ExcuseText.Text         = "Excuses Ahead...";
     BackBox.Items.Clear();
     ForwardBox.Items.Clear();
     BackBox.EndUpdate();
     ForwardBox.EndUpdate();
     Count = 0;
     Settings.Default.CurrentExcuse = 0;
     for (int i = 0; i < Settings.Default.ExcuseSeen.Count; i++)
     {
         Settings.Default.ExcuseSeen[i] = "0";
         Settings.Default.Save();
     }
     Settings.Default.Save();
 }
Exemplo n.º 12
0
    protected async override Task UpdateBtns(InteractiveObject obj)
    {
        try {
            if (CanvasGroup.alpha == 0)
            {
                return;
            }

            await base.UpdateBtns(obj);

            AddNewCollisionObjectButton.SetInteractivity(!SceneManager.Instance.SceneStarted, $"{ADD_NEW_COLLISION_OBJECT_BTN_LABEL}\n(only available when offline)");
            if (SceneManager.Instance.SceneStarted)
            {
                AddActionObjectButton.SetInteractivity(false, $"{ADD_ACTION_OBJECT_BTN_LABEL}\n(only available when offline)");
            }
            else if (ActionsManager.Instance.AbstractOnlyObjects)
            {
                AddActionObjectButton.SetInteractivity(false, $"{ADD_ACTION_OBJECT_BTN_LABEL}\n(no object type available)");
            }
            else
            {
                AddActionObjectButton.SetInteractivity(true);
            }
#if UNITY_ANDROID && AR_ON
            if (!CalibrationManager.Instance.Calibrated && !TrackingManager.Instance.IsDeviceTracking())
            {
                ActionObjectAimingMenuButton.SetInteractivity(false, "AR is not calibrated");
                AddActionObjectButton.SetInteractivity(false, "AR is not calibrated");
            }
            else
#endif
            if (requestingObject || obj == null)
            {
                SelectedObjectText.text = "";
                ActionObjectAimingMenuButton.SetInteractivity(false, $"{AIMING_MENU_BTN_LABEL}\n(no object selected)");
                CopyButton.SetInteractivity(false, $"{COPY_LABEL}\n(no object selected)");
            }
            else if (obj.IsLocked && obj.LockOwner != LandingScreen.Instance.GetUsername())
            {
                ActionObjectAimingMenuButton.SetInteractivity(false, $"{AIMING_MENU_BTN_LABEL}\n(the object is used by {obj.LockOwner})");
                CopyButton.SetInteractivity(false, $"{COPY_LABEL}\n(the object is used by {obj.LockOwner})");
            }
            else
            {
                if (obj is ActionObject actionObject)
                {
                    if (!SceneManager.Instance.SceneStarted)
                    {
                        ActionObjectAimingMenuButton.SetInteractivity(false, $"{AIMING_MENU_BTN_LABEL}\n(only available when online)");
                    }
                    else if (!actionObject.ActionObjectMetadata.HasPose)
                    {
                        ActionObjectAimingMenuButton.SetInteractivity(false, $"{AIMING_MENU_BTN_LABEL}\n(not available for objects without pose)");
                        CopyButton.SetInteractivity(false, $"{COPY_LABEL}\n(not available for objects without pose)");
                    }
                    else if (actionObject.IsRobot())
                    {
                        ActionObjectAimingMenuButton.SetInteractivity(false, $"{AIMING_MENU_BTN_LABEL}\n(not available for robots)");
                        CopyButton.SetInteractivity(true);
                    }
                    else
                    {
                        ActionObjectAimingMenuButton.SetInteractivity(true);
                        CopyButton.SetInteractivity(true);
                    }

                    CopyButton.SetInteractivity(!SceneManager.Instance.SceneStarted, $"{COPY_LABEL}\n(only available when offline)");
                }
                else
                {
                    ActionObjectAimingMenuButton.SetInteractivity(false, $"{AIMING_MENU_BTN_LABEL}\n(selected object is not action object)");
                    CopyButton.SetInteractivity(false, $"{COPY_LABEL}\n(selected object is not action object)");
                }
            }


            previousUpdateDone = true;
        } finally {
            previousUpdateDone = true;
        }
    }
Exemplo n.º 13
0
    protected async override Task UpdateBtns(InteractiveObject obj)
    {
        try {
            if (CanvasGroup.alpha == 0)
            {
                previousUpdateDone = true;
                return;
            }

            await base.UpdateBtns(obj);

#if UNITY_ANDROID && AR_ON
            if (!CalibrationManager.Instance.Calibrated && !TrackingManager.Instance.IsDeviceTracking())
            {
                SetActionPointParentButton.SetInteractivity(false, $"{SET_ACTION_POINT_PARENT_LABEL}\n(AR not calibrated)");
                AddActionButton.SetInteractivity(false, $"{ADD_ACTION_LABEL}\n(AR not calibrated)");
                AddActionButton2.SetInteractivity(false, $"{ADD_ACTION_LABEL}\n(AR not calibrated)");
                AddConnectionButton.SetInteractivity(false, $"{ADD_CONNECTION_LABEL}\n(AR not calibrated)");
                AddConnectionButton2.SetInteractivity(false, $"{ADD_CONNECTION_LABEL}\n(AR not calibrated)");
                RunButton.SetInteractivity(false, $"{RUN_ACTION_OR_PACKAGE_LABEL}\n(AR not calibrated)");
                RunButton2.SetInteractivity(false, $"{RUN_ACTION_OR_PACKAGE_LABEL}\n(AR not calibrated)");
                AddActionPointButton.SetInteractivity(false, $"{ADD_ACTION_POINT_LABEL}\n(AR not calibrated)");
                AddActionPointButton2.SetInteractivity(false, $"{ADD_ACTION_POINT_LABEL}\n(AR not calibrated)");
                CopyButton.SetInteractivity(false, $"{COPY_LABEL}\n(AR not calibrated");
                ActionPointAimingMenuButton.SetInteractivity(false, $"{ACTION_POINT_AIMING_LABEL}\n(AR not calibrated)");
            }
            else
#endif
            if (requestingObject || obj == null)
            {
                SetActionPointParentButton.SetInteractivity(false, $"{SET_ACTION_POINT_PARENT_LABEL}\n(no action point is selected)");
                AddActionButton.SetInteractivity(false, $"{ADD_ACTION_LABEL}\n(no action point is selected)");
                AddActionButton2.SetInteractivity(false, $"{ADD_ACTION_LABEL}\n(no action point is selected)");
                AddConnectionButton.SetInteractivity(false, $"{ADD_CONNECTION_LABEL}\n(no input / output is selected)");
                AddConnectionButton2.SetInteractivity(false, $"{ADD_CONNECTION_LABEL}\n(no input / output is selected)");
                RunButton.SetInteractivity(false, $"{RUN_ACTION_OR_PACKAGE_LABEL}\n(select action to execute it or START to run project)");
                RunButton2.SetInteractivity(false, RunButton.GetAlternativeDescription());
                AddActionPointButton.SetInteractivity(true);
                AddActionPointButton2.SetInteractivity(true);
                AddActionPointButton.SetDescription(ADD_ACTION_POINT_GLOBAL_LABEL);
                AddActionPointButton2.SetDescription(ADD_ACTION_POINT_GLOBAL_LABEL);
                CopyButton.SetInteractivity(false, $"{COPY_LABEL}\n(no object to duplicate selected)");
                ActionPointAimingMenuButton.SetInteractivity(false, $"{ACTION_POINT_AIMING_LABEL}\n(no action point selected)");
                RunDebugButton.SetInteractivity(false, $"{RUN_DEBUG_OR_TRIGGER_BREAKPOINT_LABEL}\n(select action point to trigger breakpoint or START to run debug mode)");
            }
            else if (obj.IsLocked && obj.LockOwner != LandingScreen.Instance.GetUsername())
            {
                SetActionPointParentButton.SetInteractivity(false, $"{SET_ACTION_POINT_PARENT_LABEL}\n(object is used by {obj.LockOwner})");
                AddConnectionButton.SetInteractivity(false, $"{ADD_CONNECTION_LABEL}\n(object is used by {obj.LockOwner})");
                AddConnectionButton2.SetInteractivity(false, $"{ADD_CONNECTION_LABEL}\n(object is used by {obj.LockOwner})");
                RunButton.SetInteractivity(false, $"{RUN_ACTION_OR_PACKAGE_LABEL}\n(object is used by {obj.LockOwner})");
                RunButton2.SetInteractivity(false, $"{RUN_ACTION_OR_PACKAGE_LABEL}\n(object is used by {obj.LockOwner})");
                AddActionButton.SetInteractivity(false, $"{ADD_ACTION_POINT_LABEL}\n(object is used by {obj.LockOwner})");
                AddActionButton2.SetInteractivity(false, $"{ADD_ACTION_POINT_LABEL}\n(object is used by {obj.LockOwner})");
                CopyButton.SetInteractivity(false, $"{COPY_LABEL}\n(object is used by {obj.LockOwner})");
                ActionPointAimingMenuButton.SetInteractivity(false, $"{ACTION_POINT_AIMING_LABEL}\n(object is used by {obj.LockOwner})");
                RunDebugButton.SetInteractivity(false, $"{RUN_DEBUG_OR_TRIGGER_BREAKPOINT_LABEL}\n(object is used by {obj.LockOwner})");
            }
            else
            {
                RunDebugButton.SetInteractivity(false, $"{RUN_DEBUG_OR_TRIGGER_BREAKPOINT_LABEL}\n(select action point to trigger breakpoint or START to run debug mode)");
                SetActionPointParentButton.SetInteractivity(obj is ActionPoint3D, $"{SET_ACTION_POINT_PARENT_LABEL}\n(selected object is not action point)");
                if (obj is ActionPoint3D ap)
                {
                    AddActionButton.SetInteractivity(ProjectManager.Instance.AnyAvailableAction, $"{ADD_ACTION_LABEL}\n(no actions available)");
                    AddActionButton2.SetInteractivity(ProjectManager.Instance.AnyAvailableAction, $"{ADD_ACTION_LABEL}\n(no actions available)");
                    CopyButton.SetInteractivity(false, $"{COPY_LABEL}\n(checking...)");
                    WebsocketManager.Instance.CopyActionPoint(obj.GetId(), null, obj.GetName(), CopyActionPointDryRunCallback, true);
                    RunDebugButton.SetInteractivity(true);
                    RunDebugButton.SetDescription(ap.BreakPoint ? TRIGGER_BREAKPOINT_OFF_LABEL : TRIGGER_BREAKPOINT_ON_LABEL);
                }
                else
                {
                    AddActionButton.SetInteractivity(false, $"{ADD_ACTION_LABEL}\n(selected object is not action point)");
                    AddActionButton2.SetInteractivity(false, $"{ADD_ACTION_LABEL}\n(selected object is not action point)");
                    CopyButton.SetInteractivity(obj is Base.Action && !(obj is StartEndAction), $"{COPY_LABEL}\n(selected object cannot be duplicated)");
                }

                ActionPointAimingMenuButton.SetInteractivity(obj is ActionPoint3D || obj is APOrientation, $"{ACTION_POINT_AIMING_LABEL}\n(selected object is not action point or orientation)");
                if (obj is IActionPointParent)
                {
                    AddActionPointButton.SetDescription($"Add AP relative to {obj.GetName()}");
                    AddActionPointButton.SetInteractivity(true);
                }
                else
                {
                    AddActionPointButton.SetInteractivity(false, $"{ADD_ACTION_POINT_LABEL}\n(selected object could not be parent of AP");
                }
                AddActionPointButton2.SetInteractivity(AddActionPointButton.IsInteractive(), $"{ADD_ACTION_POINT_LABEL}\n({AddActionPointButton.GetAlternativeDescription()})");
                AddActionPointButton2.SetDescription(AddActionPointButton.GetDescription());

                if (!MainSettingsMenu.Instance.ConnectionsSwitch.IsOn())
                {
                    AddConnectionButton.SetInteractivity(false, $"{ADD_CONNECTION_LABEL}\n(connections are hidden)");
                    AddConnectionButton2.SetInteractivity(false, $"{ADD_CONNECTION_LABEL}\n(connections are hidden)");
                }
                else
                {
                    if (obj is Base.Action)
                    {
                        if (obj is EndAction)
                        {
                            AddConnectionButton.SetInteractivity(false, $"{ADD_CONNECTION_LABEL}\n(end action could not be connected to anything else)");
                        }
                        else
                        {
                            AddConnectionButton.SetInteractivity(true);
                        }
                        AddConnectionButton2.SetInteractivity(AddConnectionButton.IsInteractive(), AddConnectionButton.GetAlternativeDescription());
                    }
                }
                string runBtnInteractivity = null;

                if (obj.GetType() == typeof(Action3D))
                {
                    if (!SceneManager.Instance.SceneStarted)
                    {
                        runBtnInteractivity = "scene offline";
                    }
                    else if (!string.IsNullOrEmpty(GameManager.Instance.ExecutingAction))
                    {
                        string actionName = ProjectManager.Instance.GetAction(GameManager.Instance.ExecutingAction).GetName();
                        runBtnInteractivity = $"action '{actionName}' running";
                    }
                    RunButton.SetDescription(RUN_ACTION_LABEL);
                    RunButton2.SetDescription(RUN_ACTION_LABEL);
                    RunButton.SetInteractivity(string.IsNullOrEmpty(runBtnInteractivity), $"{RUN_ACTION_LABEL}\n({runBtnInteractivity})");
                    RunButton2.SetInteractivity(string.IsNullOrEmpty(runBtnInteractivity), $"{RUN_ACTION_LABEL}\n({runBtnInteractivity})");
                }
                else if (obj.GetType() == typeof(StartAction))
                {
                    if (!ProjectManager.Instance.ProjectMeta.HasLogic)
                    {
                        runBtnInteractivity = "project without logic could not be started from editor";
                    }
                    else if (ProjectManager.Instance.ProjectChanged)
                    {
                        runBtnInteractivity = "project has unsaved changes";
                    }
                    RunButton.SetDescription(RUN_TEMP_PACKAGE_LABEL);
                    RunButton2.SetDescription(RUN_TEMP_PACKAGE_LABEL);
                    RunDebugButton.SetDescription(RUN_DEBUG_LABEL);
                    RunButton.SetInteractivity(string.IsNullOrEmpty(runBtnInteractivity), $"{RUN_TEMP_PACKAGE_LABEL}\n({runBtnInteractivity})");
                    RunButton2.SetInteractivity(string.IsNullOrEmpty(runBtnInteractivity), $"{RUN_TEMP_PACKAGE_LABEL}\n({runBtnInteractivity})");
                    RunDebugButton.SetInteractivity(string.IsNullOrEmpty(runBtnInteractivity), $"{RUN_DEBUG_LABEL}\n({runBtnInteractivity})");
                }
                else
                {
                    runBtnInteractivity = "select action to execute it or START to run project";
                    RunButton.SetInteractivity(false, $"{RUN_ACTION_OR_PACKAGE_LABEL}\n({runBtnInteractivity})");
                    RunButton2.SetInteractivity(false, $"{RUN_ACTION_OR_PACKAGE_LABEL}\n({runBtnInteractivity})");
                }
            }

            if (!SceneManager.Instance.SceneStarted)
            {
                AddActionPointUsingRobotButton.SetInteractivity(false, $"{ADD_ACTION_POINT_USING_ROBOT_LABEL}\n(scene offline");
            }
            else
            {
                AddActionPointUsingRobotButton.SetInteractivity(true);
            }
        } finally {
            previousUpdateDone = true;
        }
    }