FairyGUI.GList.AddSelection C# (CSharp) Method

AddSelection() public method

public AddSelection ( int index, bool scrollItToView ) : void
index int
scrollItToView bool
return void
        public void AddSelection(int index, bool scrollItToView)
        {
            if (selectionMode == ListSelectionMode.None)
                return;

            CheckVirtualList();

            if (selectionMode == ListSelectionMode.Single)
                ClearSelection();

            if (scrollItToView)
                ScrollToView(index);

            index = ItemIndexToChildIndex(index);
            if (index < 0 || index >= _children.Count)
                return;

            GButton obj = GetChildAt(index).asButton;
            if (obj != null && !obj.selected)
                obj.selected = true;
        }

Usage Example

示例#1
0
 static public int AddSelection(IntPtr l)
 {
     try {
         FairyGUI.GList self = (FairyGUI.GList)checkSelf(l);
         System.Int32   a1;
         checkType(l, 2, out a1);
         System.Boolean a2;
         checkType(l, 3, out a2);
         self.AddSelection(a1, a2);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of FairyGUI.GList::AddSelection