/
Util - Wafl file Viewer.h2
54 lines (38 loc) · 1.57 KB
/
Util - Wafl file Viewer.h2
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
47
48
49
50
51
52
53
54
<?xml version="1.0"?>
<H2>
<SourceCode>var topPanel = O2Gui.open<Panel>("Wafl Viewer",700,400);
//var topPanel = panel.clear().add_Panel();
wafl waflObject = null;
Action<Panel> mapGlobalBeansDeclarations =
(targetPanel)=>{
var dataGridView = targetPanel.add_DataGridView();
dataGridView.add_Columns("id", "type", "lifespan");
foreach(var objectdecl in waflObject.globalbeandecls.objectdecl)
dataGridView.add_Row(objectdecl.id,objectdecl.type, objectdecl.lifespan);
};
Action<Control,string> loadFile =
(targetPanel, file)=>{
targetPanel.clear();
waflObject = wafl.Load(file);
var sourceCodeViewer = targetPanel.add_SourceCodeEditor();
sourceCodeViewer.set_Text(file.fileContents(), ".xml");
};
//var xmlFile = @"C:\_WorkDir\IBM\IBM AppScan Source\Applications\jPetStore\jPetStore_frameworksCLI.wafl";
topPanel.onDrop(
(file)=>{
loadFile(topPanel.add_GroupBox("SourceCode view of Wafl file"), file);
mapGlobalBeansDeclarations(topPanel.insert_Right("Global Bean Declarations"));
});
return topPanel.add_Label("Drop Wafl file here", 100,100).font_bold();
//mapGlobalBeansDeclarations(topPanel.insert_Below("Global Bean Declarations"));
//return xsdFile.xsdCreateCSharpFile();//.saveAs(xsdFile +".cs");
return "ok";
//O2File:wafl.cs
//using www.ibm.com.WAFLSchema
//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
//O2Ref:PresentationCore.dll
//O2Ref:PresentationFramework.dll
//O2Ref:WindowsBase.dll
//O2Ref:System.Xaml.dll</SourceCode>
<ReferencedAssemblies />
</H2>