private void removeSubFoldersRef(Folder folder) { OnPropertyChanging(); folder.ParentFolderRef = null; }
private void addSubFoldersRef(Folder folder) { OnPropertyChanging(); folder.ParentFolderRef = this; }
public void CreateFolder(string name, Folder parentFolder = null) { Folder folder = new Folder { Name = name }; db.Folders.InsertOnSubmit(folder); if (parentFolder != null) { parentFolder.SubFoldersRef.Add(folder); } db.SubmitChanges(); AllFolderItems.Add(folder); }
public void DeleteFolder(Folder folder) { //foreach (Activity item in folder.ActivitiesRef) { deleteActivity(item); }; if (folder.ParentFolderRef != null) { folder.ParentFolderRef.SubFoldersRef.Remove(folder); } AllFolderItems.Remove(folder); db.Folders.DeleteOnSubmit(folder); db.SubmitChanges(); }
public void CreateActivity(string name, Folder folder = null) { Activity activity = new Activity { Name = name }; db.Activities.InsertOnSubmit(activity); if (folder != null) { folder.ActivitiesRef.Add(activity); } db.SubmitChanges(); AllActivityItems.Add(activity); }