Skip to content

Commit

Permalink
Added missing examples
Browse files Browse the repository at this point in the history
Added missing examples for Working with Resources, Working with Resource
Assignments, Working with Formulas, Working with Currencies and
Miscellaneous sections of Aspose.Tasks docs.
  • Loading branch information
maria-shahid-aspose committed Nov 17, 2016
1 parent 04cdf6f commit 8719379
Show file tree
Hide file tree
Showing 643 changed files with 4,923 additions and 22,987 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -7,6 +7,7 @@ generated/
bin/
* Out*
*_out_*
*_out*
* out*
*.ldb
Thumbs.db
Expand Down
120 changes: 73 additions & 47 deletions Examples/CSharp/CSharp.csproj
Expand Up @@ -52,20 +52,52 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CreatingAndSaving\SaveProjectAsSVG.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\SaveProjectAsSVG.cs" />
<Compile Include="Miscellaneous\HandleExceptions.cs" />
<Compile Include="Miscellaneous\PerformRiskAnalysis.cs" />
<Compile Include="Miscellaneous\SaveBestPracticeAnalyzerReport.cs" />
<Compile Include="Miscellaneous\SaveBurnDownReport.cs" />
<Compile Include="Miscellaneous\SaveCashFlowReport.cs" />
<Compile Include="Miscellaneous\SaveCostOverrunsReport.cs" />
<Compile Include="Miscellaneous\SaveCostOverviewReport.cs" />
<Compile Include="Miscellaneous\SaveCriticalTasksReport.cs" />
<Compile Include="Miscellaneous\SaveLateTasksReport.cs" />
<Compile Include="Miscellaneous\SaveMilestonesReport.cs" />
<Compile Include="Miscellaneous\SaveOverallocatedResourcesReport.cs" />
<Compile Include="Miscellaneous\SaveProjectOverviewReport.cs" />
<Compile Include="Miscellaneous\SaveResourceCostOverviewReport.cs" />
<Compile Include="Miscellaneous\SaveResourceOverviewReport.cs" />
<Compile Include="Miscellaneous\SaveSlippingTasksReport.cs" />
<Compile Include="Miscellaneous\SaveTaskCostOverviewReport.cs" />
<Compile Include="Miscellaneous\SaveUpcomingTasksReport.cs" />
<Compile Include="Miscellaneous\SaveWorkOverviewReport.cs" />
<Compile Include="Miscellaneous\SortResourcesByName.cs" />
<Compile Include="Miscellaneous\SortTasksByName.cs" />
<Compile Include="Miscellaneous\UpdateOutlineCodes.cs" />
<Compile Include="Miscellaneous\WriteMetadataToMPP.cs" />
<Compile Include="WorkingWithCalendarExceptions\AddRemoveCalendarExceptions.cs" />
<Compile Include="WorkingWithCalendarExceptions\DefineWeekdayExceptions.cs" />
<Compile Include="WorkingWithCalendarExceptions\HandleExceptionOccurences.cs" />
<Compile Include="WorkingWithCalendarExceptions\RetrieveCalendarExceptions.cs" />
<Compile Include="WorkingWithCalendars\CalculateWorkHours.cs" />
<Compile Include="WorkingWithCurrencies\GetCurrencyCodes.cs" />
<Compile Include="WorkingWithCurrencies\GetCurrencyDigits.cs" />
<Compile Include="WorkingWithCurrencies\GetCurrencySymbol.cs" />
<Compile Include="WorkingWithCurrencies\SetCurrencyCodes.cs" />
<Compile Include="WorkingWithCurrencies\SetCurrencyDigits.cs" />
<Compile Include="WorkingWithCurrencies\SetCurrencySymbol.cs" />
<Compile Include="WorkingWithFormulas\CalculateDateTimeFunctions.cs" />
<Compile Include="WorkingWithFormulas\CalculateGeneralFunctions.cs" />
<Compile Include="WorkingWithFormulas\CalculateMathExpressions.cs" />
<Compile Include="WorkingWithFormulas\CalculateTextFunctions.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\CreateEmptyProjectSaveStream.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\ReadPasswordProtectedProjectFile.cs" />
<Compile Include="CreatingAndSaving\SaveProjectAsText.cs" />
<Compile Include="CreatingAndSaving\UseSvgOptions.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\SaveProjectAsText.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\UseSvgOptions.cs" />
<Compile Include="WorkingWithProjects\ImportingAndExporting\ImportProjectFromPrimaveraDB.cs" />
<Compile Include="WorkingWithProjects\ReadHeaderFooterInfo.cs" />
<Compile Include="WorkingWithProjects\Rescheduling\RescheduleProjectFromFinishDate.cs" />
<Compile Include="ModifyingCreatedProject\UsingArithmeticExpression.cs" />
<Compile Include="WorkingWithFormulas\UsingArithmeticExpression.cs" />
<Compile Include="WorkingWithProjects\ImportingAndExporting\ExportProjectDataToPrimaveraMPXFormat.cs" />
<Compile Include="WorkingWithCalendars\CreatingUpdatingAndRemoving\CreatingCalendar.cs" />
<Compile Include="WorkingWithCalendars\CreatingUpdatingAndRemoving\DefineWeekdaysForCalendar.cs" />
Expand All @@ -80,16 +112,16 @@
<Compile Include="WorkingWithProjects\Miscellaneous\CalculateCriticalPath.cs" />
<Compile Include="WorkingWithProjects\AddImageToPageHeaderFooter.cs" />
<Compile Include="WorkingWithProjects\Miscellaneous\EmbeddedObjectsCreatedInsideApplication.cs" />
<Compile Include="ModifyingCreatedProject\FormulaWithProjectFields.cs" />
<Compile Include="ModifyingCreatedProject\ReadFormulasInLocalAndEnterpriseExtendedAttributesFromMPPFile.cs" />
<Compile Include="ModifyingCreatedProject\ReadOnlyAccessToCustomFieldValuesUsingFormulas.cs" />
<Compile Include="ModifyingCreatedProject\FormulaWithBooleanValues.cs" />
<Compile Include="ModifyingCreatedProject\WriteFormulasInExtendedAttributesToMPPFileFormats.cs" />
<Compile Include="WorkingWithFormulas\FormulaWithProjectFields.cs" />
<Compile Include="WorkingWithFormulas\ReadFormulasExtendedAttributesFromMPP.cs" />
<Compile Include="WorkingWithFormulas\AccessReadOnlyCustomFieldValuesUsingFormulas.cs" />
<Compile Include="WorkingWithFormulas\FormulaWithBooleanValues.cs" />
<Compile Include="WorkingWithFormulas\WriteFormulasInExtendedAttributesToMPP.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\CreateEmptyProjectSaveXML.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectProperties\ReadDefaultProperties.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectProperties\DetermineProjectVersion.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectViews\ConfigureTheGantChartViewShowSelectedColumnFields.cs" />
<Compile Include="ModifyingCreatedProject\RenderProjectDataToFormat24bppRgb.cs" />
<Compile Include="WorkingWithProjects\RenderProjectDataToFormat24bppRgb.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectViews\ReadSpecificGantChartViewData.cs" />
<Compile Include="WorkingWithProjects\Miscellaneous\ReadTableDataFromProjectFile.cs" />
<Compile Include="WorkingWithProjects\Miscellaneous\ReadGroupDefinitionData.cs" />
Expand All @@ -101,11 +133,29 @@
<Compile Include="WorkingWithProjects\GetNumberOfPagesForViews.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\IgnoreInvalidCharactersDuringloadingProject.cs" />
<Compile Include="WorkingWithProjects\ImportingAndExporting\ImportDataFromMPXFileFormats.cs" />
<Compile Include="WorkingWithResourceAssignments\CreateResourceAssignments.cs" />
<Compile Include="WorkingWithResourceAssignments\GenerateResourceAssignmentTimephasedData.cs" />
<Compile Include="WorkingWithResourceAssignments\GetGeneralResourceAssignmentProperties.cs" />
<Compile Include="WorkingWithResourceAssignments\GetResourceAssignmentBudget.cs" />
<Compile Include="WorkingWithResourceAssignments\GetResourceAssignmentCosts.cs" />
<Compile Include="WorkingWithResourceAssignments\GetResourceAssignmentOvertimes.cs" />
<Compile Include="WorkingWithResourceAssignments\GetResourceAssignmentPercentWorkComplete.cs" />
<Compile Include="WorkingWithResourceAssignments\GetResourceAssignmentStopResumeDates.cs" />
<Compile Include="WorkingWithResourceAssignments\GetResourceAssignmentVariance.cs" />
<Compile Include="WorkingWithResourceAssignments\SetGeneralResourceAssignmentProperties.cs" />
<Compile Include="WorkingWithResourceAssignments\UpdateResourceAssignmentInMPP.cs" />
<Compile Include="WorkingWithResources\CreateResources.cs" />
<Compile Include="WorkingWithResources\GetResourceCalendar.cs" />
<Compile Include="WorkingWithResources\GetResourceCosts.cs" />
<Compile Include="WorkingWithResources\GetResourceOvertime.cs" />
<Compile Include="WorkingWithResources\GetResourcePercentWorkComplete.cs" />
<Compile Include="WorkingWithResources\ReadResourceTimephasedData.cs" />
<Compile Include="WorkingWithResources\RenderResourceSheetView.cs" />
<Compile Include="WorkingWithResources\RenderResourceUsageView.cs" />
<Compile Include="WorkingWithResources\SetGeneralResourceProperties.cs" />
<Compile Include="WorkingWithResources\SetResourceCalendar.cs" />
<Compile Include="WorkingWithResources\SetResourceExtendedAttributes.cs" />
<Compile Include="WorkingWithResources\UpdateResourceDataInMPP.cs" />
<Compile Include="WorkingWithTaskBaselines\CreateTaskBaseline.cs" />
<Compile Include="WorkingWithTaskBaselines\GetTaskBaselineDuration.cs" />
<Compile Include="WorkingWithTaskBaselines\GetTaskBaselineSchedule.cs" />
Expand All @@ -118,7 +168,7 @@
<Compile Include="WorkingWithTasks\MoveTaskAtTheEnd.cs" />
<Compile Include="WorkingWithTasks\MoveTaskUnderAnotherParent.cs" />
<Compile Include="WorkingWithTasks\MoveTaskUnderSameParent.cs" />
<Compile Include="ManipulatingMPPFile\MPPFileUpdate.cs" />
<Compile Include="WorkingWithProjects\MPPFileUpdate.cs" />
<Compile Include="WorkingWithProjects\ImportingAndExporting\ImportDataFromXMLFileFormats.cs" />
<Compile Include="WorkingWithProjects\ImportingAndExporting\ExportProjectDataToXMLFormat.cs" />
<Compile Include="WorkingWithProjects\Printing\PrintProjectPagesToSeparateFiles.cs" />
Expand All @@ -129,13 +179,13 @@
<Compile Include="WorkingWithProjects\ImportingAndExporting\ReadProjectUIDsFromXMLFile.cs" />
<Compile Include="WorkingWithProjects\Rescheduling\UpdateProjectAndRescheduleUncompletedWork.cs" />
<Compile Include="WorkingWithProjects\SaveProjectDataAsTemplate.cs" />
<Compile Include="CreatingAndSaving\SaveProjectDataAsHTML.cs" />
<Compile Include="CreatingAndSaving\SaveProjectAsCSV.cs" />
<Compile Include="CreatingAndSaving\SaveProjectDataToSpreadsheet2003XML.cs" />
<Compile Include="CreatingAndSaving\SaveProjectAsXLSX.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\SaveProjectDataAsHTML.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\SaveProjectAsCSV.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\SaveProjectDataToSpreadsheet2003XML.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\SaveProjectAsXLSX.cs" />
<Compile Include="WorkingWithProjects\Rescheduling\RescheduleProjectFromStartDate.cs" />
<Compile Include="WorkingWithProjects\Rescheduling\RescheduleProjectStartOrFinishDate.cs" />
<Compile Include="CreatingAndSaving\UsingXlsxOptions.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\UsingXlsxOptions.cs" />
<Compile Include="WorkingWithProjects\Printing\PrintPrintOptionsAndPrinterSettings.cs" />
<Compile Include="WorkingWithProjects\Miscellaneous\PrintTaskWritingException.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectProperties\ReadCurrencyProperties.cs" />
Expand All @@ -146,14 +196,14 @@
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\ImportProjectDataFromMPDFile.cs" />
<Compile Include="WorkingWithProjects\Printing\PrintTheProject.cs" />
<Compile Include="WorkingWithProjects\Printing\PrintLargeFiles.cs" />
<Compile Include="CreatingAndSaving\SaveProjectAsPDF.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\SaveProjectAsPDF.cs" />
<Compile Include="WorkingWithCalendars\CreatingUpdatingAndRemoving\ReplaceCalendarWithNewCalendar.cs" />
<Compile Include="CreatingAndSaving\FitContentsToCellSize.cs" />
<Compile Include="CreatingAndSaving\CustomizeTextStyle.cs" />
<Compile Include="CreatingAndSaving\CustomizeDateFormats.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\FitContentsToCellSize.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\CustomizeTextStyle.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\CustomizeDateFormats.cs" />
<Compile Include="WorkingWithProjects\ReadOutlineCodes.cs" />
<Compile Include="WorkingWithProjects\Printing\PrintProjectUsingCustomPrinter.cs" />
<Compile Include="CreatingAndSaving\SaveToMultiplePDFFiles.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\SaveToMultiplePDFFiles.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectProperties\WriteDefaultProperties.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\ReadProjectFiles.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectProperties\ReadProjectInfo.cs" />
Expand All @@ -168,11 +218,11 @@
<Compile Include="WorkingWithProjects\WorkingWithProjectProperties\WriteFiscalYearProperties.cs" />
<Compile Include="WorkingWithProjects\Miscellaneous\ExtractEmbeddedObjects.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectProperties\WriteMPPProjectSummary.cs" />
<Compile Include="ModifyingCreatedProject\UsingTaskNumberFields.cs" />
<Compile Include="WorkingWithFormulas\UsingTaskNumberFields.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectProperties\WriteProjectInfo.cs" />
<Compile Include="WorkingWithProjects\WorkingWithExtendedAttributes\WriteUpdatedExtendedAttributeDefinitions.cs" />
<Compile Include="WorkingWithProjects\CreatingReadingAndSaving\ReadProjectFileFromStream.cs" />
<Compile Include="ModifyingCreatedProject\UsingTasksAndResourceFieldsInFormulaCalculations.cs" />
<Compile Include="WorkingWithFormulas\UsingTasksAndResourceFieldsInFormulaCalculations.cs" />
<Compile Include="WorkingWithProjects\WorkingWithProjectProperties\WriteWeekdayProperties.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RunExamples.cs" />
Expand Down Expand Up @@ -215,30 +265,6 @@
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="WorkingWithProjects\Data\CalculateCriticalPath.mpp" />
<None Include="WorkingWithProjects\Data\DefaultProperties.mpp" />
<None Include="WorkingWithProjects\Data\DetermineProjectVersion.mpp" />
<None Include="WorkingWithProjects\Data\ExtendedAttribute.mpp" />
<None Include="WorkingWithProjects\Data\ExtendedAttributes.mpp" />
<None Include="WorkingWithProjects\Data\GetNumberOfPages.mpp" />
<None Include="WorkingWithProjects\Data\GetNumberOfPagesForViews.mpp" />
<None Include="WorkingWithProjects\Data\MPPFileUpdate.mpp" />
<None Include="WorkingWithProjects\Data\PrintTaskWritingException.mpp" />
<None Include="WorkingWithProjects\Data\Project1.mpp" />
<None Include="WorkingWithProjects\Data\ReadCurrencyProperties.mpp" />
<None Include="WorkingWithProjects\Data\ReadFiscalYearProperties.mpp" />
<None Include="WorkingWithProjects\Data\ReadProjectFiles.mpp" />
<None Include="WorkingWithProjects\Data\ReadProjectInfo.mpp" />
<None Include="WorkingWithProjects\Data\ReadWeekdayProperties.mpp" />
<None Include="WorkingWithProjects\Data\ReplaceCalendar.mpp" />
<None Include="WorkingWithProjects\Data\RetrieveCalendarInfo.mpp" />
<None Include="WorkingWithProjects\Data\VbaProject1.mpp" />
<None Include="WorkingWithProjects\Data\WriteCurrencyProperties.mpp" />
<None Include="WorkingWithProjects\Data\WriteFiscalYearProperties.mpp" />
<None Include="WorkingWithProjects\Data\WriteMPPProjectSummary.mpp" />
<None Include="WorkingWithProjects\Data\WriteProjectInfo.mpp" />
<None Include="WorkingWithProjects\Data\WriteUpdatedExtendedAttributeDefinitions.mpp" />
<None Include="WorkingWithProjects\Data\WriteWeekdayProperties.mpp" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
38 changes: 38 additions & 0 deletions Examples/CSharp/Miscellaneous/HandleExceptions.cs
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Aspose.Tasks.Examples.CSharp.Miscellaneous
{
class HandleExceptions
{
public static void Run()
{
// ExStart:HandleExceptions
Project project;
try
{
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName);
project = new Project(dataDir + "project.mpp");
}
catch (TasksReadingException ex)
{
Console.WriteLine("Message:");
Console.WriteLine(ex.Message);
Console.WriteLine("Log:");
Console.WriteLine(ex.LogText);
if (ex.InnerException != null)
{
Console.WriteLine("Inner exception message:");
Console.WriteLine(ex.InnerException.Message);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
// ExEnd:HandleExceptions
}
}
}

0 comments on commit 8719379

Please sign in to comment.