Exemplo n.º 1
0
 private void AddSprites(EmojiSpritesCreator eSpC)
 {
   Execute.ExecuteOnUIThread((Action) (() =>
   {
     SpritesPack spritesPack = eSpC.SpritesPack;
     List<SpriteDescription> spritesVertical = spritesPack.SpritesVertical;
     List<SpriteDescription> spritesHorizontal = spritesPack.SpritesHorizontal;
     this.myPanel.ClearItems();
     List<IVirtualizable> virtualizableList = new List<IVirtualizable>();
     for (int index = 0; index < spritesHorizontal.Count; ++index)
     {
       SpriteDescription vertSpriteDesc;
       if (index >= spritesVertical.Count)
         vertSpriteDesc = new SpriteDescription()
         {
           SpritePath = "",
           Elements = new List<SpriteElementData>()
         };
       else
         vertSpriteDesc = spritesVertical[index];
       SpriteDescription horSpriteDesc = spritesHorizontal[index];
       int num = this.IsHorizontal ? 1 : 0;
       SpriteItem spriteItem = new SpriteItem(vertSpriteDesc, horSpriteDesc, num != 0);
       if (index == 0)
         spriteItem.Margin = new Thickness(0.0, 6.0, 0.0, 0.0);
       virtualizableList.Add((IVirtualizable) spriteItem);
     }
     this.myPanel.AddItems((IEnumerable<IVirtualizable>) virtualizableList);
   }));
 }
Exemplo n.º 2
0
 private void AddSprites(EmojiSpritesCreator eSpC)
 {
     Execute.ExecuteOnUIThread((Action)(() =>
     {
         SpritesPack spritesPack = eSpC.SpritesPack;
         List <SpriteDescription> spritesVertical = spritesPack.SpritesVertical;
         List <SpriteDescription> spritesHorizontal = spritesPack.SpritesHorizontal;
         this.myPanel.ClearItems();
         List <IVirtualizable> virtualizableList = new List <IVirtualizable>();
         for (int index = 0; index < spritesVertical.Count || index < spritesHorizontal.Count; ++index)
         {
             SpriteItem spriteItem = new SpriteItem(index < spritesVertical.Count ? spritesVertical[index] : new SpriteDescription(), index < spritesHorizontal.Count ? spritesHorizontal[index] : new SpriteDescription(), this.IsHorizontal);
             if (index == 0)
             {
                 spriteItem.Margin = new Thickness(0.0, 6.0, 0.0, 0.0);
             }
             virtualizableList.Add((IVirtualizable)spriteItem);
         }
         this.myPanel.AddItems((IEnumerable <IVirtualizable>)virtualizableList);
     }));
 }