Skip to content

Commit

Permalink
Updated API Reference for Aspose.Tasks for .NET to 24.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasiliy Sinitsyn committed May 22, 2024
1 parent 31caf05 commit 0b65435
Show file tree
Hide file tree
Showing 27 changed files with 226 additions and 83 deletions.
24 changes: 24 additions & 0 deletions english/net/aspose.tasks.saving/csvoptions/view/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ Gets or sets a list of the view columns ([`GanttChartColumn`](../../../aspose.ta
public ProjectView View { get; set; }
```

### Examples

Shows how to use <see cref="Aspose.Tasks.Saving.CsvOptions" /> to take the columns of the default Gantt Chart and

```csharp
// save them to a CSV file.
var project = new Project(DataDir + "EstimatedMilestoneTasks.mpp");

CsvOptions options = new CsvOptions();
options.TextDelimiter = CsvTextDelimiter.Tab;

var view = project.DefaultView;
options.View = ProjectView.GetDefaultGanttChartView();
options.View.Columns.Clear();

foreach (var t in view.Table.TableFields)
{
var columnTitle = string.IsNullOrEmpty(t.Title) ? FieldHelper.GetDefaultFieldTitle(t.Field) : t.Title;
options.View.Columns.Add(new GanttChartColumn(columnTitle, 10, t.Field));
}

project.Save(OutDir + "CustomizeViewForCsvOptions_out.csv", options);
```

### See Also

* class [ProjectView](../../../aspose.tasks.visualization/projectview)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var options = new ImageSaveOptions(SaveFileFormat.Png);
options.StartDate = project.Get(Prj.StartDate).AddDays(-3);
options.EndDate = project.Get(Prj.FinishDate);
options.MarkCriticalTasks = true;
options.LegendOnEachPage = false;
options.LegendDrawingOptions = LegendDrawingOptions.NoLegend;
options.FontSettings.DefaultFontName = "Segoe UI Black";
options.FontSettings.UseProjectDefaultFont = false;
options.PageSize = PageSize.Letter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var options = new ImageSaveOptions(SaveFileFormat.Png);
options.StartDate = project.Get(Prj.StartDate).AddDays(-3);
options.EndDate = project.Get(Prj.FinishDate);
options.MarkCriticalTasks = true;
options.LegendOnEachPage = false;
options.LegendDrawingOptions = LegendDrawingOptions.NoLegend;
options.FontSettings.DefaultFontName = "Segoe UI Black";
options.FontSettings.UseProjectDefaultFont = false;
options.PageSize = PageSize.Letter;
Expand Down
32 changes: 32 additions & 0 deletions english/net/aspose.tasks.saving/saveoptions/isportrait/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,38 @@ public bool IsPortrait { get; set; }

Is not applicable when SaveOptions.PageSize == Visualization.PageSize.DefinedInView. In this case View.PageInfo.PageSettings.IsPortrait is used instead. Is not applicable when SaveOptions.CustomPageSize is set.

### Examples

Shows how to specify the page size and orientation using View settings or using SaveOptions.

```csharp
var project = new Project(DataDir + "EstimatedMilestoneTasks.mpp");

var view = project.Views.First(v => v.Screen == ViewScreen.Gantt);

PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.Timescale = Timescale.DefinedInView;
saveOptions.StartDate = new DateTime(2012, 12, 22);
saveOptions.EndDate = new DateTime(2013, 05, 10);
saveOptions.ViewSettings = view;

saveOptions.PageSize = PageSize.DefinedInView;

// In this case the page size and orientation applied from view.PageInfo.PageSettings.PaperSize and view.PageInfo.PageSettings.IsPortrait properties.
project.Save(OutDir + "WorkWithIsPortrait_out1.pdf", saveOptions);

saveOptions.PageSize = PageSize.A4;
saveOptions.IsPortrait = true;

// In this case the page size and orientation applied from properties of SaveOptions.
project.Save(OutDir + "WorkWithIsPortrait_out2.pdf", saveOptions);

saveOptions.CustomPageSize = new SizeF(400, 600);

// In this case the page size applied from SaveOptions.CustomPageSize. IsPortrait property is not taken into account.
project.Save(OutDir + "WorkWithIsPortrait_out3.pdf", saveOptions);
```

### See Also

* class [SaveOptions](../../saveoptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,53 @@ Gets or sets a value which define how to render a legend. Default value is Legen
public LegendDrawingOptions LegendDrawingOptions { get; set; }
```

### Examples

Shows how to print legend on last page

```csharp
var project = new Project(DataDir + "CreateProject2.mpp");
SaveOptions options = new PdfSaveOptions
{
// Take legend drawing options from view
LegendDrawingOptions = LegendDrawingOptions.AfterLastPage
};

project.Save(OutDir + "LegendOnSeparatePage_out.pdf", options);
```

Shows how to hide page legends.

```csharp
var project = new Project(DataDir + "CreateProject2.mpp");
SaveOptions options = new PdfSaveOptions
{
// Specify LegendDrawingOptions.NoLegend to hide legends
LegendDrawingOptions = LegendDrawingOptions.NoLegend
};

project.Save(OutDir + "HideLegendsDuringSave_out.pdf", options);
```

Shows how to use LegendDrawingOptions.DefinedInView option.

```csharp
var project = new Project(DataDir + "CreateProject2.mpp");

var view = project.Views.GetByName("&Gantt Chart");

Console.WriteLine("LegendOn option defined in view '{0}': {1}", view.Name, view.PageInfo.Legend.LegendOn);

SaveOptions options = new PdfSaveOptions
{
// Take legend drawing options from the view
LegendDrawingOptions = LegendDrawingOptions.DefinedInView,
ViewSettings = view
};

project.Save(OutDir + "Legend_DefinedInView.pdf", options);
```

### See Also

* enum [LegendDrawingOptions](../../legenddrawingoptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var options = new ImageSaveOptions(SaveFileFormat.Png)
StartDate = project.Get(Prj.StartDate).AddDays(-3),
EndDate = project.Get(Prj.FinishDate),
MarkCriticalTasks = true,
LegendOnEachPage = false,
LegendDrawingOptions = LegendDrawingOptions.NoLegend,
Gridlines = new List<Gridline>()
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var options = new ImageSaveOptions(SaveFileFormat.Png);
options.StartDate = project.Get(Prj.StartDate).AddDays(-3);
options.EndDate = project.Get(Prj.FinishDate);
options.MarkCriticalTasks = true;
options.LegendOnEachPage = false;
options.LegendDrawingOptions = LegendDrawingOptions.NoLegend;
options.FontSettings.DefaultFontName = "Segoe UI Black";
options.FontSettings.UseProjectDefaultFont = false;
options.PageSize = PageSize.Letter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var options = new ImageSaveOptions(SaveFileFormat.Png);
options.StartDate = project.Get(Prj.StartDate).AddDays(-3);
options.EndDate = project.Get(Prj.FinishDate);
options.MarkCriticalTasks = true;
options.LegendOnEachPage = false;
options.LegendDrawingOptions = LegendDrawingOptions.NoLegend;
options.FontSettings.DefaultFontName = "Segoe UI Black";
options.FontSettings.UseProjectDefaultFont = false;
options.PageSize = PageSize.Letter;
Expand Down
2 changes: 1 addition & 1 deletion english/net/aspose.tasks.saving/xamloptions/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Shows how to save a project in XAML format by using save options.
var project = new Project(DataDir + "Project2.mpp");
SaveOptions options = new XamlOptions();
options.FitContent = true;
options.LegendOnEachPage = false;
options.LegendDrawingOptions = LegendDrawingOptions.NoLegend;
options.Timescale = Timescale.ThirdsOfMonths;
project.Save(OutDir + "RenderXAMLWithOptions_out.xaml", options);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Shows how to save a project in XAML format by using save options.
var project = new Project(DataDir + "Project2.mpp");
SaveOptions options = new XamlOptions();
options.FitContent = true;
options.LegendOnEachPage = false;
options.LegendDrawingOptions = LegendDrawingOptions.NoLegend;
options.Timescale = Timescale.ThirdsOfMonths;
project.Save(OutDir + "RenderXAMLWithOptions_out.xaml", options);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@ public static string GetDefaultFieldTitle(Field field)

A default title of the specific field if the field can be displayed in MS Project's view, null otherwise.

### Examples

Shows how to use &lt;see cref="Aspose.Tasks.Saving.CsvOptions" /&gt; to take the columns of the default Gantt Chart and

```csharp
// save them to a CSV file.
var project = new Project(DataDir + "EstimatedMilestoneTasks.mpp");

CsvOptions options = new CsvOptions();
options.TextDelimiter = CsvTextDelimiter.Tab;

var view = project.DefaultView;
options.View = ProjectView.GetDefaultGanttChartView();
options.View.Columns.Clear();

foreach (var t in view.Table.TableFields)
{
var columnTitle = string.IsNullOrEmpty(t.Title) ? FieldHelper.GetDefaultFieldTitle(t.Field) : t.Title;
options.View.Columns.Add(new GanttChartColumn(columnTitle, 10, t.Field));
}

project.Save(OutDir + "CustomizeViewForCsvOptions_out.csv", options);
```

### See Also

* enum [Field](../../../aspose.tasks/field)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,36 @@ SimpleSaveOptions options = new MPPSaveOptions
project.Save(OutDir + "TestCanWritePageSettings.mpp", options);
```

Shows how to specify the page size and orientation using View settings or using SaveOptions.

```csharp
var project = new Project(DataDir + "EstimatedMilestoneTasks.mpp");

var view = project.Views.First(v => v.Screen == ViewScreen.Gantt);

PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.Timescale = Timescale.DefinedInView;
saveOptions.StartDate = new DateTime(2012, 12, 22);
saveOptions.EndDate = new DateTime(2013, 05, 10);
saveOptions.ViewSettings = view;

saveOptions.PageSize = PageSize.DefinedInView;

// In this case the page size and orientation applied from view.PageInfo.PageSettings.PaperSize and view.PageInfo.PageSettings.IsPortrait properties.
project.Save(OutDir + "WorkWithIsPortrait_out1.pdf", saveOptions);

saveOptions.PageSize = PageSize.A4;
saveOptions.IsPortrait = true;

// In this case the page size and orientation applied from properties of SaveOptions.
project.Save(OutDir + "WorkWithIsPortrait_out2.pdf", saveOptions);

saveOptions.CustomPageSize = new SizeF(400, 600);

// In this case the page size applied from SaveOptions.CustomPageSize. IsPortrait property is not taken into account.
project.Save(OutDir + "WorkWithIsPortrait_out3.pdf", saveOptions);
```

### See Also

* class [PageSettings](../../pagesettings)
Expand Down
9 changes: 8 additions & 1 deletion english/net/aspose.tasks/asn/ratescale/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static readonly Key<RateScaleType, AsnKey> RateScale;

### Examples

Shows how to work with assignment's rate scale.
Shows how to work with assignment's rate scale when we want to set variable material consumption (e.g. '10/day' or '1/week') for an assignment of a material resource.

```csharp
var project = new Project(DataDir + "New project 2013.mpp");
Expand All @@ -30,8 +30,15 @@ var nonMaterialResource = project.Resources.Add("nonMaterialResource");
nonMaterialResource.Set(Rsc.Type, ResourceType.Work);

var materialResourceAssignment = project.ResourceAssignments.Add(task, materialResource);

// Suppose we want to set '1/week' material consumption.
// We should set hourly rate to Units property, so we divide 1D by hours per week.
materialResourceAssignment.Set(Asn.Units, 1D / 40);
materialResourceAssignment.Set(Asn.RateScale, RateScaleType.Week);

// Please note that starting with 24.4. this can be done by calling 1 method:
// materialResourceAssignment.SetMaterialResourceUnits(1D, RateScaleType.Week);
var nonMaterialResourceAssignment = project.ResourceAssignments.Add(task, nonMaterialResource);
nonMaterialResourceAssignment.Set(Asn.RateScale, RateScaleType.Week);

Expand Down
25 changes: 24 additions & 1 deletion english/net/aspose.tasks/ratescaletype/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,23 @@ public enum RateScaleType

### Examples

Shows how to work with assignment's rate scale.
Shows how to set variable material consumption (e.g. '10/day' or '1/week') for an assignment of a material resource.

```csharp
var project = new Project(DataDir + "New project 2013.mpp");

var task = project.RootTask.Children.Add("t1");

var materialResource = project.Resources.Add("materialResource");
materialResource.Set(Rsc.Type, ResourceType.Material);

var materialResourceAssignment = project.ResourceAssignments.Add(task, materialResource);

// Suppose we want to set '1/week' material consumption.
materialResourceAssignment.SetMaterialResourceUnits(1D, RateScaleType.Week);
```

Shows how to work with assignment's rate scale when we want to set variable material consumption (e.g. '10/day' or '1/week') for an assignment of a material resource.

```csharp
var project = new Project(DataDir + "New project 2013.mpp");
Expand All @@ -43,8 +59,15 @@ var nonMaterialResource = project.Resources.Add("nonMaterialResource");
nonMaterialResource.Set(Rsc.Type, ResourceType.Work);

var materialResourceAssignment = project.ResourceAssignments.Add(task, materialResource);

// Suppose we want to set '1/week' material consumption.
// We should set hourly rate to Units property, so we divide 1D by hours per week.
materialResourceAssignment.Set(Asn.Units, 1D / 40);
materialResourceAssignment.Set(Asn.RateScale, RateScaleType.Week);

// Please note that starting with 24.4. this can be done by calling 1 method:
// materialResourceAssignment.SetMaterialResourceUnits(1D, RateScaleType.Week);
var nonMaterialResourceAssignment = project.ResourceAssignments.Add(task, nonMaterialResource);
nonMaterialResourceAssignment.Set(Asn.RateScale, RateScaleType.Week);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ public void SetMaterialResourceUnits(double units, RateScaleType rateScaleType)

For example, to set '123/month', SetUnitsScaled(123D, RateScaleType.Month) should be called.

### Examples

Shows how to set variable material consumption (e.g. '10/day' or '1/week') for an assignment of a material resource.

```csharp
var project = new Project(DataDir + "New project 2013.mpp");

var task = project.RootTask.Children.Add("t1");

var materialResource = project.Resources.Add("materialResource");
materialResource.Set(Rsc.Type, ResourceType.Material);

var materialResourceAssignment = project.ResourceAssignments.Add(task, materialResource);

// Suppose we want to set '1/week' material consumption.
materialResourceAssignment.SetMaterialResourceUnits(1D, RateScaleType.Week);
```

### See Also

* enum [RateScaleType](../../ratescaletype)
Expand Down
2 changes: 1 addition & 1 deletion english/net/aspose.tasks/weekday/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var calendar = project.Calendars.Add("Calendar1");

// Add working days monday through thursday with default timings
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Monday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Tuesday));
calendar.WeekDays.Add(new WeekDay(DayType.Tuesday, new WorkingTime(9, 11), new WorkingTime(12, 18)));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Wednesday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Thursday));

Expand Down
2 changes: 1 addition & 1 deletion english/net/aspose.tasks/weekday/casttodaytype/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var calendar = project.Calendars.Add("Calendar1");

// Add working days monday through thursday with default timings
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Monday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Tuesday));
calendar.WeekDays.Add(new WeekDay(DayType.Tuesday, new WorkingTime(9, 11), new WorkingTime(12, 18)));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Wednesday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Thursday));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var calendar = project.Calendars.Add("Calendar1");

// Add working days monday through thursday with default timings
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Monday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Tuesday));
calendar.WeekDays.Add(new WeekDay(DayType.Tuesday, new WorkingTime(9, 11), new WorkingTime(12, 18)));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Wednesday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Thursday));

Expand Down
2 changes: 1 addition & 1 deletion english/net/aspose.tasks/weekday/daytype/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var calendar = project.Calendars.Add("Calendar1");

// Add working days monday through thursday with default timings
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Monday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Tuesday));
calendar.WeekDays.Add(new WeekDay(DayType.Tuesday, new WorkingTime(9, 11), new WorkingTime(12, 18)));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Wednesday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Thursday));

Expand Down
2 changes: 1 addition & 1 deletion english/net/aspose.tasks/weekday/dayworking/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var calendar = project.Calendars.Add("Calendar1");

// Add working days monday through thursday with default timings
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Monday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Tuesday));
calendar.WeekDays.Add(new WeekDay(DayType.Tuesday, new WorkingTime(9, 11), new WorkingTime(12, 18)));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Wednesday));
calendar.WeekDays.Add(WeekDay.CreateDefaultWorkingDay(DayType.Thursday));

Expand Down
Loading

0 comments on commit 0b65435

Please sign in to comment.