Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
 public static Task Save(this AsanaObject obj, Asana host)
 {
     return(host.Save(obj, null));
 }
Ejemplo n.º 6
0
 public static Task Save(this AsanaObject obj, Asana host, AsanaFunction function)
 {
     return(host.Save(obj, function));
 }
Ejemplo n.º 7
0
 static public void Save(this AsanaObject obj, Asana host)
 {
     host.Save(obj, null);
 }
Ejemplo n.º 8
0
 static public void Save(this AsanaObject obj, Asana host, AsanaFunction function)
 {
     host.Save(obj, function);
 }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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);
        }