Exemplo n.º 1
0
        private void gtv_OnGetNodeText(Genius.Controls.TreeView.GeniusTreeView Sender, Genius.Controls.TreeView.NodeTextEventArgs e)
        {
            VistaItem aItem = e.Node.Data as VistaItem;

            switch (e.DisplayColumn)
            {
            case 0:
                e.Text = aItem.Name;
                break;

            case 1:
                Int64 size = aItem.Size;
                if (size >= 0)
                {
                    e.Text = size.ToString();
                }
                else
                {
                    e.Text = string.Empty;
                }
                break;

            case 2:
                e.Text = aItem.FileType;
                break;

            case 3:
                if (aItem.Date > DateTime.MinValue)
                {
                    e.Text = aItem.Date.ToString();
                }
                break;
            }
        }
Exemplo n.º 2
0
            public int Compare(object x, object y)
            {
                VistaItem a = x as VistaItem;
                VistaItem b = y as VistaItem;

                switch (FSortBy)
                {
                case GroupBy.Name:
                    return(a.Name.CompareTo(b.Name));

                case GroupBy.Date:
                    return(a.Date.CompareTo(b.Date));

                case GroupBy.Type:
                    return(a.FileType.CompareTo(b.FileType));
                }
                return(0);
            }
Exemplo n.º 3
0
 private static void AddToGroup(ArrayList childs, GroupBy by, ArrayList aSrc, IComparable min, IComparable max)
 {
     if (by == GroupBy.Name)
     {
         int i = 0;
         while (i < aSrc.Count)
         {
             VistaItem aItem = aSrc[i] as VistaItem;
             string    aName = aItem.Name.ToLower();
             if (aName.CompareTo(min) >= 0 && aName.CompareTo(max) < 0)
             {
                 childs.Add(aItem);
                 aSrc.RemoveAt(i);
                 i--;
             }
             i++;
         }
     }
 }
Exemplo n.º 4
0
        private System.IComparable gtv_OnGetNodeValue(Genius.Controls.TreeView.INode A, int aDisplayColumn)
        {
            VistaItem aItem = A.Data as VistaItem;

            if (aItem is VistaGroup)
            {
                return(aItem.Name);
            }
            switch (aDisplayColumn)
            {
            case 0:
                return(aItem.Name);

            case 1:
                return(aItem.Size);

            case 2:
                return(aItem.FileType);

            case 3:
                return(aItem.Date);
            }
            return(null);
        }