Aspose.Tasks.Examples.CSharp.WorkingWithResources.SetResourceCalendar.Run C# (CSharp) Method

Run() public static method

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

            // ExStart:SetResourceCalendar
            // Create project instance and add resource
            Project project = new Project();
            Resource res = project.Resources.Add("Resource1");

            // Add standard calendar and assign to resource
            Aspose.Tasks.Calendar cal = project.Calendars.Add("Resource1");
            res.Set(Rsc.Calendar, cal);
            // ExEnd:SetResourceCalendar

            // Save project as XML
            project.Save(dataDir + "SetResourceCalendar_out.xml", SaveFileFormat.XML);
        }
    }
SetResourceCalendar