我试图在节点标签下显示状态的属性。
目前是这样的:
________________________ ________________________
| | pause() | |
| |------------>| |
| | continue() | |
|________________________|<------------|________________________|
我有代码:
Graph = new Graph<State>();
var a = new State()
{
Status = "Ready",
AllowedPurchaserOperations = "operation1, operation2",
AllowedSupplierOperations = "operarion1, operation 3"
};
var b = new State()
{
Status = "Paused",
AllowedPurchaserOperations = "operation1, operation2",
AllowedSupplierOperations = "operarion1, operation 3"
};
Graph.AddVertex(a);
Graph.AddVertex(b);
Graph.AddEdge(new Edge<State>(a, b) {Label = "pause()"});
Graph.AddEdge(new Edge<State>(b, a) {Label = "continue()"});
我想或多或少地像这样展示它:
________________________ ________________________
| Ready | pause() | Paused |
| operation1, operation2 |------------>| operation1, operation2 |
| operation1, operation3 | continue() | operation1, operation3 |
|________________________|<------------|________________________|
由于很难找到使用 graphviz 的实现示例,我不知道如何在节点中添加值。有人知道在转换之前我应该做什么吗?