public Task AddTag(AsanaTag proj, Asana host) { Dictionary <string, object> Tag = new Dictionary <string, object>(); Tag.Add("tag", proj.ID); AsanaResponseEventHandler savedCallback = null; savedCallback = (s) => { // add it manually if (Tags == null) { Tags = new AsanaTag[1]; } else { AsanaTag[] lTags = Tags; Array.Resize(ref lTags, Tags.Length + 1); Tags = lTags; } Tags[Tags.Length - 1] = proj; Saving -= savedCallback; }; Saving += savedCallback; return(host.Save(this, AsanaFunction.GetFunction(Function.AddTagToTask), Tag)); }
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 RemoveTag(AsanaTag proj, Asana host) { Dictionary <string, object> Tag = new Dictionary <string, object>(); Tag.Add("tag", proj.ID); AsanaResponseEventHandler savedCallback = null; savedCallback = (s) => { // add it manually int index = Array.IndexOf(Tags, proj); AsanaTag[] lTags = new AsanaTag[Tags.Length - 1]; if (index != 0) { Array.Copy(Tags, lTags, index); } Array.Copy(Tags, index + 1, lTags, index, lTags.Length - index); Tags = lTags; Saving -= savedCallback; }; Saving += savedCallback; return(host.Save(this, AsanaFunction.GetFunction(Function.RemoveTagFromTask), Tag)); }
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 static Task Save(this AsanaObject obj, Asana host) { return(host.Save(obj, null)); }
public static Task Save(this AsanaObject obj, Asana host, AsanaFunction function) { return(host.Save(obj, function)); }
static public void Save(this AsanaObject obj, Asana host) { host.Save(obj, null); }
static public void Save(this AsanaObject obj, Asana host, AsanaFunction function) { host.Save(obj, function); }
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); }
public Task RemoveTag(AsanaTag proj, Asana host) { Dictionary<string, object> Tag = new Dictionary<string, object>(); Tag.Add("tag", proj.ID); AsanaResponseEventHandler savedCallback = null; savedCallback = (s) => { // add it manually int index = Array.IndexOf(Tags, proj); AsanaTag[] lTags = new AsanaTag[Tags.Length - 1]; if (index != 0) Array.Copy(Tags, lTags, index); Array.Copy(Tags, index + 1, lTags, index, lTags.Length - index); Tags = lTags; Saving -= savedCallback; }; Saving += savedCallback; return host.Save(this, AsanaFunction.GetFunction(Function.RemoveTagFromTask), Tag); }
public Task AddTag(AsanaTag proj, Asana host) { Dictionary<string, object> Tag = new Dictionary<string, object>(); Tag.Add("tag", proj.ID); AsanaResponseEventHandler savedCallback = null; savedCallback = (s) => { // add it manually if (Tags == null) Tags = new AsanaTag[1]; else { AsanaTag[] lTags = Tags; Array.Resize(ref lTags, Tags.Length + 1); Tags = lTags; } Tags[Tags.Length - 1] = proj; Saving -= savedCallback; }; Saving += savedCallback; return host.Save(this, AsanaFunction.GetFunction(Function.AddTagToTask), Tag); }