public void TestConcatenating2()
        {
            ObservableCollection <ObservableCollection <Item> > items = new ObservableCollection <ObservableCollection <Item> >(
                new[]
            {
                new ObservableCollection <Item>(
                    new[]
                {
                    new Item(),
                    new Item(),
                    new Item(),
                    new Item()
                }
                    ),
                new ObservableCollection <Item>(
                    new[]
                {
                    new Item(),
                    new Item(),
                    new Item(),
                    new Item()
                }
                    )
            }
                );

            OcConsumer             consumer       = new OcConsumer();
            Concatenating <Item>   concatenating1 = items.Concatenating();
            Selecting <Item, Item> concatenating  = concatenating1.Selecting(i => i).For(consumer);

            concatenating1.For(consumer);

            concatenating.ValidateInternalConsistency();
            consumer.Dispose();
        }
Exemple #2
0
 protected virtual void OnSelecting(ItemListEventArgs args)
 {
     if (Selecting != null)
     {
         Selecting.Invoke(this, args);
     }
 }
Exemple #3
0
        public virtual void SelectByText(string value)
        {
            Selecting?.Invoke(this, new ComponentActionEventArgs(this, value));

            if (WrappedElement.Text != value)
            {
                WrappedElement.SendKeys(value);
            }

            Selected?.Invoke(this, new ComponentActionEventArgs(this, value));
        }
Exemple #4
0
 protected override void SetUpAwake()
 {
     base.SetUpAwake();
     gameObject.tag   = "Enemy";
     gameObject.layer = LayerMask.NameToLayer("Enemy");
     anim             = GetComponent <Animator>();
     selecting        = Instantiate(VFXManager.SelectingEnemyPrefab, transform);
     selecting.StartUp(this);
     selecting.gameObject.SetActive(false);
     render.sortingLayerName = "Current";
 }
Exemple #5
0
        protected virtual void DefaultSelectByIndex(Select select, int index)
        {
            Selecting?.Invoke(this, new ElementActionEventArgs(select, index.ToString()));

            var nativeSelect = new SelectElement(WrappedElement);

            nativeSelect.SelectByIndex(index);
            WrappedElement     = null;
            ShouldCacheElement = false;
            Selected?.Invoke(this, new ElementActionEventArgs(select, nativeSelect.SelectedOption.Text));
        }
Exemple #6
0
        protected virtual void DefaultSelectByText(Select select, string value)
        {
            Selecting?.Invoke(this, new ElementActionEventArgs(select, value));

            var nativeSelect = new SelectElement(WrappedElement);

            nativeSelect.SelectByText(value);
            WrappedElement     = null;
            ShouldCacheElement = false;
            Selected?.Invoke(this, new ElementActionEventArgs(select, value));
        }
Exemple #7
0
        public void SelectByText(string value)
        {
            Selecting?.Invoke(this, new ElementActionEventArgs <IOSElement>(this, value));

            if (WrappedElement.Text != value)
            {
                WrappedElement.Click();
                var elementCreateService = ServicesCollection.Current.Resolve <ElementCreateService>();
                var innerElementToClick  = elementCreateService.CreateByValueContaining <RadioButton>(value);
                innerElementToClick.Click();
            }

            Selected?.Invoke(this, new ElementActionEventArgs <IOSElement>(this, value));
        }
Exemple #8
0
        public virtual void SelectByText(string value)
        {
            Selecting?.Invoke(this, new ComponentActionEventArgs <OpenQA.Selenium.Appium.Android.AndroidElement>(this, value));

            if (WrappedElement.Text != value)
            {
                WrappedElement.Click();
                var elementCreateService = ServicesCollection.Current.Resolve <ComponentCreateService>();
                var innerElementToClick  = elementCreateService.CreateByTextContaining <RadioButton>(value);
                innerElementToClick.Click();
            }

            Selected?.Invoke(this, new ComponentActionEventArgs <OpenQA.Selenium.Appium.Android.AndroidElement>(this, value));
        }
Exemple #9
0
        public void SubExpessing()
        {
            Param param = new Param();
            ObservableCollection <Item> items = new ObservableCollection <Item>(
                new[]
            {
                new Item(true),
                new Item(false),
                new Item(true),
                new Item(false),
                new Item(true)
            }
                );

            Filtering <Item> filtering = Expr.Is(() => items).Computing().Filtering(item =>
                                                                                    Expr.Is(() => param.Value
                    ? (ObservableCollection <Item>)items.Filtering(item1 => true)
                    : items.Filtering(item1 => item1.IsActive == item.IsActive)).Computing().Value.Count == 3).IsNeededFor(consumer);

            Filtering <Item> filtering2 = items.Filtering(item =>
                                                          (param.Value
                    ? items.Filtering(item1 => true)
                    : items.Filtering(item1 => item1.IsActive == item.IsActive)).Count == 3).IsNeededFor(consumer);

            Expression <Func <ObservableCollection <Item> > > expression = () => param.Value
                ? (ObservableCollection <Item>)items.Filtering(item1 => true)
                : items.Filtering(item1 => item1.IsActive == false);

            Selecting <Item, bool> selecting = expression.Computing().Selecting(item => item.IsActive).IsNeededFor(consumer);

            filtering.ValidateConsistency();
            filtering2.ValidateConsistency();

            param.Value = true;

            filtering.ValidateConsistency();
            filtering2.ValidateConsistency();
            consumer.Dispose();
        }
Exemple #10
0
    public static void LoadData()
    {
        // Load Prefabs
        FirePrefab           = Resources.Load <ControlPartice>("Prefabs/VFXBurnt");
        PoisonPrefab         = Resources.Load <ControlPartice>("Prefabs/VFXPoison");
        DustPrefab           = Resources.Load <Dust>("Prefabs/Bui");
        SelectingEnemyPrefab = Resources.Load <Selecting>("Prefabs/SelectingEnemy");
        giatDien             = Resources.Load <AnimationQ>("Prefabs/VFXGiatDien");
        IcePrefab            = Resources.Load <SpriteRenderer>("Prefabs/Ice");
        // Load Sprites

        SpritesDust = Resources.LoadAll <Sprite>("Sprites/bui");
        SpritesIce  = Resources.LoadAll <Sprite>("Sprites/Ices");

        // LoadPooling
        PoolingParrent = new GameObject("PoolingParrent").transform;
        PoolingParrent.transform.parent = GameController.Instance.transform;
        IDPooling_Fire   = PoolingGameObject.PoolingMain.AddPrefab(FirePrefab);
        IDPooling_Dust   = PoolingGameObject.PoolingMain.AddPrefab(DustPrefab);
        IDPooling_Poison = PoolingGameObject.PoolingMain.AddPrefab(PoisonPrefab);

        Debug.Log("VFX Loaded");
    }
 internal void OnSelecting(SelectingEventArgs args)
 {
     Selecting?.Invoke(this, args);
 }
Exemple #12
0
 //This is responsible for indicating the selected character, and providing confirmation functionality
 private void CharacterSelect(object sender, RoutedEventArgs e)
 {
     clickCount += 1;
     if (CharacterSelecting == Selecting.player)
     {
         //On character select
         if (clickCount == 0)
         {
             Selected.Text = ((Button)sender).Tag.ToString();
             AssignCharacter();
             UpdateStatBars();
             ConfirmMessage.Visibility = Visibility.Visible;
         }
         //Selecting first character
         else if (clickCount == 1)
         {
             //Clicking another character
             if (Selected.Text != ((Button)sender).Tag.ToString())
             {
                 ConfirmMessage.Visibility = Visibility.Visible;
                 Selected.Text             = ((Button)sender).Tag.ToString();
                 AssignCharacter();
                 UpdateStatBars();
             }
             //Character confirmed
             else if (Selected.Text == ((Button)sender).Tag.ToString())
             {
                 CharacterSelecting = Selecting.computer;
                 Selected.Text      = "";
                 SwitchToComputer();
             }
             clickCount = 0;
         }
     }
     else if (CharacterSelecting == Selecting.computer)
     {
         //On character select
         if (clickCount == 0)
         {
             Selected.Text = ((Button)sender).Tag.ToString();
             AssignCharacter();
             UpdateStatBars();
             ConfirmMessage.Visibility = Visibility.Visible;
         }
         //Selecting first character
         else if (clickCount == 1)
         {
             //Clicking another character
             if (Selected.Text != ((Button)sender).Tag.ToString())
             {
                 ConfirmMessage.Visibility = Visibility.Visible;
                 Selected.Text             = ((Button)sender).Tag.ToString();
                 AssignCharacter();
                 UpdateStatBars();
             }
             //Character confirmed
             else if (Selected.Text == ((Button)sender).Tag.ToString())
             {
                 AssignCharacter();
                 CharacterSelecting            = Selecting.computer;
                 Selected.Visibility           = Visibility.Collapsed;
                 ComputerSelectName.Visibility = Visibility.Collapsed;
                 ConfirmMessage.Visibility     = Visibility.Collapsed;
                 SelectedTxt.Visibility        = Visibility.Collapsed;
                 VersusMessage.Text            = $"{PlayerCharacter} vs. {ComputerCharacter}";
             }
             clickCount = 0;
         }
     }
 }
Exemple #13
0
 internal static void OnSelecting() => Selecting?.Invoke(null, EventArgs.Empty);