示例#1
0
 public void setListboxItems(List<string> items)
 {
     foreach (string item in items)
     {
         listBox1.Items.Add(item);
     }
 }
        public List<string> getCopyTextOnList(int listId)
        {
            List<string> copiesOnList = new List<string>();

            List<int> copyIdsOnList = getCopyIdsOnList(listId);
            foreach(int id in copyIdsOnList)
            {
                //get the copy from the database with a matching id
                Copy copyFromList = database.Copies.Single(c => c.Id == id);
                copiesOnList.Add(copyFromList.Text);
            }
            return copiesOnList;
        }
 private List<int> getCurrentCopyIds()
 {
     List<int> copyIds = new List<int>();
     var clipboardLines = database.ClipboardLines;
     foreach(var line in clipboardLines)
     {
         copyIds.Add(line.CopyId);
     }
     return copyIds;
 }
        private List<int> getCopyIdsOnList(int listId)
        {
            List<int> copyIdsOnList = new List<int>();
            //get all of the list lines that match the list
            var listLinesFromList = database.ListLines.Where(l => l.ListId == listId);
            foreach(ListLine line in listLinesFromList)
            {
                copyIdsOnList.Add(line.CopyId);
            }

            return copyIdsOnList;
        }
 private int createNewListEntry(string listName)
 {
     List newList = new List();
     newList.Name = listName;
     database.Lists.InsertOnSubmit(newList);
     database.SubmitChanges();
     return newList.Id;
 }
 partial void DeleteList(List instance);
 partial void UpdateList(List instance);
 partial void InsertList(List instance);