public static void Run() { // ExStart:PrintProjectPagesToSeparateFiles // The path to the documents directory. string dataDir = RunExamples.GetDataDir_PrintingAndExporting(); Project project = new Project(dataDir + "Project5.mpp"); ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFileFormat.PNG); saveOptions.StartDate = project.Get(Prj.StartDate).AddDays(-3); saveOptions.EndDate = project.Get(Prj.FinishDate); saveOptions.MarkCriticalTasks = true; saveOptions.LegendOnEachPage = false; saveOptions.Gridlines = new List <Gridline>(); Gridline gridline = new Gridline(); gridline.GridlineType = GridlineType.GanttRow; gridline.Color = Color.CornflowerBlue; gridline.Pattern = LinePattern.Dashed; saveOptions.Gridlines.Add(gridline); // Save the whole project layout to one file project.Save(dataDir + "CustomerFeedback1_out.png", saveOptions); // Save project layout to separate files saveOptions.SaveToSeparateFiles = true; project.Save(dataDir + "CustomerFeedback2_out.png", saveOptions); // ExEnd:PrintProjectPagesToSeparateFiles }
public void PrintProjectPagesToSeparateFiles() { // ExStart:PrintProjectPagesToSeparateFiles // ExFor: SaveOptions.Gridlines // ExFor: SaveOptions.StartDate // ExFor: SaveOptions.EndDate // ExFor: ImageSaveOptions.DefaultFontName // ExFor: ImageSaveOptions.UseProjectDefaultFont // ExSummary: Shows how to save layout to separate files. var project = new Project(DataDir + "CreateProject2.mpp"); 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.DefaultFontName = "Segoe UI Black"; options.UseProjectDefaultFont = false; options.Gridlines = new List <Gridline>(); var gridline = new Gridline { GridlineType = GridlineType.GanttRow, Color = Color.CornflowerBlue, Pattern = LinePattern.Dashed }; options.Gridlines.Add(gridline); project.Save(OutDir + "PrintProjectPagesToSeparateFiles1_out.png", options); // Save project layout to separate files options.SaveToSeparateFiles = true; project.Save(OutDir + "PrintProjectPagesToSeparateFiles2_out.png", options); // ExEnd:PrintProjectPagesToSeparateFiles }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName); // ExStart:PrintProjectPagesToSeparateFiles Project project = new Project(dataDir + "CreateProject2.mpp"); ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFileFormat.PNG); saveOptions.StartDate = project.Get(Prj.StartDate).AddDays(-3); saveOptions.EndDate = project.Get(Prj.FinishDate); saveOptions.MarkCriticalTasks = true; saveOptions.LegendOnEachPage = false; saveOptions.Gridlines = new List<Gridline>(); Gridline gridline = new Gridline(); gridline.GridlineType = GridlineType.GanttRow; gridline.Color = Color.CornflowerBlue; gridline.Pattern = LinePattern.Dashed; saveOptions.Gridlines.Add(gridline); // Save the whole project layout to one file project.Save(dataDir + "PrintProjectPagesToSeparateFiles1_out.png", saveOptions); // Save project layout to separate files saveOptions.SaveToSeparateFiles = true; project.Save(dataDir + "PrintProjectPagesToSeparateFiles2_out.png", saveOptions); // ExEnd:PrintProjectPagesToSeparateFiles }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName); // ExStart:PrintProjectPagesToSeparateFiles Project project = new Project(dataDir + "CreateProject2.mpp"); ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFileFormat.PNG); saveOptions.StartDate = project.Get(Prj.StartDate).AddDays(-3); saveOptions.EndDate = project.Get(Prj.FinishDate); saveOptions.MarkCriticalTasks = true; saveOptions.LegendOnEachPage = false; saveOptions.Gridlines = new List <Gridline>(); Gridline gridline = new Gridline(); gridline.GridlineType = GridlineType.GanttRow; gridline.Color = Color.CornflowerBlue; gridline.Pattern = LinePattern.Dashed; saveOptions.Gridlines.Add(gridline); // Save the whole project layout to one file project.Save(dataDir + "PrintProjectPagesToSeparateFiles1_out.png", (SaveOptions)saveOptions); // Save project layout to separate files saveOptions.SaveToSeparateFiles = true; project.Save(dataDir + "PrintProjectPagesToSeparateFiles2_out.png", (SaveOptions)saveOptions); // ExEnd:PrintProjectPagesToSeparateFiles }
public void WorkWithGridline() { // ExStart:WorkWithGridline // ExFor: Gridline // ExFor: Gridline.#ctor // ExFor: Gridline.Color // ExFor: Gridline.GridlineType // ExFor: Gridline.Pattern // ExFor: GridlineType // ExSummary: Shows how to work with gridlines while save in visual formats. var project = new Project(DataDir + "CreateProject2.mpp"); var options = new ImageSaveOptions(SaveFileFormat.PNG); var gridline = new Gridline { // set the type of gridline (<see cref="P:Aspose.Tasks.Visualization.Gridline.GridlineType" />). GridlineType = GridlineType.GanttRow, // set the <see cref="T:Aspose.Tasks.Visualization.LinePattern" /> of a gridline Pattern = LinePattern.Dashed }; options.Gridlines = new List <Gridline>(); options.Gridlines.Add(gridline); project.Save(OutDir + "PrintProjectPagesToSeparateFiles_out.png", options); // ExEnd:WorkWithGridline }
public void PrintProjectPagesToSeparateFiles() { // ExStart:PrintProjectPagesToSeparateFiles // ExFor: SaveOptions.MarkCriticalTasks // ExSummary: Shows how to print critical tasks while save in image file formats. var project = new Project(DataDir + "CreateProject2.mpp"); var options = new ImageSaveOptions(SaveFileFormat.PNG) { StartDate = project.Get(Prj.StartDate).AddDays(-3), EndDate = project.Get(Prj.FinishDate), MarkCriticalTasks = true, LegendOnEachPage = false, Gridlines = new List <Gridline>() }; var gridline = new Gridline { GridlineType = GridlineType.GanttRow, Color = Color.CornflowerBlue, Pattern = LinePattern.Dashed }; options.Gridlines.Add(gridline); project.Save(OutDir + "PrintProjectPagesToSeparateFiles1_out.png", options); // Save project layout to separate files options.SaveToSeparateFiles = true; project.Save(OutDir + "PrintProjectPagesToSeparateFiles2_out.png", options); // ExEnd:PrintProjectPagesToSeparateFiles }
public void GetHashCodeGridline() { // ExStart:GetHashCodeGridline // ExFor: Gridline.GetHashCode // ExSummary: Shows how to get hash code of a gridline. var gridline1 = new Gridline(); var gridline2 = new Gridline(); // the hash code of a gridline is based on internal GUID field. Console.WriteLine("Gridline 1 Hash Code: {0}", gridline1.GetHashCode()); Console.WriteLine("Gridline 2 Hash Code: {0}", gridline2.GetHashCode()); // ExEnd:GetHashCodeGridline }
public void EqualsGridline() { // ExStart:EqualsGridline // ExFor: Gridline.Equals(Object) // ExSummary: Shows how to check an equality of gridlines. var gridline1 = new Gridline(); var gridline2 = new Gridline(); // the equality of gridlines is checked against to gridline type. Console.WriteLine("Gridline 1 Type: " + gridline1.GridlineType); Console.WriteLine("Gridline 2 Type: " + gridline2.GridlineType); Console.WriteLine("Are gridlines equal: " + gridline1.Equals(gridline2)); // change the type gridline1.GridlineType = GridlineType.BarRows; Console.WriteLine("Gridline 1 Type: " + gridline1.GridlineType); Console.WriteLine("Are gridlines equal: " + gridline1.Equals(gridline2)); // ExEnd:EqualsGridline }
protected override void PerformLinkageOperations() { base.PerformLinkageOperations(); if (!linked) { Board managedBoard = player.board; Delinker += () => { foreach (Ship ship in managedBoard.ships) { ship.gameObject.SetActive(false); } }; Gridline[] gridLines = Array.ConvertAll(CreateAndLinkAgents <Gridline>("", managedBoard.tiles.GetLength(0) + managedBoard.tiles.GetLength(1) - 2), (item) => { return((Gridline)item); }); float lineWidth = 1.00f - MiscellaneousVariables.it.boardTileSideLength; for (int i = 0; i < gridLines.Length; i++) { Gridline positionedLine = gridLines[i]; positionedLine.movementTime *= UnityEngine.Random.Range(0.800f, 1.200f); int verticalIndex = i - (managedBoard.tiles.GetLength(0) - 1); if (verticalIndex < 0) { positionedLine.transform.localScale = new Vector3(lineWidth, 1, managedBoard.tiles.GetLength(1)); positionedLine.hookedPosition = new Vector3(-managedBoard.tiles.GetLength(0) / 2.0f + i + 1, 0, 0); } else { positionedLine.transform.localScale = new Vector3(managedBoard.tiles.GetLength(0), 1, lineWidth); positionedLine.hookedPosition = new Vector3(0, 0, -managedBoard.tiles.GetLength(1) / 2.0f + verticalIndex + 1); } positionedLine.hookedPosition += managedBoard.transform.position + Vector3.up * MiscellaneousVariables.it.boardUIRenderHeight; positionedLine.unhookedPosition = positionedLine.hookedPosition - Vector3.up * positionedLine.hookedPosition.y * 1.25f; positionedLine.transform.position = positionedLine.unhookedPosition; } tiles = new Agents.Tile[managedBoard.tiles.GetLength(0), managedBoard.tiles.GetLength(1)]; } }