public Task AddProject(AsanaProject proj, Asana host) { Dictionary <string, object> project = new Dictionary <string, object>(); project.Add("project", proj.ID); AsanaResponseEventHandler savedCallback = null; savedCallback = (s) => { // add it manually if (Projects == null) { Projects = new AsanaProject[1]; } else { AsanaProject[] lProjects = Projects; Array.Resize(ref lProjects, Projects.Length + 1); Projects = lProjects; } Projects[Projects.Length - 1] = proj; Saving -= savedCallback; }; Saving += savedCallback; return(host.Save(this, AsanaFunction.GetFunction(Function.AddProjectToTask), project)); }
public Task RemoveProject(AsanaProject proj) { if (Host == null) { throw new NullReferenceException("This AsanaObject does not have a host associated with it so you must specify one when saving."); } return(RemoveProject(proj, Host)); }
public Task Get <AsanaT>(AsanaProject arg1, String arg2, AsanaResponseEventHandler callback) where AsanaT : AsanaObject { AsanaRequest request = default(AsanaRequest); if (typeof(AsanaT) == typeof(AsanaEvent)) { request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetEventsInAProject), arg1, arg2); return(request.Go((o, h) => PackAndSendResponse <AsanaEvent>(o, callback), ErrorCallback)); } throw new TypeAccessException("Unknown type for this request: " + typeof(AsanaT).Name); }
public Task RemoveProject(AsanaProject proj, Asana host) { Dictionary <string, object> project = new Dictionary <string, object>(); project.Add("project", proj.ID); AsanaResponseEventHandler savedCallback = null; savedCallback = (s) => { // add it manually int index = Array.IndexOf(Projects, proj); AsanaProject[] lProjects = new AsanaProject[Projects.Length - 1]; if (index != 0) { Array.Copy(Projects, lProjects, index); } Array.Copy(Projects, index + 1, lProjects, index, lProjects.Length - index); Projects = lProjects; Saving -= savedCallback; }; Saving += savedCallback; return(host.Save(this, AsanaFunction.GetFunction(Function.RemoveProjectFromTask), project)); }
public Task GetTasksInAProject(AsanaProject arg1, AsanaCollectionResponseEventHandler callback) { var request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetTasksInAProject), arg1); return request.Go((o, h) => PackAndSendResponseCollection<AsanaTask>(o, callback), ErrorCallback); }
public void GetTasksInAProject(AsanaProject arg1, AsanaCollectionResponseEventHandler callback) { var request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetTasksInAProject), arg1); request.Go((o, h) => PackAndSendResponseCollection <AsanaTask>(o, callback), ErrorCallback); }
public Task <AsanaEvent> GetEventsInAProjectAsync(AsanaProject asanaProject, String string1) { var request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetEventsInAProject), asanaProject, string1); return(request.GoAsync <AsanaEvent>(true)); }
public Task GetEventsInAProject(AsanaProject asanaProject, String string1, AsanaResponseEventHandler callback) { var request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetEventsInAProject), asanaProject, string1); return(request.Go((o, h) => PackAndSendResponse <AsanaEvent>(o, callback), ErrorCallback)); }
public Task <IAsanaObjectCollection <AsanaTask> > GetTasksInAProjectAsync(AsanaProject asanaProject) { var request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetTasksInAProject), asanaProject); return(request.GoCollectionAsync <AsanaTask>()); }
public void RemoveProject(AsanaProject proj) { if (Host == null) throw new NullReferenceException("This AsanaObject does not have a host associated with it so you must specify one when saving."); RemoveProject(proj, Host); }
public void RemoveProject(AsanaProject proj, Asana host) { Dictionary<string, object> project = new Dictionary<string, object>(); project.Add("project", proj.ID); AsanaResponseEventHandler savedCallback = null; savedCallback = (s) => { // add it manually int index = Array.IndexOf(Projects, proj); AsanaProject[] lProjects = new AsanaProject[Projects.Length - 1]; if(index != 0) Array.Copy(Projects, lProjects, index); Array.Copy(Projects, index+1, lProjects, index, lProjects.Length - index); Projects = lProjects; Saving -= savedCallback; }; Saving += savedCallback; host.Save(this, AsanaFunction.GetFunction(Function.RemoveProjectFromTask), project); }
public void AddProject(AsanaProject proj, Asana host) { Dictionary<string, object> project = new Dictionary<string, object>(); project.Add("project", proj.ID); AsanaResponseEventHandler savedCallback = null; savedCallback = (s) => { // add it manually if (Projects == null) Projects = new AsanaProject[1]; else { AsanaProject[] lProjects = Projects; Array.Resize(ref lProjects, Projects.Length + 1); Projects = lProjects; } Projects[Projects.Length - 1] = proj; Saving -= savedCallback; }; Saving += savedCallback; host.Save(this, AsanaFunction.GetFunction(Function.AddProjectToTask), project); }