Advertisement
Guest User

Untitled

a guest
Jul 27th, 2015
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.58 KB | None | 0 0
  1. namespace Account_Manager
  2. {
  3.     public class category
  4.     {
  5.         int id;
  6.         string name;
  7.         int color;
  8.  
  9.         public category()
  10.         {
  11.             ;
  12.         }
  13.         public category(int id, string name, int color)
  14.         {
  15.             this.id = id;
  16.             this.name= name;
  17.             this.color = color;
  18.         }
  19.  
  20.     }
  21.  
  22.     public class categoryList
  23.     {
  24.  
  25.         private List<category> _categoryList = new List<category>();
  26.  
  27.         public static categoryList cat= new categoryList();
  28.         public static async Task<List<category>> GetCategoryListAsync()
  29.         {
  30.             await cat.getData();
  31.  
  32.             return cat._categoryList;
  33.         }
  34.         public async Task getData()
  35.         {
  36.  
  37.                     cat._categoryList.Add(new category(1, "Facebook", 1));
  38.                     cat._categoryList.Add(new category(1, "Facebook", 1));
  39.                     cat._categoryList.Add(new category(1, "Facebook", 1));
  40.                     cat._categoryList.Add(new category(1, "Facebook", 1));
  41.                     cat._categoryList.Add(new category(1, "Facebook", 1));
  42.                     cat._categoryList.Add(new category(1, "Facebook", 1));
  43.                     cat._categoryList.Add(new category(1, "Facebook", 1));
  44.                     cat._categoryList.Add(new category(1, "Facebook", 1));
  45.                     cat._categoryList.Add(new category(1, "Facebook", 1));
  46.         }
  47.         public async Task addData(category val)
  48.         {
  49.             cat._categoryList.Add(val);
  50.             await saveCateforyList();
  51.  
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement