📄 etopologymanager.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace TopoTest
{
public class eTopologyManager
{
[DllImport("ePath.dll")]
private static extern int CreateTopo();
[DllImport("ePath.dll")]
private static extern void DestroyTopo(int handle);
[DllImport("ePath.dll")]
private static extern int Open(int handle, [In] string strPath);
[DllImport("ePath.dll")]
private static extern void Close(int handle);
[DllImport("ePath.dll")]
private static extern void MinPathAnalyse(int handle, int lStart, int lEnd,ref double cost,[Out] StringBuilder lpBuffer);
private int handle=0;
public eTopologyManager()
{
handle = CreateTopo();
}
~eTopologyManager()
{
if(handle!=0)
DestroyTopo(handle);
}
public bool Open(string strPath)
{
return Open(handle, strPath) == 1;
}
public void Close()
{
Close(handle);
}
public string MinPathAnalyse(int lStart, int lEnd,ref double cost)
{
StringBuilder sb = new StringBuilder(1024);
MinPathAnalyse(handle, lStart, lEnd,ref cost,sb);
return sb.ToString();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -