Aggiorna i dati delle forme
Contents
[
Hide
]
Aggiorna la posizione della forma, inclusi xform, connection e geom quando si modifica il testo della forma o di altri
Il metodo RefreshData esposto daForma class può essere utilizzata per aggiornare i dati della forma
Il codice seguente mostra come:
- Carica un file di esempio.
- Accedi a una forma particolare.
- Aggiorna i dati della forma.
Aggiorna i dati di Shape
Utilizzare il seguente codice nell’applicazione .NET per aggiornare una forma utilizzando Aspose.Diagram for .NET.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir_Shapes(); | |
// Load a Visio diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
// Get page by name | |
Page page = diagram.Pages.GetPage("Page-3"); | |
// Get Shape | |
Shape shape = page.Shapes.GetShape(15); | |
// Refresh data | |
shape.RefreshData(); | |
// Save visio diagram | |
diagram.Save(dataDir + "RefreshData_out.vsdx", SaveFileFormat.VSDX); |