From 0b65435b6782abe598c7f044c50cd16ad87a6277 Mon Sep 17 00:00:00 2001 From: Vasiliy Sinitsyn Date: Wed, 22 May 2024 14:06:33 +0700 Subject: [PATCH] Updated API Reference for Aspose.Tasks for .NET to 24.5. --- .../csvoptions/view/_index.md | 24 ++++++++++ .../saveoptions/enddate/_index.md | 2 +- .../saveoptions/gridlines/_index.md | 2 +- .../saveoptions/isportrait/_index.md | 32 +++++++++++++ .../legenddrawingoptions/_index.md | 47 +++++++++++++++++++ .../saveoptions/markcriticaltasks/_index.md | 2 +- .../saveoptions/rendertosinglepage/_index.md | 2 +- .../saveoptions/startdate/_index.md | 2 +- .../aspose.tasks.saving/xamloptions/_index.md | 2 +- .../xamloptions/xamloptions/_index.md | 2 +- .../getdefaultfieldtitle/_index.md | 24 ++++++++++ .../pagesettings/isportrait/_index.md | 30 ++++++++++++ .../net/aspose.tasks/asn/ratescale/_index.md | 9 +++- .../net/aspose.tasks/ratescaletype/_index.md | 25 +++++++++- .../setmaterialresourceunits/_index.md | 18 +++++++ english/net/aspose.tasks/weekday/_index.md | 2 +- .../weekday/casttodaytype/_index.md | 2 +- .../weekday/createdefaultworkingday/_index.md | 2 +- .../aspose.tasks/weekday/daytype/_index.md | 2 +- .../aspose.tasks/weekday/dayworking/_index.md | 2 +- .../net/aspose.tasks/weekday/equals/_index.md | 30 ------------ .../aspose.tasks/weekday/fromdate/_index.md | 2 +- .../weekday/gethashcode/_index.md | 32 ------------- .../weekday/getworkingtime/_index.md | 2 +- .../net/aspose.tasks/weekday/todate/_index.md | 2 +- .../aspose.tasks/weekday/weekday/_index.md | 6 +-- .../weekday/workingtimes/_index.md | 2 +- 27 files changed, 226 insertions(+), 83 deletions(-) diff --git a/english/net/aspose.tasks.saving/csvoptions/view/_index.md b/english/net/aspose.tasks.saving/csvoptions/view/_index.md index 064c28da55..d9345bd5e3 100644 --- a/english/net/aspose.tasks.saving/csvoptions/view/_index.md +++ b/english/net/aspose.tasks.saving/csvoptions/view/_index.md @@ -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) diff --git a/english/net/aspose.tasks.saving/saveoptions/enddate/_index.md b/english/net/aspose.tasks.saving/saveoptions/enddate/_index.md index 31951b5d8f..c6fc42e680 100644 --- a/english/net/aspose.tasks.saving/saveoptions/enddate/_index.md +++ b/english/net/aspose.tasks.saving/saveoptions/enddate/_index.md @@ -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; diff --git a/english/net/aspose.tasks.saving/saveoptions/gridlines/_index.md b/english/net/aspose.tasks.saving/saveoptions/gridlines/_index.md index fafd27ee78..0b93b17a12 100644 --- a/english/net/aspose.tasks.saving/saveoptions/gridlines/_index.md +++ b/english/net/aspose.tasks.saving/saveoptions/gridlines/_index.md @@ -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; diff --git a/english/net/aspose.tasks.saving/saveoptions/isportrait/_index.md b/english/net/aspose.tasks.saving/saveoptions/isportrait/_index.md index 8a00e66129..f3c4c817e3 100644 --- a/english/net/aspose.tasks.saving/saveoptions/isportrait/_index.md +++ b/english/net/aspose.tasks.saving/saveoptions/isportrait/_index.md @@ -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) diff --git a/english/net/aspose.tasks.saving/saveoptions/legenddrawingoptions/_index.md b/english/net/aspose.tasks.saving/saveoptions/legenddrawingoptions/_index.md index 13b3873d48..baa9d61bfa 100644 --- a/english/net/aspose.tasks.saving/saveoptions/legenddrawingoptions/_index.md +++ b/english/net/aspose.tasks.saving/saveoptions/legenddrawingoptions/_index.md @@ -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) diff --git a/english/net/aspose.tasks.saving/saveoptions/markcriticaltasks/_index.md b/english/net/aspose.tasks.saving/saveoptions/markcriticaltasks/_index.md index 3b8a5acf05..5a0a0e561d 100644 --- a/english/net/aspose.tasks.saving/saveoptions/markcriticaltasks/_index.md +++ b/english/net/aspose.tasks.saving/saveoptions/markcriticaltasks/_index.md @@ -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() }; diff --git a/english/net/aspose.tasks.saving/saveoptions/rendertosinglepage/_index.md b/english/net/aspose.tasks.saving/saveoptions/rendertosinglepage/_index.md index ef4d8d0849..f92305e75e 100644 --- a/english/net/aspose.tasks.saving/saveoptions/rendertosinglepage/_index.md +++ b/english/net/aspose.tasks.saving/saveoptions/rendertosinglepage/_index.md @@ -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; diff --git a/english/net/aspose.tasks.saving/saveoptions/startdate/_index.md b/english/net/aspose.tasks.saving/saveoptions/startdate/_index.md index 064eba4f86..8f5b99cdb0 100644 --- a/english/net/aspose.tasks.saving/saveoptions/startdate/_index.md +++ b/english/net/aspose.tasks.saving/saveoptions/startdate/_index.md @@ -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; diff --git a/english/net/aspose.tasks.saving/xamloptions/_index.md b/english/net/aspose.tasks.saving/xamloptions/_index.md index d0f6b3af90..ffa0b9752a 100644 --- a/english/net/aspose.tasks.saving/xamloptions/_index.md +++ b/english/net/aspose.tasks.saving/xamloptions/_index.md @@ -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); ``` diff --git a/english/net/aspose.tasks.saving/xamloptions/xamloptions/_index.md b/english/net/aspose.tasks.saving/xamloptions/xamloptions/_index.md index 52701503f8..5ffd33578c 100644 --- a/english/net/aspose.tasks.saving/xamloptions/xamloptions/_index.md +++ b/english/net/aspose.tasks.saving/xamloptions/xamloptions/_index.md @@ -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); ``` diff --git a/english/net/aspose.tasks.util/fieldhelper/getdefaultfieldtitle/_index.md b/english/net/aspose.tasks.util/fieldhelper/getdefaultfieldtitle/_index.md index cd621cd698..b4c1eca6bb 100644 --- a/english/net/aspose.tasks.util/fieldhelper/getdefaultfieldtitle/_index.md +++ b/english/net/aspose.tasks.util/fieldhelper/getdefaultfieldtitle/_index.md @@ -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 <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 * enum [Field](../../../aspose.tasks/field) diff --git a/english/net/aspose.tasks.visualization/pagesettings/isportrait/_index.md b/english/net/aspose.tasks.visualization/pagesettings/isportrait/_index.md index 1f395b948e..5fb2ed08b7 100644 --- a/english/net/aspose.tasks.visualization/pagesettings/isportrait/_index.md +++ b/english/net/aspose.tasks.visualization/pagesettings/isportrait/_index.md @@ -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) diff --git a/english/net/aspose.tasks/asn/ratescale/_index.md b/english/net/aspose.tasks/asn/ratescale/_index.md index 7f91ba45a9..66d7ad35f1 100644 --- a/english/net/aspose.tasks/asn/ratescale/_index.md +++ b/english/net/aspose.tasks/asn/ratescale/_index.md @@ -16,7 +16,7 @@ public static readonly Key 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"); @@ -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); diff --git a/english/net/aspose.tasks/ratescaletype/_index.md b/english/net/aspose.tasks/ratescaletype/_index.md index d91026dc67..d08dd992d3 100644 --- a/english/net/aspose.tasks/ratescaletype/_index.md +++ b/english/net/aspose.tasks/ratescaletype/_index.md @@ -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"); @@ -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); diff --git a/english/net/aspose.tasks/resourceassignment/setmaterialresourceunits/_index.md b/english/net/aspose.tasks/resourceassignment/setmaterialresourceunits/_index.md index f10e1a30fe..1a8ce1cb9a 100644 --- a/english/net/aspose.tasks/resourceassignment/setmaterialresourceunits/_index.md +++ b/english/net/aspose.tasks/resourceassignment/setmaterialresourceunits/_index.md @@ -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) diff --git a/english/net/aspose.tasks/weekday/_index.md b/english/net/aspose.tasks/weekday/_index.md index 881e26fe77..1f53b73a66 100644 --- a/english/net/aspose.tasks/weekday/_index.md +++ b/english/net/aspose.tasks/weekday/_index.md @@ -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)); diff --git a/english/net/aspose.tasks/weekday/casttodaytype/_index.md b/english/net/aspose.tasks/weekday/casttodaytype/_index.md index c819beec82..f0582e951b 100644 --- a/english/net/aspose.tasks/weekday/casttodaytype/_index.md +++ b/english/net/aspose.tasks/weekday/casttodaytype/_index.md @@ -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)); diff --git a/english/net/aspose.tasks/weekday/createdefaultworkingday/_index.md b/english/net/aspose.tasks/weekday/createdefaultworkingday/_index.md index 1d464e57d7..74f93b12f4 100644 --- a/english/net/aspose.tasks/weekday/createdefaultworkingday/_index.md +++ b/english/net/aspose.tasks/weekday/createdefaultworkingday/_index.md @@ -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)); diff --git a/english/net/aspose.tasks/weekday/daytype/_index.md b/english/net/aspose.tasks/weekday/daytype/_index.md index 068e68cc81..98c77f0e9b 100644 --- a/english/net/aspose.tasks/weekday/daytype/_index.md +++ b/english/net/aspose.tasks/weekday/daytype/_index.md @@ -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)); diff --git a/english/net/aspose.tasks/weekday/dayworking/_index.md b/english/net/aspose.tasks/weekday/dayworking/_index.md index b549ca0e5d..630996e5e8 100644 --- a/english/net/aspose.tasks/weekday/dayworking/_index.md +++ b/english/net/aspose.tasks/weekday/dayworking/_index.md @@ -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)); diff --git a/english/net/aspose.tasks/weekday/equals/_index.md b/english/net/aspose.tasks/weekday/equals/_index.md index 6f266b67d5..b116251773 100644 --- a/english/net/aspose.tasks/weekday/equals/_index.md +++ b/english/net/aspose.tasks/weekday/equals/_index.md @@ -22,36 +22,6 @@ public override bool Equals(object obj) **True** if the specified object is a WeekDay that has the same FromDate, ToDate values and WorkingTimes as this instance; otherwise, **false**. -### Examples - -Shows how to check week day equality. - -```csharp -var project = new Project(DataDir + "Project2.mpp"); - -var calendar = project.Calendars.GetByUid(1); -var weekDay1 = calendar.WeekDays[0]; -var weekDay2 = calendar.WeekDays[1]; - -// the equality of calendars is checked against to weekday's properties: -// weekday.DayType -// weekday.DayWorking -// weekday.FromDate -// weekday.ToDate -// weekday.WorkingTimes -Console.WriteLine("WeekDay 1 Day Type: " + weekDay1.DayType); -Console.WriteLine("WeekDay 1 Day Working: " + weekDay1.DayWorking); -Console.WriteLine("WeekDay 1 From Date: " + weekDay1.FromDate); -Console.WriteLine("WeekDay 1 From Date: " + weekDay1.ToDate); -Console.WriteLine("WeekDay 1 WorkingTimes: " + weekDay1.WorkingTimes); -Console.WriteLine("WeekDay 2 Day Type: " + weekDay2.DayType); -Console.WriteLine("WeekDay 2 Day Working: " + weekDay2.DayWorking); -Console.WriteLine("WeekDay 2 From Date: " + weekDay2.FromDate); -Console.WriteLine("WeekDay 2 From Date: " + weekDay2.ToDate); -Console.WriteLine("WeekDay 2 WorkingTimes: " + weekDay2.WorkingTimes); -Console.WriteLine("Are weekdays equal: " + weekDay1.Equals(weekDay2)); -``` - ### See Also * class [WeekDay](../../weekday) diff --git a/english/net/aspose.tasks/weekday/fromdate/_index.md b/english/net/aspose.tasks/weekday/fromdate/_index.md index ef8e8b39b6..a1dee58c0d 100644 --- a/english/net/aspose.tasks/weekday/fromdate/_index.md +++ b/english/net/aspose.tasks/weekday/fromdate/_index.md @@ -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)); diff --git a/english/net/aspose.tasks/weekday/gethashcode/_index.md b/english/net/aspose.tasks/weekday/gethashcode/_index.md index 116b1bb04a..6b6cefe3d8 100644 --- a/english/net/aspose.tasks/weekday/gethashcode/_index.md +++ b/english/net/aspose.tasks/weekday/gethashcode/_index.md @@ -18,38 +18,6 @@ public override int GetHashCode() returns a hash code value for this object. -### Examples - -Shows how to get a hash code of a week day. - -```csharp -var project = new Project(DataDir + "Project2.mpp"); - -var calendar = project.Calendars.GetByUid(1); -var weekDay1 = calendar.WeekDays[1]; -var weekDay2 = calendar.WeekDays[2]; - -// the hash code of a calendar is based on: -// weekday.DayType -// weekday.FromDate -// weekday.ToDate -// weekday.WorkingTimes -Console.WriteLine("WeekDay 1 Day Type: " + weekDay1.DayType); -Console.WriteLine("WeekDay 1 Day Working: " + weekDay1.DayWorking); -Console.WriteLine("WeekDay 1 From Date: " + weekDay1.FromDate); -Console.WriteLine("WeekDay 1 From Date: " + weekDay1.ToDate); -Console.WriteLine("WeekDay 1 WorkingTimes: " + weekDay1.WorkingTimes); -Console.WriteLine(); -Console.WriteLine("WeekDay 2 Day Type: " + weekDay2.DayType); -Console.WriteLine("WeekDay 2 Day Working: " + weekDay2.DayWorking); -Console.WriteLine("WeekDay 2 From Date: " + weekDay2.FromDate); -Console.WriteLine("WeekDay 2 From Date: " + weekDay2.ToDate); -Console.WriteLine("WeekDay 2 WorkingTimes: " + weekDay2.WorkingTimes); -Console.WriteLine(); -Console.WriteLine("Week Day 1 Hash Code: {0}", weekDay1.GetHashCode()); -Console.WriteLine("Week Day 2 Hash Code: {0}", weekDay2.GetHashCode()); -``` - ### See Also * class [WeekDay](../../weekday) diff --git a/english/net/aspose.tasks/weekday/getworkingtime/_index.md b/english/net/aspose.tasks/weekday/getworkingtime/_index.md index 14780b3ffa..b82c752f72 100644 --- a/english/net/aspose.tasks/weekday/getworkingtime/_index.md +++ b/english/net/aspose.tasks/weekday/getworkingtime/_index.md @@ -30,7 +30,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)); diff --git a/english/net/aspose.tasks/weekday/todate/_index.md b/english/net/aspose.tasks/weekday/todate/_index.md index b8d5bd2643..173415ea79 100644 --- a/english/net/aspose.tasks/weekday/todate/_index.md +++ b/english/net/aspose.tasks/weekday/todate/_index.md @@ -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)); diff --git a/english/net/aspose.tasks/weekday/weekday/_index.md b/english/net/aspose.tasks/weekday/weekday/_index.md index 66eb10263d..abacae0b1c 100644 --- a/english/net/aspose.tasks/weekday/weekday/_index.md +++ b/english/net/aspose.tasks/weekday/weekday/_index.md @@ -30,7 +30,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)); @@ -108,7 +108,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)); @@ -205,7 +205,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)); diff --git a/english/net/aspose.tasks/weekday/workingtimes/_index.md b/english/net/aspose.tasks/weekday/workingtimes/_index.md index 2c3aaf9bce..e59b1f0dff 100644 --- a/english/net/aspose.tasks/weekday/workingtimes/_index.md +++ b/english/net/aspose.tasks/weekday/workingtimes/_index.md @@ -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));