/// <summary>
        /// Sets component data with specified item.
        /// </summary>
        /// <param name="item">Item.</param>
        public void SetData(ListViewIconsItemDescription item)
        {
            if (item == null)
            {
                Icon.sprite = null;
                Text.text   = string.Empty;
            }
            else
            {
                Icon.sprite = item.Icon;
                Text.text   = item.Name;
            }

            Icon.SetNativeSize();
            //set transparent color if no icon
            Icon.color = (Icon.sprite == null) ? new Color(0, 0, 0, 0) : Color.white;
        }
예제 #2
0
        /// <summary>
        /// Process dropped data.
        /// </summary>
        /// <param name="data">Data.</param>
        /// <param name="eventData">Event data.</param>
        public void Drop(ListViewIconsItemDescription data, PointerEventData eventData)
        {
            if (Source.Nodes == null)
            {
                Source.Nodes = new ObservableList <TreeNode <TreeViewItem> >();
            }

            var newItem = new TreeViewItem(data.Name)
            {
                LocalizedName = data.LocalizedName,
                Icon          = data.Icon,
                Value         = data.Value
            };
            var newNode = new TreeNode <TreeViewItem>(newItem);

            Source.Nodes.Add(newNode);
        }
예제 #3
0
        /// <summary>
        /// Process dropped data.
        /// </summary>
        /// <param name="data">Data.</param>
        /// <param name="eventData">Event data.</param>
        public void Drop(TreeNode <TreeViewItem> data, PointerEventData eventData)
        {
            var index = ListView.GetNearestIndex(eventData);

            var item = new ListViewIconsItemDescription()
            {
                Name          = data.Item.Name,
                LocalizedName = data.Item.LocalizedName,
                Icon          = data.Item.Icon,
                Value         = data.Item.Value
            };

            AddItem(item, index);

            // remove node from tree
            data.Parent = null;

            HideDropIndicator();
        }
예제 #4
0
        /// <summary>
        /// Sets component data with specified item.
        /// </summary>
        /// <param name="item">Item.</param>
        public void SetData(ListViewIconsItemDescription item)
        {
            if (item == null)
            {
                Icon.sprite = null;
                Text.text   = string.Empty;
            }
            else
            {
                Icon.sprite = item.Icon;
                Text.text   = item.LocalizedName ?? item.Name;
            }

            if (SetNativeSize)
            {
                Icon.SetNativeSize();
            }

            //set transparent color if no icon
            Icon.color = (Icon.sprite == null) ? Color.clear : Color.white;
        }
예제 #5
0
 /// <summary>
 /// Handle canceled drop.
 /// </summary>
 /// <param name="data">Data.</param>
 /// <param name="eventData">Event data.</param>
 public void DropCanceled(ListViewIconsItemDescription data, PointerEventData eventData)
 {
 }
예제 #6
0
 /// <summary>
 /// Determines whether this instance can receive drop with the specified data and eventData.
 /// </summary>
 /// <returns><c>true</c> if this instance can receive drop with the specified data and eventData; otherwise, <c>false</c>.</returns>
 /// <param name="data">Data.</param>
 /// <param name="eventData">Event data.</param>
 public bool CanReceiveDrop(ListViewIconsItemDescription data, PointerEventData eventData)
 {
     return(true);
 }
예제 #7
0
        // Token: 0x06004819 RID: 18457 RVA: 0x001835EC File Offset: 0x001819EC
        public override bool Equals(object obj)
        {
            ListViewIconsItemDescription listViewIconsItemDescription = obj as ListViewIconsItemDescription;

            return(listViewIconsItemDescription != null && (!(listViewIconsItemDescription.Icon == null) || !(this.Icon != null)) && (!(listViewIconsItemDescription.Icon != null) || !(this.Icon == null)) && this.Name == listViewIconsItemDescription.Name && ((this.Icon == null && listViewIconsItemDescription.Icon == null) || this.Icon.Equals(listViewIconsItemDescription.Icon)));
        }
 /// <summary>
 /// Process canceled drop.
 /// </summary>
 /// <param name="data">Data.</param>
 /// <param name="eventData">Event data.</param>
 public void DropCanceled(ListViewIconsItemDescription data, PointerEventData eventData)
 {
     // hide line from CanReceiveDrop()
 }
        /// <summary>
        /// Process dropped data.
        /// </summary>
        /// <param name="data">Data.</param>
        /// <param name="eventData">Event data.</param>
        public void Drop(ListViewIconsItemDescription data, PointerEventData eventData)
        {
            var listView = GetComponent <ListViewIcons>();

            listView.DataSource.Add(data);
        }
예제 #10
0
 /// <summary>
 /// Process canceled drop.
 /// </summary>
 /// <param name="data">Data.</param>
 /// <param name="eventData">Event data.</param>
 public void DropCanceled(ListViewIconsItemDescription data, PointerEventData eventData)
 {
     HideDropIndicator();
 }