private string QueryProfileName(string proposedName)
        {
            var title        = _translator.GetTranslation("ProfileSettingsWindow", "ProfileName");
            var questionText = _translator.GetTranslation("ProfileSettingsWindow", "EnterProfileName");

            var inputInteraction = new InputInteraction(title, questionText, ProfilenameIsValid);

            if (proposedName != null)
            {
                inputInteraction.InputText = proposedName;
            }
            else
            {
                inputInteraction.InputText = _translator.GetTranslation("ProfileSettingsWindow", "NewProfile");
            }

            _interactionInvoker.Invoke(inputInteraction);

            if (!inputInteraction.Success)
            {
                return(null);
            }

            return(inputInteraction.InputText);
        }
예제 #2
0
        private string QueryLicenseKey()
        {
            var lastActivationKey = LicenseKey;

            if (string.IsNullOrWhiteSpace(lastActivationKey))
            {
                lastActivationKey = _licenseChecker.GetSavedLicenseKey().ValueOr("");
            }

            var title        = Translation.EnterLicenseKey;
            var questionText = Translation.EnterLicenseKeyColon;



            var inputInteraction = new InputInteraction(title, questionText, ValidateLicenseKey);

            inputInteraction.InputText = lastActivationKey;

            _interactionInvoker.Invoke(inputInteraction);

            if (!inputInteraction.Success)
            {
                return(null);
            }

            return(inputInteraction.InputText);
        }
예제 #3
0
        protected virtual async Task OnlineActivationCommandExecute(object o)
        {
            var lastActivationKey = LicenseKey;

            if (string.IsNullOrWhiteSpace(lastActivationKey))
            {
                lastActivationKey = _licenseChecker.GetSavedLicenseKey().ValueOr("");
            }

            var title        = Translation.EnterLicenseKey;
            var questionText = Translation.EnterLicenseKeyColon;


            var inputInteraction = new InputInteraction(title, questionText, ValidateLicenseKey);

            inputInteraction.InputText = lastActivationKey;

            await _interactionRequest.RaiseAsync(inputInteraction);

            var key = inputInteraction.InputText;

            if (inputInteraction.Success && !string.IsNullOrEmpty(key))
            {
                await Activate(key);

                RaiseLicensePropertyChangedEvents();
            }
        }
예제 #4
0
        private string QueryProfileName(string proposedName)
        {
            var title        = Translation.ProfileName;
            var questionText = Translation.EnterProfileName;

            var inputInteraction = new InputInteraction(title, questionText, ProfilenameIsValid);

            if (proposedName != null)
            {
                inputInteraction.InputText = proposedName;
            }
            else
            {
                inputInteraction.InputText = Translation.NewProfile;
            }

            _interactionInvoker.Invoke(inputInteraction);

            if (!inputInteraction.Success)
            {
                return(null);
            }

            return(inputInteraction.InputText);
        }
        protected virtual void OnlineActivationCommandExecute(object o)
        {
            var lastActivationKey = LicenseKey;

            if (string.IsNullOrWhiteSpace(lastActivationKey))
            {
                lastActivationKey = _licenseChecker.GetSavedLicenseKey().ValueOr("");
            }

            var title        = Translation.EnterLicenseKey;
            var questionText = Translation.EnterLicenseKeyColon;


            var inputInteraction = new InputInteraction(title, questionText, ValidateLicenseKey);

            inputInteraction.InputText = lastActivationKey;

            _interactionRequest.Raise(inputInteraction, interaction =>
            {
                var key = inputInteraction.InputText;
                if (interaction.Success && !string.IsNullOrEmpty(key))
                {
                    ActivateWithKeyAsync(key);
                }
            });
        }
예제 #6
0
 public Interaction(InputInteraction inputInteraction)
 {
     Name  = inputInteraction.Name;
     Lines = inputInteraction.Lines
             .Select(x => new Line(x))
             .ToList();
 }
예제 #7
0
        private void Start()
        {
            combatInput      = InputCombat.Instance;
            interactionInput = InputInteraction.Instance;
            movementInput    = InputMovement.Instance;

            audioSource.minDistance  = 1;
            audioSource.maxDistance  = 50;
            audioSource.volume       = 1f;
            audioSource.spatialBlend = 1f;
        }
        private async Task<string> RequestPrinternameFromUser(string questionText, string printerName)
        {
            var interaction = new InputInteraction("PDFCreator", questionText, ValidatePrinterName);
            interaction.InputText = printerName;

            var i = await _interactionRequest.RaiseAsync(interaction);
            if (!i.Success)
                return null;

            return i.InputText.Trim();
        }
예제 #9
0
        public void Execute(object parameter)
        {
            var title        = Translation.RenameProfile;
            var questionText = Translation.EnterNewProfileName;

            var inputInteraction = new InputInteraction(title, questionText, ProfilenameIsValid);

            inputInteraction.InputText = CurrentSettingsProvider.SelectedProfile.Name;

            InteractionRequest.Raise(inputInteraction, RenameProfileCallback);
        }
예제 #10
0
        public void Execute(Object obj)
        {
            var title        = Translation.AddNewProfile;
            var questionText = Translation.EnterProfileName;

            var inputInteraction = new InputInteraction(title, questionText, ProfilenameIsValid);

            inputInteraction.InputText = Translation.NewProfile;

            InteractionRequest.Raise(inputInteraction, AddProfileCallback);
        }
예제 #11
0
        private void RenameProfileCallback(InputInteraction interaction)
        {
            if (!interaction.Success)
            {
                return;
            }

            var newname = interaction.InputText;

            CurrentSettingsProvider.SelectedProfile.Name = newname;
        }
예제 #12
0
        private string RequestPrinternameFromUser(string questionText, string printerName)
        {
            var interaction = new InputInteraction("PDFCreator", questionText, ValidatePrinterName);

            interaction.InputText = printerName;

            _invoker.Invoke(interaction);

            if (!interaction.Success)
            {
                return(null);
            }

            return(interaction.InputText.Trim());
        }
예제 #13
0
            public ActionConstraint(InputActionPhase phase, InputAction action, InputControl control, object value = null, Type interaction = null, double?time = null, double?duration = null)
            {
                this.phase       = phase;
                this.time        = time;
                this.duration    = duration;
                this.action      = action;
                this.control     = control;
                this.value       = value;
                this.interaction = interaction;

                var interactionText = string.Empty;

                if (interaction != null)
                {
                    interactionText = InputInteraction.GetDisplayName(interaction);
                }

                var actionName = action.actionMap != null ? $"{action.actionMap}/{action.name}" : action.name;
                // Use same text format as InputActionTrace for easier comparison.
                var description = $"{{ action={actionName} phase={phase}";

                if (time != null)
                {
                    description += $" time={time}";
                }
                if (control != null)
                {
                    description += $" control={control}";
                }
                if (value != null)
                {
                    description += $" value={value}";
                }
                if (interaction != null)
                {
                    description += $" interaction={interactionText}";
                }
                if (duration != null)
                {
                    description += $" duration={duration}";
                }
                description += " }";
                Description  = description;
            }
예제 #14
0
        private string QueryLicenseKey()
        {
            var title        = Translator.GetTranslation("pdfforge.PDFCreator.UI.Views.UserControls.ApplicationSettings.LicenseTab", "EnterLicenseKeyButton.Text");
            var questionText = Translator.GetTranslation("pdfforge.PDFCreator.UI.ViewModels.UserControlViewModels.ApplicationSettings", "EnterLicenseKeyText");

            var inputInteraction = new InputInteraction(title, questionText, ValidateLicenseKey);

            inputInteraction.InputText = _lastActivationKey;

            _interactionInvoker.Invoke(inputInteraction);

            if (!inputInteraction.Success)
            {
                return(null);
            }

            _lastActivationKey = inputInteraction.InputText;

            return(inputInteraction.InputText);
        }
예제 #15
0
        private void AddProfileCallback(InputInteraction interaction)
        {
            if (!interaction.Success)
            {
                return;
            }

            var name = interaction.InputText;

            var newProfile = CurrentSettingsProvider.SelectedProfile.Copy();

            newProfile.Guid = Guid.NewGuid().ToString();
            newProfile.Name = name;
            newProfile.Properties.Deletable = true;
            newProfile.Properties.Editable  = true;
            newProfile.Properties.Renamable = true;

            CurrentSettingsProvider.Profiles.Add(newProfile);
            CurrentSettingsProvider.SelectedProfile = newProfile;
        }
예제 #16
0
        private void AddProfileCallback(InputInteraction interaction)
        {
            if (interaction.Success)
            {
                var name = interaction.InputText;

                var newProfile = CurrentSettingsProvider.SelectedProfile.Copy();
                newProfile.Guid = Guid.NewGuid().ToString();
                newProfile.Name = name;
                newProfile.Properties.Deletable = true;
                newProfile.Properties.Renamable = true;
                newProfile.Properties.IsShared  = false;

                _profilesProvider.Settings.Add(newProfile);
                CurrentSettingsProvider.SelectedProfile = newProfile;
            }

            var result = interaction.Success
                ? ResponseStatus.Success
                : ResponseStatus.Cancel;

            IsDone?.Invoke(this, new MacroCommandIsDoneEventArgs(result));
        }
예제 #17
0
 protected override Type GetValueType(Type type)
 {
     return(InputInteraction.GetValueType(type));
 }
 public void Setup()
 {
     _viewModel         = new InputBoxWindowViewModel(new InputBoxWindowTranslation());
     _interaction       = new InputInteraction("Some Title", "Please answer this question:");
     _interactionHelper = new InteractionHelper <InputInteraction>(_viewModel, _interaction);
 }
예제 #19
0
    private void Awake()
    {
        inputInteraction = GetComponent <InputInteraction>();

        inputInteraction.OnSelectObjectInteraction += InputInteraction_OnSelectObjectInteraction;
    }
 public void Editor_CanGetValueTypeOfInteraction()
 {
     InputSystem.RegisterInteraction <TestInteractionWithValueType>();
     Assert.That(InputInteraction.GetValueType(typeof(TestInteractionWithValueType)), Is.SameAs(typeof(float)));
 }