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 RemoveTag(AsanaTag 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(RemoveTag(proj, Host)); }
public Task Get <AsanaT>(AsanaTag arg1, AsanaCollectionResponseEventHandler callback) where AsanaT : AsanaObject { AsanaRequest request = default(AsanaRequest); if (typeof(AsanaT) == typeof(AsanaTask)) { request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetTasksByTag), arg1); return(request.Go((o, h) => PackAndSendResponseCollection <AsanaTask>(o, callback), ErrorCallback)); } throw new TypeAccessException("Unknown type for this request: " + typeof(AsanaT).Name); }
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 GetTasksByTag(AsanaTag arg1, AsanaCollectionResponseEventHandler callback) { var request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetTasksByTag), arg1); return request.Go((o, h) => PackAndSendResponseCollection<AsanaTask>(o, callback), ErrorCallback); }
public Task <IAsanaObjectCollection <AsanaTask> > GetTasksByTagAsync(AsanaTag asanaTag) { var request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetTasksByTag), asanaTag); return(request.GoCollectionAsync <AsanaTask>()); }
public Task GetTasksByTag(AsanaTag asanaTag, AsanaCollectionResponseEventHandler callback) { var request = GetBaseRequest(AsanaFunction.GetFunction(Function.GetTasksByTag), asanaTag); return(request.Go((o, h) => PackAndSendResponseCollection <AsanaTask>(o, callback), ErrorCallback)); }
public Task RemoveTag(AsanaTag 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 RemoveTag(proj, Host); }
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); }