Skip to content

Commit eaa405e

Browse files
committed
Number of fixes to handle recent FluentSharp refactorings. Added Cat.NET code files (from O2_Scanner_MsCatNet project)
1 parent ca5df1a commit eaa405e

File tree

93 files changed

+3566
-1305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3566
-1305
lines changed

3rdParty/Chrome/PoC - Chrome Browser (WPF).h2

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?xml version="1.0"?>
2-
<H2>
3-
<SourceCode>//var webView = "webView_xSiW".o2Cache&lt;WebView&gt;(()=&gt; panel.clear().add_Chrome_Wpf());
1+
//var webView = "webView_xSiW".o2Cache<WebView>(()=> panel.clear().add_Chrome_Wpf());
42
//webView.Load("http://www.whatismybrowser.com");
53

64
//var topPanel = panel.clear().add_Panel();
@@ -19,7 +17,6 @@ return "ok";
1917

2018
//O2File:API_Chrome_WPF.cs
2119
//O2File:WPF_ExtensionMethods.cs
22-
//O2File:WPF_Controls_ExtensionMethods.cs
2320
//using CefSharp
2421
//using CefSharp.Wpf
2522

@@ -32,5 +29,3 @@ return "ok";
3229
//O2Ref:WindowsBase.dll
3330
//O2Ref:System.Xaml.dll
3431
//O2Tag_DontAddExtraO2Files
35-
</SourceCode>
36-
</H2>

3rdParty/Clojure/In Closure AppDomain/Launch Clojure REPL.h2

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?xml version="1.0"?>
2-
<H2>
3-
<SourceCode>//var topPanel = panel.clear().add_Panel();
1+
//var topPanel = panel.clear().add_Panel();
42
var topPanel = "Util - Clojure REPL (Lisp)".popupWindow(550,300);
53
topPanel.set_Form_Icon("Clojure-icon.png".local().bitmap().asIcon());
64

@@ -20,19 +18,19 @@ var samplesMenu = topPanel.mainMenu().clear()
2018
.add_Menu("Samples (start learning LISP here)");
2119
topPanel.mainMenu()
2220
.add_Menu("C# REPL")
23-
.add_MenuItem("REPL Clojure-clr engine", ()=&gt; "Clojure-cle engine".popupWindow().add_Script().set_Code(sampleClojureClrCode))
24-
.add_MenuItem("REPL this Form", ()=&gt; topPanel.script_Me())
25-
.add_MenuItem("REPL Script that created this GUI", ()=&gt;open.scriptEditor("Launch Clojure REPL.h2".local()));
21+
.add_MenuItem("REPL Clojure-clr engine", ()=> "Clojure-cle engine".popupWindow().add_Script().set_Code(sampleClojureClrCode))
22+
.add_MenuItem("REPL this Form", ()=> topPanel.script_Me())
23+
.add_MenuItem("REPL Script that created this GUI", ()=>open.scriptEditor("Launch Clojure REPL.h2".local()));
2624

2725
topPanel.mainMenu().add_Menu("Resources (WebSites)")
28-
.add_MenuItem("clojure.org Home Page" , ()=&gt; "http://clojure.org".startProcess())
29-
.add_MenuItem("tryclj - Online Clojure REPL (with tutorial)" , ()=&gt; "http://tryclj.com/".startProcess())
30-
.add_MenuItem("himera - Online Clojure REPL (with 'at a glance')" , ()=&gt; "http://himera.herokuapp.com/index.html".startProcess())
31-
.add_MenuItem("Clojure-Clr (github)" , ()=&gt; "https://github.com/clojure/clojure-clr".startProcess());
32-
33-
Action&lt;string, string&gt; add_Example =
34-
(title, code)=&gt;{
35-
samplesMenu.add_MenuItem(title, ()=&gt; codeEditor.set_Text(code));
26+
.add_MenuItem("clojure.org Home Page" , ()=> "http://clojure.org".startProcess())
27+
.add_MenuItem("tryclj - Online Clojure REPL (with tutorial)" , ()=> "http://tryclj.com/".startProcess())
28+
.add_MenuItem("himera - Online Clojure REPL (with 'at a glance')" , ()=> "http://himera.herokuapp.com/index.html".startProcess())
29+
.add_MenuItem("Clojure-Clr (github)" , ()=> "https://github.com/clojure/clojure-clr".startProcess());
30+
31+
Action<string, string> add_Example =
32+
(title, code)=>{
33+
samplesMenu.add_MenuItem(title, ()=> codeEditor.set_Text(code));
3634
};
3735

3836

@@ -50,7 +48,7 @@ Var.pushThreadBindings(RT.map(new object[]
5048
//setup REPL GUI
5149

5250
Action execute =
53-
()=&gt;{
51+
()=>{
5452
var code = codeEditor.get_Text();
5553

5654
try
@@ -71,7 +69,7 @@ Action execute =
7169
tooStrip.add_Play("Execute", execute)
7270
.add_CheckBox("Auto Execute",ref autoCompile);
7371

74-
codeEditor.onTextChange((text)=&gt; { if (autoCompile.value()) execute();});
72+
codeEditor.onTextChange((text)=> { if (autoCompile.value()) execute();});
7573
autoCompile.check();
7674

7775
codeEditor.set_Text("(+ 20 22)");
@@ -93,6 +91,6 @@ add_Example("a map" , "(map inc [1 2 3 4])");
9391
//using clojure.lang
9492

9593
//O2Ref:Clojure.Main.exe
96-
//O2Ref:Clojure.dll</SourceCode>
97-
<ReferencedAssemblies />
98-
</H2>
94+
//O2Ref:Clojure.dll
95+
96+
//O2Tag:SkipGlobalCompilation

3rdParty/GitHub/GitHub - CustomO2.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//O2File:Watin_IE_ExtensionMethods.cs
1616
//O2File:CustomO2.cs
1717
//O2File:API_GitHub.cs
18-
//O2File:MsysGit.cs
18+
//O2File:Git_Installer.cs
1919
//O2File:ascx_AskUserForLoginDetails.cs
2020
//O2File:API_GitHub_Issues.cs
2121
//O2Ref:WindowsFormsIntegration.dll
@@ -96,7 +96,7 @@ public GitHub_CustomO2 add_Tab_GitHub_Setup()
9696
{
9797
var gitHubSetup = Ribbon.add_Tab("GitHub Setup");
9898
gitHubSetup.add_Group("Putty")
99-
.add_Button("Install MsysGit", ()=> new MsysGit())
99+
.add_Button("Install Git", ()=> new Git_Installer())
100100
.add_Button("Install TortoiseGit", ()=>GitHub.install_TortoiseGit())
101101
.add_Button("Run PuttyGen", ()=> GitHub.putty_generateKeys());
102102
gitHubSetup.add_Group("TortoiseSVN")

3rdParty/ITextSharp/ascx_Create_Links_From_Clipboard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
using O2.DotNetWrappers.Windows;
1515

1616
//O2Ref:ITextSharp/itextsharp.dll
17-
17+
//Installer:ITextSharp_Installer.cs!ITextSharp/itextsharp.dll
1818

1919

2020
namespace O2.XRules.Database.Utils

3rdParty/Jni4Net/PoC - Jni4Net - Classes, Methods, Fields in target.h2

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?xml version="1.0"?>
2-
<H2>
3-
<SourceCode>Bridge.CreateJVM(new BridgeSetup(){Verbose=true}); //only needs to be called once
1+
Bridge.CreateJVM(new BridgeSetup(){Verbose=true}); //only needs to be called once
42

53
var topPanel = "PoC - Jni4Net - Classes, Methods, Fields in target".popupWindow(1000,400);
64
//var topPanel = panel.add_Panel(true);
@@ -11,24 +9,24 @@ var decompileClasses = false;
119
var treeView = topPanel.insert_Left().add_TreeView().sort();
1210
var codeViewer = topPanel.title("Decompiled Java code of selected class").add_SourceCodeEditor();
1311

14-
actionPanel.add_Link("REPL selectedNode", ()=&gt; treeView.selected().Tag.script_Me())
15-
.append_Link("Copy selectedNode text to clipboard", ()=&gt; treeView.selected().str().clipboardText_Set())
16-
.append_CheckBox("Decompile Classes", (value)=&gt; decompileClasses = value).autoSize().tick();
12+
actionPanel.add_Link("REPL selectedNode", ()=> treeView.selected().Tag.script_Me())
13+
.append_Link("Copy selectedNode text to clipboard", ()=> treeView.selected().str().clipboardText_Set())
14+
.append_CheckBox("Decompile Classes", (value)=> decompileClasses = value).autoSize().tick();
1715

1816
treeView.java_SetTreeView_To_Show_Jni4Net_Reflection_Data();
1917

2018
var jni4Net_Active = new API_Jni4Net_Active();
2119

2220
var classes = jni4Net_Active.java_From_ClassLoader_get_Loaded_Classes();
2321

24-
Action&lt;string&gt; showClasses =
25-
(filter)=&gt;{
22+
Action<string> showClasses =
23+
(filter)=>{
2624
var classesToShow = (filter.notValid())
2725
? classes
28-
: classes.Where((@class)=&gt;@class.getName().str().regEx(filter));
26+
: classes.Where((@class)=>@class.getName().str().regEx(filter));
2927
treeView.beginUpdate()
3028
.clear()
31-
.add_Nodes(classesToShow, (@class)=&gt;@class.getName(), true)
29+
.add_Nodes(classesToShow, (@class)=>@class.getName(), true)
3230
.endUpdate();
3331

3432
treeView.nodes().colorNodes(Color.DarkRed);
@@ -38,11 +36,11 @@ Action&lt;string&gt; showClasses =
3836
treeView.insert_Above(40,"Filter (RegEx applied on text change)")
3937
.add_TextBox().fill().onTextChange(showClasses);
4038

41-
Action&lt;Class&gt; showClassSourceCode =
42-
(@class)=&gt;{
39+
Action<Class> showClassSourceCode =
40+
(@class)=>{
4341
codeViewer.enabled(false);
4442
O2Thread.mtaThread(
45-
()=&gt;{
43+
()=>{
4644
var jad = new API_Jad();
4745
if (decompileClasses)
4846
{
@@ -64,12 +62,12 @@ Action&lt;Class&gt; showClassSourceCode =
6462
});
6563
};
6664

67-
treeView.afterSelect&lt;Class&gt;(
68-
(@class) =&gt; {
65+
treeView.afterSelect<Class>(
66+
(@class) => {
6967
showClassSourceCode (@class);
7068
});
71-
treeView.afterSelect&lt;Field&gt;(
72-
(field)=&gt;{
69+
treeView.afterSelect<Field>(
70+
(field)=>{
7371
showClassSourceCode(field.getDeclaringClass());
7472
});
7573
showClasses("");
@@ -83,9 +81,7 @@ return "done";
8381
//using net.sf.jni4net.jni
8482
//using java.lang.reflect
8583
//using net.sf.jni4net.adaptors
86-
//O2Ref:Jni4Net/lib/jni4net.n-0.8.7.0.dll
84+
//O2Ref:Jni4Net/lib/jni4net.n-0.8.6.0.dll
8785

8886
//O2File:API_Jni4Net_Active.cs
89-
//O2File:API_Jad.cs</SourceCode>
90-
<ReferencedAssemblies />
91-
</H2>
87+
//O2File:API_Jad.cs
Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
<?xml version="1.0"?>
2-
<H2>
3-
<SourceCode>//**************** StandAlone exe package and setup ****************
1+
//**************** StandAlone exe package and setup ****************
42
//O2Embed:LessMsi\lessmsi.exe
53
//O2Package:LessMsi\wix.dll
64
//O2Package:LessMsi\wixcab.dll
75
//O2Package:MSI_Icon.ico
86

9-
O2ConfigSettings.o2Version = "LessMSI";
7+
O2ConfigSettings.O2Version = "LessMSI";
108
O2Setup.extractEmbededConfigZips();
119
if ("wixcab.dll".local().fileExists())
1210
{
@@ -16,34 +14,31 @@ if ("wixcab.dll".local().fileExists())
1614
//*******************************************************************
1715

1816
var mainForm = (Form)"lessmsi.exe".assembly().type("MainForm").ctor("");
19-
O2Thread.staThread(()=&gt; mainForm.ShowDialog());
17+
O2Thread.staThread(()=> mainForm.ShowDialog());
2018
mainForm.wait(500);
2119
//mainForm.resizeFormToControlSize(panel);
2220
//mainForm.parentForm_AlwaysOnTop();
2321
mainForm.parentForm().set_Form_Icon("MSI_Icon.ico".local());
24-
Action&lt;string&gt; loadMSI =
25-
(path)=&gt;{
22+
Action<string> loadMSI =
23+
(path)=>{
2624
mainForm.invokeOnThread(
27-
()=&gt;{
25+
()=>{
2826
mainForm.prop("SelectedMsiFile", new FileInfo(path));
2927
mainForm.prop("Presenter").invoke("LoadCurrentFile");
30-
mainForm.field("btnUnselectAll").cast&lt;Button&gt;().click();
28+
mainForm.field("btnUnselectAll").cast<Button>().click();
3129
});
3230
};
3331

34-
mainForm.controls&lt;DataGridView&gt;(true)
35-
.forEach&lt;DataGridView&gt;((dataGridView)=&gt; dataGridView.onDrop(loadMSI));
32+
mainForm.controls<DataGridView>(true)
33+
.forEach<DataGridView>((dataGridView)=> dataGridView.onDrop(loadMSI));
3634

37-
var menuStrip = mainForm.control&lt;MenuStrip&gt;();
35+
var menuStrip = mainForm.control<MenuStrip>();
3836
menuStrip.add_MenuItem("REPL")
39-
.add_MenuItem("C# REPL main panel", ()=&gt; mainForm.control&lt;Panel&gt;().script_Me())
40-
.add_MenuItem("C# REPL file list", ()=&gt; mainForm.field("fileGrid").script_Me("fileGrid"));
37+
.add_MenuItem("C# REPL main panel", ()=> mainForm.control<Panel>().script_Me())
38+
.add_MenuItem("C# REPL file list", ()=> mainForm.field("fileGrid").script_Me("fileGrid"));
4139

4240

4341
//using LessMsi.UI
4442
//using System.IO;
4543
//O2File:API_LessMsi.cs
4644
//O2Ref:LessMsi/lessmsi.exe
47-
</SourceCode>
48-
<ReferencedAssemblies />
49-
</H2>

3rdParty/Microsoft/ASP.NET MVC/Tool - View Asp.NET MCV controllers.h2

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
<?xml version="1.0"?>
2-
<H2>
3-
<SourceCode>var topPanel = panel.add_Panel(true);
4-
//var topPanel = O2Gui.open&lt;Panel&gt;("Tool - View Asp.NET MVC Controllers", 800,600);
1+
//var topPanel = panel.add_Panel(true);
2+
var topPanel = O2Gui.open<Panel>("Tool - View Asp.NET MVC Controllers", 800,600);
53
var useCachedData = false;
6-
//var manualMethodStreams = topPanel.add_Control&lt;ascx_ManualMethodStreams&gt;();
4+
//var manualMethodStreams = topPanel.add_Control<ascx_ManualMethodStreams>();
75
var menu = topPanel.insert_MenuStrip();
86
var sourceCodeViewer = topPanel.add_SourceCodeViewer();
97
var astData = (O2MappedAstData)O2LiveObjects.get("astData");
10-
11-
List&lt;IClass&gt; controllers = null;
128

13-
var treeView = sourceCodeViewer.insert_Left&lt;TreeView&gt;(400)
14-
.showSelection();
15-
16-
17-
menu.add_Menu("REPL").add_MenuItem("REPL parent Form" , ()=&gt; topPanel.parentForm().script_Me())
18-
.add_MenuItem("REPL controllers" , ()=&gt; controllers.ToArray().script_Me("controllers"))
19-
.add_MenuItem("REPL astData" , ()=&gt; astData.script_Me("astData"));
9+
List<IClass> controllers = null;
10+
11+
var treeView = sourceCodeViewer.insert_Left<TreeView>(400)
12+
.showSelection();
13+
14+
15+
menu.add_Menu("REPL").add_MenuItem("REPL parent Form" , ()=> topPanel.parentForm().script_Me())
16+
.add_MenuItem("REPL controllers" , ()=> controllers.ToArray().script_Me("controllers"))
17+
.add_MenuItem("REPL astData" , ()=> astData.script_Me("astData"));
2018

21-
treeView.afterSelect&lt;MethodDeclaration&gt;(
22-
(methodDeclaration)=&gt;
19+
treeView.afterSelect<MethodDeclaration>(
20+
(methodDeclaration)=>
2321
{
2422
//sourceCodeViewer.set_Text(methodDeclaration.csharpCode(),".cs")
2523
var file = astData.file(methodDeclaration);
@@ -34,8 +32,8 @@ treeView.afterSelect&lt;MethodDeclaration&gt;(
3432

3533

3634

37-
Action&lt;string&gt; loadFilesFromFolder =
38-
(folder) =&gt; {
35+
Action<string> loadFilesFromFolder =
36+
(folder) => {
3937
treeView.backColor(Color.LightPink);
4038
//astData = null;
4139
if (useCachedData.isFalse() || astData == null)
@@ -47,13 +45,13 @@ Action&lt;string&gt; loadFilesFromFolder =
4745
O2LiveObjects.set("astData",astData);
4846
}
4947

50-
controllers = new List&lt;IClass&gt;();
48+
controllers = new List<IClass>();
5149
foreach(var iClass in astData.iClasses())
5250
{
53-
if (iClass.BaseTypes.Count &gt;0)
51+
if (iClass.BaseTypes.Count >0)
5452
{
55-
foreach(var baseType in iClass.BaseTypes)
56-
{
53+
foreach(var baseType in iClass.BaseTypes)
54+
{
5755
"iClass.baseType : {0}.{1}".debug(iClass.Name, baseType);
5856
if(baseType.FullyQualifiedName == "System.Web.Mvc.Controller" || baseType.FullyQualifiedName == "ContentController")
5957
controllers.Add(iClass);
@@ -67,14 +65,14 @@ Action&lt;string&gt; loadFilesFromFolder =
6765
else
6866
"base.base class:{0}".info(baseBaseType.FullyQualifiedName);
6967
*/
70-
}
68+
}
7169
}
7270
}
7371
}
7472
treeView.clear();
7573
foreach(var controller in controllers)
7674
foreach(var method in controller.Methods)
77-
if (method.IsConstructor.isFalse() &amp;&amp; method.IsPublic)
75+
if (method.IsConstructor.isFalse() && method.IsPublic)
7876
{
7977
if (astData.MapAstToNRefactory.IMethodToMethodDeclaration.hasKey(method))
8078
{
@@ -88,15 +86,15 @@ Action&lt;string&gt; loadFilesFromFolder =
8886

8987

9088
treeView.onDrop(
91-
(folder)=&gt;{
89+
(folder)=>{
9290
useCachedData = false;
9391
loadFilesFromFolder(folder);
9492
});
9593

9694
var sourceFolder = @"C:\__Tests\Demos_Files\NerdDinner_2.0\NerdDinner";
97-
loadFilesFromFolder(sourceFolder);
95+
loadFilesFromFolder(sourceFolder);
9896

99-
return astData;
97+
return astData;
10098

10199
//manualMethodStreams.buildGui();
102100

@@ -116,8 +114,6 @@ return astData;
116114
//O2Ref:Quickgraph.dll
117115
//O2Ref:GraphSharp.dll
118116
//O2Ref:GraphSharp.Controls.dll
119-
//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
120-
121-
//O2File:_Extra_methods_To_Add_to_Main_CodeBase.cs</SourceCode>
122-
<ReferencedAssemblies />
123-
</H2>
117+
//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
118+
119+
//O2File:_Extra_methods_To_Add_to_Main_CodeBase.cs

3rdParty/Microsoft/CatNet/API_CatNet.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@
1919
using O2.Interfaces.O2Findings;
2020
using Microsoft.ACESec.CATNet.Core.Driver;
2121
using Rules = Microsoft.ACESec.CATNet.Core.Rules;
22-
23-
//O2File:Findings_ExtensionMethods.cs
2422
//Installer:CatNet_Installer.cs!CatNet_1.1/SourceDir/Microsoft.ACESec.CATNet.Core.dll
25-
//O2Ref:_O2_Scanner_MsCatNet.exe
23+
//O2File:Findings_ExtensionMethods.cs
24+
//O2File:MsCatNetScanner.cs
2625
//O2Ref:CatNet_1.1/SourceDir/Microsoft.ACESec.CATNet.Core.dll
27-
//_O2Ref:CatNet_64/CAT.NET/Microsoft.ACESec.CATNet.Core.dll
2826

2927
namespace O2.XRules.Database.APIs
3028
{

0 commit comments

Comments
 (0)