Exemplo n.º 1
0
        public ListFolderResponse OnListFolder(ListFolder list)
        {
            ListFolderResponse response = new ListFolderResponse();

            response.Items = mTestFolderManager.ListFolders();
            return(response);
        }
Exemplo n.º 2
0
        public void OnList(ListFolderResponse e)
        {
            //lstFolders.Items.Clear();
            foreach (FolderInfo item in e.Items)
            {
                FolderListViewItem vi = lstFolders.Items.Cast <FolderListViewItem>().FirstOrDefault(i => i.Info.Name == item.Name);
                if (vi != null)
                {
                    vi.Info = item;
                }
                else
                {
                    lstFolders.Items.Add(new FolderListViewItem(item));
                }
            }
            List <FolderListViewItem> removes = new List <FolderListViewItem>();

            foreach (FolderListViewItem vitem in lstFolders.Items.Cast <FolderListViewItem>())
            {
                if (!e.Items.Contains(vitem.Info))
                {
                    removes.Add(vitem);
                }
            }
            foreach (FolderListViewItem vitem in removes)
            {
                lstFolders.Items.Remove(vitem);
            }
        }
Exemplo n.º 3
0
 public void OnList(ListFolderResponse e)
 {
     lstFolders.Items.Clear();
     foreach (string item in e.Items)
     {
         lstFolders.Items.Add(item, 0);
     }
 }