Aspose.Tasks.Examples.CSharp.WorkingWithTasks.CreateTasks.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            try
            {
                // The path to the documents directory.
                string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName);

                // ExStart:CreateTasks
                // Create project instance
                Project project = new Project();

                // Add task, sub task and save project
                Task task = project.RootTask.Children.Add("Summary1");
                Task subtask = task.Children.Add("Subtask1");
                project.Save(dataDir + "CreateTasks_out.MPP", SaveFileFormat.MPP);
                // ExEnd:CreateTasks
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose License. You can purchase full license or get 30 day temporary license from http://www.aspose.com/purchase/default.aspx.");
            }
        }
    }
CreateTasks