Exemplo n.º 1
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    private void Expand(RECURSE recurse, int paramDepth = -1)
    {
        if ((parent != null) && (expanded == false))
        {
            expanded = true;

            ExpandOverride();

            if (itemList != null)
            {
                itemList.SetUpdateHierarchy();
            }
        }

        if (paramDepth < 0)
        {
            for (UIListItemData cur = parent; (cur != null) && (cur.parent != null); cur = cur.parent)
            {
                parent.Expand(RECURSE.NO, 0);
            }
        }

        if (recurse == RECURSE.YES)
        {
            for (int child = 0; child < childs.Count; ++child)
            {
                childs[child].Expand(recurse, paramDepth + 1);
            }
        }
    }
Exemplo n.º 2
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    static public int CompareDescending(UIListItemData a, UIListItemData b)
    {
        object A = (a != null) ? a.userDatas : null;

        object B = (b != null) ? b.userDatas : null;

        if ((A == null) && (B == null))
        {
            return(0);
        }

        if ((A == null) || (B == null))
        {
            return((A != null) ? -1 : 1);
        }

        if ((A is Site) ^ (B is Site))
        {
            return((A is Site) ? -1 : 1);
        }


        Localizable LocA = A as Localizable;

        Localizable LocB = B as Localizable;

        return(LocB.name.CompareTo(LocA.name));
    }
Exemplo n.º 3
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public Localizable()
    {
        Register(this);

        m_name = defaultName;

        m_ListItemDatas = new UIListItemData(null, this);
    }
Exemplo n.º 4
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    private void SelectItem(int index)
    {
        UIListItem item = (index >= 0) ? this[index] : null;

        UIListItemData data = (item != null) ? item.datas    : null;

        if (data != null)
        {
            SelectItemUserDatas(data.userDatas);
        }
    }
Exemplo n.º 5
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public void SetItemsDatas(UIListItemData root)
    {
        Clear();

        if ((datasRoot = root) != null)
        {
            for (int data = 0; data < root.childs.Count; ++data)
            {
                AddItemData(root.childs[data]);
            }
        }
    }
Exemplo n.º 6
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public FileSystemEntry(UIListItemData parent, FSFilter paramFilter = null) : base(parent, null)
    {
        userDatas = this;

        dir = false;

        listDirs = false;

        listFiles = false;

        name = string.Empty;

        path = string.Empty;

        displayFilter = paramFilter;
    }
Exemplo n.º 7
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    private void AddItemData(UIListItemData itemData)
    {
        if (itemData != null)
        {
            datas.Add(itemData);

            itemData.itemList = this;

            if (itemData.expanded)
            {
                for (int data = 0; data < itemData.childs.Count; ++data)
                {
                    AddItemData(itemData.childs[data]);
                }
            }
        }
    }
Exemplo n.º 8
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public void RemoveChild(UIListItemData child)
    {
        if (child == null)
        {
            return;
        }

        if (child.parent != this)
        {
            return;
        }

        childs.Remove(child);

        child.parent = null;

        child.depth = -1;
    }
Exemplo n.º 9
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public void AddChild(UIListItemData child)
    {
        if (child == null)
        {
            return;
        }

        if (child.parent != null)
        {
            return;
        }

        childs.Add(child);

        child.parent = this;

        child.depth = depth + 1;
    }
Exemplo n.º 10
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public UIListItemData(UIListItemData paramParent, object paramUserDatas)
    {
        itemList = null;

        depth = -1;

        expanded = false;

        userDatas = paramUserDatas;

        parent = null;

        childs = new List <UIListItemData>();

        if (paramParent != null)
        {
            paramParent.AddChild(this);
        }
    }