示例#1
0
 // private LayerMask layerToIgnore = (1 << 5); //UI IGNORE
 public override void Start()
 {
     inputSelection   = transform.parent.GetComponent <InputSelection>();
     _posOfHandLaser  = inputSelection.transform;
     _interactableTag = inputSelection._tagToLookFor;
     thisTransform    = transform;
 }
 /// <summary>
 /// Select item from a group of options
 /// </summary>
 /// <param name="group">collection of options</param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static async Task <T> Select <T>(IEnumerable <T> options)
 {
     return((await InputSelection.From <T>()
             .AddOption(options)
             .RequestInput()
             ).First());
 }
 /// <summary>
 /// Select items from a group of options
 /// </summary>
 /// <param name="group">collection of options</param>
 /// <param name="max">max allowed selections</param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static Task <IEnumerable <T> > Select <T>(IEnumerable <T> options, int max)
 {
     return(InputSelection.From <T>()
            .SetMaxSelected(max)
            .AddOption(options)
            .RequestInput());
 }
 /// <summary>
 /// Select a item from an enum
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static async Task <T> Select <T>() where T : Enum
 {
     return((
                await InputSelection
                .FromEnum <T>()
                .RequestInput()
                ).First());
 }
 /// <summary>
 /// Select a items from an enum
 /// </summary>
 /// <param name="max">max allowed selections</param>
 /// <returns></returns>
 public static Task <IEnumerable <T> > Select <T>(int max) where T : Enum
 {
     return(
         InputSelection
         .FromEnum <T>()
         .SetMaxSelected(max)
         .RequestInput()
         );
 }
    public override void Start()
    {
        inputSelection  = transform.parent.GetComponent <InputSelection>();
        isFloorDetector = inputSelection.isFloorDetector;

        if (!isFloorDetector)
        {
            parentFlagTagMask_ForButtonUI = inputSelection._tagToLookFor;
        }
    }
示例#7
0
        private static async Task <string> GetProfileName()
        {
            var profiles = await JiraProfileService.GetAvailableProfiles();

            var inputSelect = InputSelection
                              .From <string>("Select a profile to delete")
                              .AddOption(profiles);

            return((await inputSelect.RequestInput()).FirstOrDefault());
        }
    // public float _minScale = 0.01f;
    public override void Start()
    {
        inputSelection   = transform.parent.GetComponent <InputSelection>();
        _posOfHandLaser  = inputSelection.transform;
        _interactableTag = inputSelection._tagToLookFor;
        thisTransform    = transform;
        initialParent    = transform.parent;

        thisBoxCollider = transform.GetComponent <BoxCollider>();
        // backBountsOriginalPositions = thisBoxCollider;
        //for (int i = 0; i < collisionBackBounds.bounds.c; i++)
        //{
        //    backBountsOriginalPositions[]
        //}
    }
            private UserControlInput CreateInputBox(string type, string name, int size, string value)
            {
                UserControlInput _input = null;

                switch (type)
                {
                case "FILE_SELECT":
                    _input = new InputFile();
                    ((InputFile)_input).Name = name;
                    ((InputFile)_input).Text = value;
                    break;

                case "SELECT":
                    _input = new InputSelection();
                    ((InputSelection)_input).Name = name;
                    ((InputSelection)_input).Text = value;
                    break;

                case "DEC":
                    _input = new InputDecimal();
                    ((InputDecimal)_input).Minimum = 0;
                    ((InputDecimal)_input).Maximum = size;
                    ((InputDecimal)_input).Name    = name;
                    ((InputDecimal)_input).Text    = value;
                    break;

                case "HEX":
                    _input = new InputHexadecimal();
                    ((InputHexadecimal)_input).MaxLength = size;
                    ((InputHexadecimal)_input).Name      = name;
                    ((InputHexadecimal)_input).Text      = value;
                    break;

                case "ASCII":
                    _input = new InputString();
                    ((InputString)_input).MaxLength = size;
                    ((InputString)_input).Name      = name;
                    ((InputString)_input).Text      = value;
                    break;

                default:
                    throw  new Exception();
                }

                return(_input);
            }
示例#10
0
        public TestFormClass()
        {
            ValidatorProvider.Global.Register(REQUIRED, ValidatorCollection
                                              .Create <string>().Add(s => (s.Length > 0, "Can't be empty")));
            ValidatorProvider.Global.Register(AGE_INTERVAL, ValidatorCollection
                                              .Create <uint>()
                                              .Add(n => (n >= 13, "Age must be older than 13"))
                                              .Add(n => (n <= 150, "Age must be younger then 150"))
                                              );

            StringConverterProvider.Global.Register(new UriConverter());

            ComponentsProvider.Global.Register(WORK_TITLES_COMPONENT,
                                               InputSelection.FromEnum <WorkTitles>());

            ComponentsProvider.Global.Register(URL_COMPONENT,
                                               InputText.Create <Uri>("Url"));
        }
示例#11
0
 public static AquosCommand Input(InputSelection selection)
 {
     return new AquosCommand(InputSelectionCommand, (int) selection);
 }
示例#12
0
 public void StartTurn()
 {
     _turnResolver.StartNewTurn();
     InputSelection.ToggleEnabled(true);
 }
示例#13
0
        private static async void StartDemo()
        {
            const string NAME = "#BUFFER_SELECTION123#";

            ConsoleBuffer.MemoriseBufferPosition(NAME);

            Console.WriteLine("Select 1 option");
            var selection = InputSelection.From <TestClass>()
                            .AddOption(new TestClass {
                Name = "option1"
            })
                            .AddOption(new TestClass {
                Name = "option2"
            })
                            .AddOption(new TestClass {
                Name = "option3"
            })
                            .AddOption(new TestClass {
                Name = "option4"
            });

            var result1 = await selection.RequestInput();

            Console.WriteLine($"Selected => {result1.First()}");
            ConsoleI.AwaitContinue();
            ConsoleBuffer.ClearBufferFrom(NAME);

            Console.WriteLine("Select 1 to 5 options");
            var selection2 = InputSelection.From <TestClass>()
                             .SetMaxSelected(5)
                             .AddOption(new TestClass {
                Name = "option1"
            })
                             .AddOption(new TestClass {
                Name = "option2"
            })
                             .AddOption(new TestClass {
                Name = "option3"
            })
                             .AddOption(new TestClass {
                Name = "option4"
            })
                             .AddOption(new TestClass {
                Name = "option5"
            })
                             .AddOption(new TestClass {
                Name = "option6"
            })
                             .AddOption(new TestClass {
                Name = "option7"
            })
                             .AddOption(new TestClass {
                Name = "option8"
            })
                             .AddOption(new TestClass {
                Name = "option9"
            })
                             .AddOption(new TestClass {
                Name = "option10"
            })
                             .AddOption(new TestClass {
                Name = "option11"
            });

            var result2 = await selection2.RequestInput();

            foreach (var r in result2)
            {
                Console.WriteLine($"Selected => {r}");
            }
            ConsoleI.AwaitContinue();
            ConsoleBuffer.ClearBufferFrom(NAME);

            Console.WriteLine("Also works with ENUM");
            var result3 = await InputSelection
                          .FromEnum <EnumTest>()
                          .RequestInput();

            foreach (var r in result3)
            {
                Console.WriteLine($"Selected => {(int)r}");
            }
            ConsoleI.AwaitContinue();
            ConsoleBuffer.ClearBufferFrom(NAME);
        }
 public abstract HashSet <string> Resolve(IDictionary <string, object> contextProperties, Stream bodyStream, InputSelection bodyInputSelection, string contextKeySelected, InputSelection contextInputSelection);