forked from oazabir/codeuml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathManage.aspx.cs
46 lines (38 loc) · 1.3 KB
/
Manage.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Manage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Start_Clicked(object sender, EventArgs e)
{
PlantUmlProcessManager.Startup();
}
protected void Stop_Clicked(object sender, EventArgs e)
{
PlantUmlProcessManager.Shutdown();
}
protected void Recycle_Clicked(object sender, EventArgs e)
{
PlantUmlProcessManager.Recycle();
}
protected void Test_Clicked(object sender, EventArgs e)
{
var fileName = FileName.Text;
var diagramFileName = fileName + ".txt";
var imageFileName = fileName + ".png";
var umltext =
"@startuml " + imageFileName + Environment.NewLine +
UmlText.Text + Environment.NewLine +
"@enduml";
var key = Guid.NewGuid().ToString();
Context.Cache.Add(key, umltext, null, DateTime.Now.AddSeconds(60), System.Web.Caching.Cache.NoSlidingExpiration,
System.Web.Caching.CacheItemPriority.Default, null);
DiagramImage.Src = "getimage.ashx?key=" + key;
}
}