Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update scripts to major FluentSharp refactoring

  • Loading branch information...
commit 439e3606f17bee70f64fb9c95216716b7f5b9b14 1 parent b7380dd
@DinisCruz DinisCruz authored
Showing with 3,608 additions and 2,507 deletions.
  1. +1 −2  3rdParty/Chrome/API_Chrome.cs
  2. +4 −4 3rdParty/Chrome/API_Chrome_WPF.cs
  3. +6 −6 3rdParty/Chrome/PoC - Chrome Browser (WPF).h2
  4. +4 −4 3rdParty/Chrome/PoC - Chrome Browser (WinForms).h2
  5. +230 −230 3rdParty/GitHub/GitHub - CustomO2.cs
  6. +1 −2  3rdParty/IBM/Analysis_Workflows/Analysis_WorkFlow.cs
  7. +3 −3 3rdParty/IBM/Analysis_Workflows/Analysis_WorkFlow_Phase_1.cs
  8. +1 −1  3rdParty/IBM/Analysis_Workflows/Analysis_WorkFlow_Phase_5.cs
  9. +24 −0 3rdParty/MarkdownSharp/PoC - MarkdownSharp Transformations.h2
  10. +1 −1  3rdParty/Microsoft/CatNet/API_CatNet.cs
  11. +3 −3 3rdParty/Microsoft/CatNet/{CatNet.cs → CatNet_Installer.cs}
  12. BIN  3rdParty/Microsoft/CatNet/TestReport/CatNet_HacmeBank.xlsx
  13. +7 −8 3rdParty/Microsoft/HtmlAgilityPack/HtmlAgilityPack - Filter Html Code (using IE).h2
  14. +1 −1  3rdParty/Microsoft/HtmlAgilityPack/HtmlAgilityPack - Filter Html Code.h2
  15. +0 −68 3rdParty/Microsoft/HtmlAgilityPack/HtmlAgilityPack_ExtensionMethods_SourceCodeViewer.cs
  16. +272 −0 3rdParty/Microsoft/HtmlAgilityPack/HtmlAgilityPack_Extra_ExtensionMethods.cs
  17. +2 −4 3rdParty/Microsoft/HtmlAgilityPack/Util - Search Html code using HtmlAgilityPack.h2
  18. +2 −1  3rdParty/Microsoft/MSBuild/Program_UseWith_O2_CreatedExes.cs
  19. +2 −1  3rdParty/Microsoft/MSBuild/Program_UseWith_Roslyn_CreatedExes.cs
  20. +1 −3 3rdParty/Microsoft/VisualStudio/API_VisualStudio_2010_WPF.cs
  21. +3 −3 3rdParty/NodeJS/Util - NodeJS REPL Editor.h2
  22. +77 −0 3rdParty/NuGet/API_Nuget.cs
  23. +45 −45 3rdParty/OWASP/OWASP_Summit_2011/UnitTests_Test_AttendeeData.cs
  24. +6 −0 3rdParty/OWASP/WebScarab/API_WebScarab.cs
  25. +3 −2 3rdParty/SoSNet/SoSNet_ExtensionMethods.cs
  26. +2 −2 3rdParty/Veracode/API_Veracode_DetailedXmlFindings.cs.o2
  27. +4 −4 3rdParty/_Installers/Installer_Mdbg_Sample_4_0.cs
  28. +7 −6 3rdParty/_Installers/Installer_SosNet.cs
  29. +0 −38 3rdParty/_Installers/IronPython.cs
  30. +60 −60 APIs/Findings_Filtering/Findings_DemoData.cs
  31. +3 −1 APIs/Google/Blogger/API_Blogger.cs
  32. 0  APIs/IronPython/{IronPython.cs → IronPython_Install.cs}
  33. +1 −0  APIs/IronPython/PoC - IronPython REPL - Simple.h2
  34. +7 −6 APIs/MDbg/MDbg_ExtensionMethods.cs
  35. +2 −4 APIs/MediaWiki/MediaWikiEditor.cs.o2
  36. +242 −242 APIs/MediaWiki/MediaWiki_GuiControls/ascx_MediaWiki_Backup.cs
  37. +373 −375 APIs/MediaWiki/MediaWiki_GuiControls/ascx_MediaWiki_PageEditor_Simple.cs
  38. +3 −3 APIs/MediaWiki/O2MediaWikiAPI.cs
  39. +35 −35 APIs/MediaWiki/O2PlatformWikiAPI.cs
  40. +40 −0 APIs/MerlinWizard/MerlinUtils.cs
  41. +712 −0 APIs/MerlinWizard/Merlin_ExtensionMethods.cs
  42. +84 −0 APIs/MerlinWizard/O2Wizard.cs
  43. +120 −116 {Languages/DotNet → APIs/MerlinWizard}/Wizard - CopyGacDlls.cs.o2
  44. +5 −2 {Utils/Windows → APIs/MerlinWizard}/Wizard - Enable or Disable Network Interfaces.cs.o2
  45. +136 −136 {Utils/O2 → APIs/MerlinWizard}/Wizard - SVN Download (via HTTP).cs.o2.txt
  46. +120 −118 {Utils/_Misc_Scripts → APIs/MerlinWizard}/Wizard - SearchEngine UseCase 1.cs.o2
  47. 0  {Utils/O2 → APIs/MerlinWizard}/Wizard - Sync XRules Via Svn.cs.o2.txt
  48. +2 −0  {Utils/O2 → APIs/MerlinWizard}/Wizard - XRule Exec Simple.cs.o2
  49. +2 −2 APIs/OpenPgp/API_OpenPgp.cs
  50. +6 −7 APIs/OpenPgp/Tool - Using OpenPgp to Encrypt or Decrypt.h2
  51. +59 −59 APIs/OpenPgp/UnitTests_API_Open_Pgp.cs
  52. +5 −5 APIs/Roslyn/Util - View Roslyn AST Graph.h2
  53. +7 −8 APIs/Twitter/Tool - Twitter Account Creation.h2
  54. +0 −1  APIs/Twitter/Twitter Client.h2
  55. +0 −2  APIs/WPF/API_AvalonDock.cs
  56. +48 −48 APIs/WPF/API_WPF_ToolKit.cs
  57. +0 −2  APIs/WPF/DiagramDesigner/DiagramDesigner_ExtensionMethods.cs
  58. +0 −1  APIs/WPF/DiagramDesigner/DiagramDesigner_NewAppDomain.cs
  59. +3 −4 APIs/WPF/DiagramDesigner/Util - DiagramDesigner Editor.h2
  60. +10 −6 APIs/WPF/ElementHost_ExtensionMethods.cs
  61. +33 −0 APIs/WPF/Graph/GraphFactory.cs
  62. +0 −1  APIs/WPF/Graph/GraphLayout_O2CodeStream_ExtensionMethods.cs
  63. +0 −2  APIs/WPF/Graph/GraphLayout_WPF_ExtensionMethods.cs
  64. +1 −2  APIs/WPF/Graph/GraphSharp_ExtensionMethods.cs
  65. +29 −30 APIs/WPF/Graph/PoC - View Graph.h2
  66. +78 −78 APIs/WPF/Graph/To Import - from O2_API_AST/CodeStreamGraphNode_ExtensionMethods.cs
  67. +72 −73 APIs/WPF/Graph/VerticesAndEdges_ExtensionMethods.cs
  68. +76 −0 APIs/WPF/Graph/WpfTextEditor.cs
  69. +1 −4 APIs/WPF/Graph/ascx_GraphWithInspector.cs.o2
  70. +81 −81 APIs/WPF/MiniFramework/API_MiniFramework.cs
  71. +5 −11 APIs/WPF/WPF_GUI.cs
  72. +1 −2  APIs/WPF/WPF_Ribbon/CustomO2.cs
  73. +70 −72 APIs/WPF/WPF_Ribbon/WPF_Ribbon.cs
  74. +0 −1  APIs/WPF/WPF_Ribbon/WPF_Ribbon_ExtensionMethods.cs
  75. +3 −2 APIs/WPF/Wpf_TextEditor_ExtensionMethods.cs
  76. +1 −3 APIs/WPF/Xaml/O2 Xaml Editor (PoC).h2
  77. +12 −5 APIs/WPF/Xaml/Xaml_ExtensionMethods.cs
  78. +2 −3 APIs/WatiN/WatiN_IE_ExtensionMethods.cs
  79. +2 −4 APIs/Windows/AForge/API_AForge_Video_Image.cs
  80. +2 −3 APIs/Windows/AForge/API_AForge_Video_WPF_Image.cs
  81. +1 −2  APIs/Windows/AForge/Util - Movie Creator (Simple).h2
  82. +2 −2 APIs/Windows/AForge/Util - Movie Creator.h2
  83. +1 −2  APIs/Windows/AForge/ascx_MovieEditor.cs
  84. +1 −1  APIs/Windows/Cropper/API_Cropper.cs
  85. +2 −2 APIs/Windows/InputSimulator/API_InputSimulator.cs
  86. +1 −1  Languages/AspNet/ascx_WSDL_Creation_and_Execution.cs.o2
  87. +3 −3 Languages/AspNet/aspCompile.cs
  88. +3 −3 Languages/DotNet/Ast_Scanner/Ast_Engine/MethodMappings_ExtensionMethods.cs
  89. +0 −2  Languages/DotNet/Ast_Scanner/Controls/ascx_GraphAst_MethodCalls.cs
  90. +2 −4 Languages/DotNet/Ast_Scanner/O2_DotNet_Ast_Engine.cs
  91. +2 −4 Languages/DotNet/Ast_Scanner/O2_DotNet_Ast_Scanner.h2
  92. +1 −1  Languages/DotNet/DotNet_SDK_WSDL.cs
  93. +0 −1  Languages/J2EE/Struts/XUtils_Struts_Joins_V0_1.cs
  94. +0 −1  Languages/J2EE/Struts/xUtils_Struts_v0_1.cs
  95. +1 −1  Languages/Javascript/DWR/API_DWR.cs
  96. +9 −10 Languages/Javascript/Web - XSS PoC Builder.h2
  97. +10 −63 Utils/ExtensionMethods/_Extra_methods_To_Add_to_Main_CodeBase.cs
  98. +2 −2 Utils/ExtensionMethods/_Extra_methods_TypeConfusion.cs
  99. +0 −43 Utils/ExtensionMethods/_Extra_methods_WinFormsUI.cs
  100. +3 −6 Utils/O2/O2 Main WPF GUI.h2
  101. +5 −0 Utils/O2/Util - Secret Data Editor.h2
  102. +115 −115 Utils/O2/Wizard - BackupFolder.cs.o2
  103. +5 −3 ...alWebsite/{Util - Start WebServer on Local Folder.h2 → Util - Start .NET WebServer on Local Folder.h2}
  104. +14 −4 Utils/O2_StandAlone_Modules/HostLocalWebsite/ascx_HostLocalWebsite.cs
  105. +31 −34 Utils/O2_StandAlone_Modules/HostLocalWebsite/main.cs
  106. +1 −0  Utils/Web/ascx_HtmlTagViewer.cs
  107. +5 −0 Utils/_O2_Development/O2Dev_UnitTests/Under_Dev_or_Not_Working/Test_O2TwitterClient.cs
  108. +0 −1  _Custom_O2s/BlackBox and Browser Automation (Custom O2).h2
  109. +5 −6 _Custom_O2s/HacmeBank - Vulnerable Web Application (Custom O2).h2
  110. +5 −6 _Custom_O2s/OWASP Projects and Website (Custom O2).h2
  111. +0 −1  _Custom_O2s/OWASP WebScarab (Custom O2 version).h2
  112. +0 −1  _Custom_O2s/Security Consultants (Custom O2 version).h2
  113. +0 −1  _Custom_O2s/v1.1/O2 Main WPF GUI.h2
  114. +7 −7 _Custom_O2s/v1.4/O2 GUI - .Net Security Testing.h2
  115. +6 −7 _Custom_O2s/v1.4/O2 GUI - Browser Automation and BlackBox Testing.h2
  116. +3 −2 _Custom_O2s/v1.4/O2 GUI - Create Scripts or APIs.h2
  117. +7 −7 _Custom_O2s/v1.4/O2 GUI - Help.h2
  118. +7 −7 _Custom_O2s/v1.4/O2 GUI - Use OWASP Projects.h2
  119. +8 −8 _Custom_O2s/v1.4/O2 GUI - Use Other Tools or APIs.h2
  120. +2 −2 _Custom_O2s/v1.4/O2 GUI.h2
  121. +14 −22 _Custom_O2s/v4.1/Main O2 Gui.h2
  122. +2 −3 _Sample_Vulns/BlackBox - Exploit Execution.h2
  123. +0 −1  _Sample_Vulns/HacmeBank/API_HacmeBank.cs
  124. +2 −4 _Sample_Vulns/HacmeBank/HacmeBank - Custom O2 AST Security Scanner.h2
  125. +45 −45 _Sample_Vulns/JPetClinic/Spring_PetClinic_BlackBox_Exploits.cs
  126. +4 −1 _Sample_Vulns/SAST_DotNET/SAST DotNet Script - Misc Vulns.cs
  127. +3 −0  _Sample_Vulns/SAST_DotNET/SAST DotNet Script - XSS.cs
  128. +2 −2 _Sample_Vulns/SuperSecureBank/SSB Visualization - AppScan Source Findings with Traces.h2
  129. +0 −1  _Sample_Vulns/WebGoat/API_WebGoat.cs
View
3  3rdParty/Chrome/API_Chrome.cs
@@ -11,11 +11,10 @@
using CefSharp;
using CefSharp.WinForms;
+//Installer:CefSharp.cs!CefSharp\CefSharp-0.11-bin\CefSharp.WinForms.dll
//O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.WinForms.dll
//O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.dll
-//You will need to execute CefSharp.cs first (to download the CefSharp files)
-
namespace O2.XRules.Database.APIs
{
public class API_Chrome_Test
View
8 3rdParty/Chrome/API_Chrome_WPF.cs
@@ -2,7 +2,7 @@
using System;
using System.Linq;
using System.Threading;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Text;
using O2.Kernel.ExtensionMethods;
using O2.DotNetWrappers.DotNet;
@@ -11,7 +11,7 @@
using CefSharp;
using CefSharp.Wpf;
-//O2File:WPF_Controls_ExtensionMethods.cs
+//O2Ref:O2_FluentSharp_WPF.dll
//O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.Wpf.dll
//O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.dll
@@ -31,7 +31,7 @@ public class API_Chrome_Test
public void launchChrome()
{
"Chrome Browser test".popupWindow()
- .add_Chrome_Wpf()
+ .add_Chrome_Wpf(true)
.Load("http://news.bbc.co.uk");
}
}
@@ -64,7 +64,7 @@ public static WebView add_Chrome_Wpf(this System.Windows.Forms.Control control,
{
control.insert_Above(20)
.add_TextBox("Url:","")
- .onEnter((text)=> _webView.open_ASync(text));
+ .onEnter((text)=> _webView.open_ASync(text.info()));
//webView.onNavigate((url)=> urlTextBox.set_Text(url));
}
return _webView;
View
12 3rdParty/Chrome/PoC - Chrome Browser (WPF).h2
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<H2>
+<?xml version="1.0"?>
+<H2>
<SourceCode>//var webView = "webView_xSiW".o2Cache&lt;WebView&gt;(()=&gt; panel.clear().add_Chrome_Wpf());
//webView.Load("http://www.whatismybrowser.com");
@@ -14,7 +14,7 @@ webView.fadeOut(1);
this.sleep(1000);
webView.fadeIn(1);
return webView;
-return "ok";
+return "ok";
//O2File:API_Chrome_WPF.cs
@@ -25,13 +25,13 @@ return "ok";
//O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.Wpf.dll
//O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.dll
-
+//O2Ref:O2_FluentSharp_WPF.dll
//O2Ref:WindowsFormsIntegration.dll
//O2Ref:PresentationFramework.dll
//O2Ref:PresentationCore.dll
//O2Ref:WindowsBase.dll
//O2Ref:System.Xaml.dll
//O2Tag_DontAddExtraO2Files
-</SourceCode>
- <ReferencedAssemblies />
+</SourceCode>
+ <ReferencedAssemblies />
</H2>
View
8 3rdParty/Chrome/PoC - Chrome Browser (WinForms).h2
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<H2>
+<?xml version="1.0"?>
+<H2>
<SourceCode>var topPanel = "PoC - Chrome Browser (WinForms)".popupWindow();
//var topPanel = panel.clear().add_Panel();
@@ -14,6 +14,6 @@ return webView;
//O2File:API_Chrome.cs
//O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.WinForms.dll
-//O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.dll</SourceCode>
- <ReferencedAssemblies />
+//O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.dll</SourceCode>
+ <ReferencedAssemblies />
</H2>
View
460 3rdParty/GitHub/GitHub - CustomO2.cs
@@ -1,231 +1,231 @@
-// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using System.Text;
-using O2.Kernel;
-using O2.Kernel.ExtensionMethods;
-using O2.DotNetWrappers.DotNet;
-using O2.DotNetWrappers.Windows;
-using O2.DotNetWrappers.ExtensionMethods;
-using O2.Views.ASCX.classes.MainGUI;
-using O2.Views.ASCX.ExtensionMethods;
-using O2.XRules.Database.Utils;
-//O2File:Watin_IE_ExtensionMethods.cs
-//O2File:CustomO2.cs
-//O2File:API_GitHub.cs
-//O2File:MsysGit.cs
-//O2File:ascx_AskUserForLoginDetails.cs
-//O2File:API_GitHub_Issues.cs
-//O2Ref:WindowsFormsIntegration.dll
-//O2Ref:RibbonControlsLibrary.dll
-//O2Ref:WatiN.Core.1x.dll
-//O2Ref:White.Core.dll
-
-namespace O2.XRules.Database.APIs
-{
- public class GitHub_CustomO2_Launcher
- {
- public void showGui()
- {
- new GitHub_CustomO2().buildGui()
- .homePage();
- }
- }
-
- public class GitHub_CustomO2
- {
- public WPF_Ribbon Ribbon {get;set;}
- public WatiN_IE IE { get; set;}
- public API_GitHub GitHub {get; set;}
-
- public GitHub_CustomO2()
- {
- }
-
- public GitHub_CustomO2 buildGui()
- {
- var topPanel = O2Gui.open<Panel>("GitHub", 1024,600);
- return buildGui(topPanel);
- }
-
- public GitHub_CustomO2 buildGui(Panel topPanel)
- {
- return buildGui(topPanel,false);
- }
-
- public GitHub_CustomO2 buildGui(Panel topPanel, bool onlyAddIe)
- {
- if (onlyAddIe.isFalse())
- {
- Ribbon = topPanel.add_Ribbon_Above();
- Ribbon.title("Git Hub API");
-
- add_Tab_GitHub_Website();
- add_Tab_GitHub_Setup();
-
- var customO2 = Ribbon.add_Tab("Custom O2");
- customO2.add_RibbonGroup("Group")
- .add_RibbonButton_Script("IE Automation","ascx_IE_ScriptExecution.cs");
-
- //ribbon.add_Tab_BrowserAutomation();
- Ribbon.add_Tab_MiscTools();
- }
- configureIE();
- IE = topPanel.add_IE();
- return this;
- }
-
- public GitHub_CustomO2 add_Tab_GitHub_Website()
- {
- var gitHubWebsite = Ribbon.add_Tab("GitHub WebSite");
- gitHubWebsite.add_Group("Pages")
- .add_Button("HomePage", ()=> this.homePage())
- .add_Button("Login", ()=> this.login())
- .add_Button("LoginAs", ()=> this.loginAs())
- .add_Button("add SSH Public Key", ()=> this.add_SSH_PublicKey());
- gitHubWebsite.add_Group("Custom Editors")
- .add_Button("Issues", ()=> new API_GitHub_Issues().showEditor());
-
- return this;
-
- }
-
- public GitHub_CustomO2 add_Tab_GitHub_Setup()
- {
- var gitHubSetup = Ribbon.add_Tab("GitHub Setup");
- gitHubSetup.add_Group("Putty")
- .add_Button("Install MsysGit", ()=> new MsysGit())
- .add_Button("Install TortoiseGit", ()=>GitHub.install_TortoiseGit())
- .add_Button("Run PuttyGen", ()=> GitHub.putty_generateKeys());
- gitHubSetup.add_Group("TortoiseSVN")
- .add_Button("Git Clonet", ()=> GitHub.gitClone());
-
- return this;
- }
- public void configureIE()
- {
- "Adding trusted zones to IE".info();
- "github.com".makeDomainTrusted("");
- "github.com".makeDomainTrusted("*");
- }
- }
-
- public static class GitHub_CustomO2_IE_Helpers
- {
- public static GitHub_CustomO2 open(this GitHub_CustomO2 gitHub, string url)
- {
- var uri = url.starts("http")
- ? url.uri()
- : ("https://gitHub.com/" + url).uri();
- gitHub.IE.open(uri.str());
- return gitHub;
- }
-
- public static GitHub_CustomO2 openLink(this GitHub_CustomO2 gitHub, string link)
- {
- gitHub.IE.link(link).click();
- return gitHub;
- }
- }
-
- public static class GitHub_CustomO2_IE
- {
- public static bool inGitHub(this GitHub_CustomO2 gitHub)
- {
- return gitHub.IE.url().contains("github.com");
- }
-
- public static bool isLoggedIn(this GitHub_CustomO2 gitHub)
- {
- return gitHub.inGitHub() && gitHub.IE.hasLink("Log Out");
- }
-
- public static GitHub_CustomO2 login(this GitHub_CustomO2 gitHub)
- {
- var gitHubLogin = @"C:\O2\_USERDATA\accounts.xml".credential("github");
- if (gitHubLogin.isNull())
- gitHubLogin = ascx_AskUserForLoginDetails.ask();
- return gitHub.login(gitHubLogin.username(), gitHubLogin.password());
- }
-
- public static GitHub_CustomO2 loginAs(this GitHub_CustomO2 gitHub)
- {
- var gitHubLogin = ascx_AskUserForLoginDetails.ask();
- return gitHub.login(gitHubLogin.username(), gitHubLogin.password());
- }
-
- public static GitHub_CustomO2 login(this GitHub_CustomO2 gitHub, string username, string password)
- {
- if (username.inValid() || password.inValid())
- {
- "No valid login credentials were provided".error();
- return null;
- }
- gitHub.logout();
- var ie = gitHub.IE;
- ie.open("https://github.com/login");
- ie.field("login").value(username);
- ie.field("password").value(password);
- ie.button("Log in").click();
- return gitHub;
- }
-
- public static GitHub_CustomO2 logout(this GitHub_CustomO2 gitHub)
- {
- "Logging out".info();
- var ie = gitHub.IE;
- if (ie.hasLink("Log Out"))
- ie.link("Log Out").click();
- return gitHub;
- }
-
-
- public static GitHub_CustomO2 homePage(this GitHub_CustomO2 gitHub)
- {
- gitHub.IE.open("http://github.com");
- return gitHub;
- }
-
- public static GitHub_CustomO2 accountSettings(this GitHub_CustomO2 gitHub)
- {
- return gitHub.openLink("Account Settings");
- }
-
- public static GitHub_CustomO2 add_SSH_PublicKey(this GitHub_CustomO2 gitHub)
- {
- var ie = gitHub.IE;
- var keyPath = "What is the path to the public key to use?".askUser();
- if (keyPath.fileExists().isFalse())
- {
- "no key file provided".error();
- }
- else
- {
- var title = System.IO.Path.GetFileNameWithoutExtension(keyPath);
- var key = keyPath.fileContents();
- gitHub.homePage();
- gitHub.accountSettings();
- ie.link("SSH Public Keys").click();
- ie.link("Add another public key").click();
- ie.field("public_key[title]").value(title);
- ie.field("public_key[key]").value(key);
- ie.button("<SPAN>Add key</SPAN>").click();
- }
- return gitHub;
- }
-
- public static GitHub_CustomO2 newRepository(this GitHub_CustomO2 gitHub, string name, string description, string homepageUrl)
- {
- var ie = gitHub.IE;
- ie.open("https://github.com/repositories/new");
- ie.field("repository[name]",name);
- ie.field("repository[description]",description);
- ie.field("repository[homepage]",homepageUrl);
- ie.radioButtons()[1].@checked();
- ie.button("<SPAN>Create Repository</SPAN>").click();
- return gitHub;
- }
- }
+// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using System.Text;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.DotNet;
+using O2.DotNetWrappers.Windows;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.Views.ASCX.classes.MainGUI;
+using O2.Views.ASCX.ExtensionMethods;
+using O2.XRules.Database.Utils;
+//O2File:Watin_IE_ExtensionMethods.cs
+//O2File:CustomO2.cs
+//O2File:API_GitHub.cs
+//O2File:MsysGit.cs
+//O2File:ascx_AskUserForLoginDetails.cs
+//O2File:API_GitHub_Issues.cs
+//O2Ref:WindowsFormsIntegration.dll
+//O2Ref:RibbonControlsLibrary.dll
+//O2Ref:WatiN.Core.1x.dll
+//O2Ref:White.Core.dll
+
+namespace O2.XRules.Database.APIs
+{
+ public class GitHub_CustomO2_Launcher
+ {
+ public void showGui()
+ {
+ new GitHub_CustomO2().buildGui()
+ .homePage();
+ }
+ }
+
+ public class GitHub_CustomO2
+ {
+ public WPF_Ribbon Ribbon {get;set;}
+ public WatiN_IE IE { get; set;}
+ public API_GitHub GitHub {get; set;}
+
+ public GitHub_CustomO2()
+ {
+ }
+
+ public GitHub_CustomO2 buildGui()
+ {
+ var topPanel = O2Gui.open<Panel>("GitHub", 1024,600).insert_LogViewer();
+ return buildGui(topPanel);
+ }
+
+ public GitHub_CustomO2 buildGui(Panel topPanel)
+ {
+ return buildGui(topPanel,false);
+ }
+
+ public GitHub_CustomO2 buildGui(Panel topPanel, bool onlyAddIe)
+ {
+ if (onlyAddIe.isFalse())
+ {
+ Ribbon = topPanel.add_Ribbon_Above();
+ Ribbon.title("Git Hub API");
+
+ add_Tab_GitHub_Website();
+ add_Tab_GitHub_Setup();
+
+ var customO2 = Ribbon.add_Tab("Custom O2");
+ customO2.add_RibbonGroup("Group")
+ .add_RibbonButton_Script("IE Automation","ascx_IE_ScriptExecution.cs");
+
+ //ribbon.add_Tab_BrowserAutomation();
+ Ribbon.add_Tab_MiscTools();
+ }
+ configureIE();
+ IE = topPanel.add_IE();
+ return this;
+ }
+
+ public GitHub_CustomO2 add_Tab_GitHub_Website()
+ {
+ var gitHubWebsite = Ribbon.add_Tab("GitHub WebSite");
+ gitHubWebsite.add_Group("Pages")
+ .add_Button("HomePage", ()=> this.homePage())
+ .add_Button("Login", ()=> this.login())
+ .add_Button("LoginAs", ()=> this.loginAs())
+ .add_Button("add SSH Public Key", ()=> this.add_SSH_PublicKey());
+ gitHubWebsite.add_Group("Custom Editors")
+ .add_Button("Issues", ()=> new API_GitHub_Issues().showEditor());
+
+ return this;
+
+ }
+
+ public GitHub_CustomO2 add_Tab_GitHub_Setup()
+ {
+ var gitHubSetup = Ribbon.add_Tab("GitHub Setup");
+ gitHubSetup.add_Group("Putty")
+ .add_Button("Install MsysGit", ()=> new MsysGit())
+ .add_Button("Install TortoiseGit", ()=>GitHub.install_TortoiseGit())
+ .add_Button("Run PuttyGen", ()=> GitHub.putty_generateKeys());
+ gitHubSetup.add_Group("TortoiseSVN")
+ .add_Button("Git Clonet", ()=> GitHub.gitClone());
+
+ return this;
+ }
+ public void configureIE()
+ {
+ "Adding trusted zones to IE".info();
+ "github.com".makeDomainTrusted("");
+ "github.com".makeDomainTrusted("*");
+ }
+ }
+
+ public static class GitHub_CustomO2_IE_Helpers
+ {
+ public static GitHub_CustomO2 open(this GitHub_CustomO2 gitHub, string url)
+ {
+ var uri = url.starts("http")
+ ? url.uri()
+ : ("https://gitHub.com/" + url).uri();
+ gitHub.IE.open(uri.str());
+ return gitHub;
+ }
+
+ public static GitHub_CustomO2 openLink(this GitHub_CustomO2 gitHub, string link)
+ {
+ gitHub.IE.link(link).click();
+ return gitHub;
+ }
+ }
+
+ public static class GitHub_CustomO2_IE
+ {
+ public static bool inGitHub(this GitHub_CustomO2 gitHub)
+ {
+ return gitHub.IE.url().contains("github.com");
+ }
+
+ public static bool isLoggedIn(this GitHub_CustomO2 gitHub)
+ {
+ return gitHub.inGitHub() && gitHub.IE.hasLink("Log Out");
+ }
+
+ public static GitHub_CustomO2 login(this GitHub_CustomO2 gitHub)
+ {
+ var gitHubLogin = @"C:\O2\_USERDATA\accounts.xml".credential("github");
+ if (gitHubLogin.isNull())
+ gitHubLogin = ascx_AskUserForLoginDetails.ask();
+ return gitHub.login(gitHubLogin.username(), gitHubLogin.password());
+ }
+
+ public static GitHub_CustomO2 loginAs(this GitHub_CustomO2 gitHub)
+ {
+ var gitHubLogin = ascx_AskUserForLoginDetails.ask();
+ return gitHub.login(gitHubLogin.username(), gitHubLogin.password());
+ }
+
+ public static GitHub_CustomO2 login(this GitHub_CustomO2 gitHub, string username, string password)
+ {
+ if (username.inValid() || password.inValid())
+ {
+ "No valid login credentials were provided".error();
+ return null;
+ }
+ gitHub.logout();
+ var ie = gitHub.IE;
+ ie.open("https://github.com/login");
+ ie.field("login").value(username);
+ ie.field("password").value(password);
+ ie.button("Log in").click();
+ return gitHub;
+ }
+
+ public static GitHub_CustomO2 logout(this GitHub_CustomO2 gitHub)
+ {
+ "Logging out".info();
+ var ie = gitHub.IE;
+ if (ie.hasLink("Log Out"))
+ ie.link("Log Out").click();
+ return gitHub;
+ }
+
+
+ public static GitHub_CustomO2 homePage(this GitHub_CustomO2 gitHub)
+ {
+ gitHub.IE.open("http://github.com");
+ return gitHub;
+ }
+
+ public static GitHub_CustomO2 accountSettings(this GitHub_CustomO2 gitHub)
+ {
+ return gitHub.openLink("Account Settings");
+ }
+
+ public static GitHub_CustomO2 add_SSH_PublicKey(this GitHub_CustomO2 gitHub)
+ {
+ var ie = gitHub.IE;
+ var keyPath = "What is the path to the public key to use?".askUser();
+ if (keyPath.fileExists().isFalse())
+ {
+ "no key file provided".error();
+ }
+ else
+ {
+ var title = System.IO.Path.GetFileNameWithoutExtension(keyPath);
+ var key = keyPath.fileContents();
+ gitHub.homePage();
+ gitHub.accountSettings();
+ ie.link("SSH Public Keys").click();
+ ie.link("Add another public key").click();
+ ie.field("public_key[title]").value(title);
+ ie.field("public_key[key]").value(key);
+ ie.button("<SPAN>Add key</SPAN>").click();
+ }
+ return gitHub;
+ }
+
+ public static GitHub_CustomO2 newRepository(this GitHub_CustomO2 gitHub, string name, string description, string homepageUrl)
+ {
+ var ie = gitHub.IE;
+ ie.open("https://github.com/repositories/new");
+ ie.field("repository[name]",name);
+ ie.field("repository[description]",description);
+ ie.field("repository[homepage]",homepageUrl);
+ ie.radioButtons()[1].@checked();
+ ie.button("<SPAN>Create Repository</SPAN>").click();
+ return gitHub;
+ }
+ }
}
View
3  3rdParty/IBM/Analysis_Workflows/Analysis_WorkFlow.cs
@@ -1,11 +1,10 @@
// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-//O2Tag_OnlyAddReferencedAssemblies
using System.IO;
using O2.Interfaces.O2Core;
using O2.Interfaces.XRules;
using O2.Kernel;
using O2.DotNetWrappers.O2CmdShell;
-using O2.DotNetWrappers.Windows;
+using O2.DotNetWrappers.Windows;
//O2File:IAnalysisArtifacts.cs
using O2.XRules.Database.Interfaces;
//O2Ref:nunit.framework.dll
View
6 3rdParty/IBM/Analysis_Workflows/Analysis_WorkFlow_Phase_1.cs
@@ -45,11 +45,11 @@ public void task1_copyAssessmentFiles(IAnalysisArtifacts analysisArtifacts)
foreach(var fileOrFolder in analysisArtifacts.assessmentFilesOrFolderToLoad)
{
if (File.Exists(fileOrFolder))
- filesCopied.Add(Files.CopyVerbose(fileOrFolder, folderWithArtifacts_Phase1,dontCopyIfTargetFileAlreadyExists));
+ filesCopied.Add(Files.copyVerbose(fileOrFolder, folderWithArtifacts_Phase1,dontCopyIfTargetFileAlreadyExists));
else
if (Directory.Exists(fileOrFolder))
foreach(var assessmentFile in Files.getFilesFromDir_returnFullPath(fileOrFolder, "*.ozasmt", true))
- filesCopied.Add(Files.CopyVerbose(assessmentFile, folderWithArtifacts_Phase1,dontCopyIfTargetFileAlreadyExists));
+ filesCopied.Add(Files.copyVerbose(assessmentFile, folderWithArtifacts_Phase1,dontCopyIfTargetFileAlreadyExists));
}
@@ -89,7 +89,7 @@ public void task2_copyProjectConfigFiles(IAnalysisArtifacts analysisArtifacts)
Assert.That(Directory.Exists(targetFolder), "targetFolder did not exist: " + targetFolder);
// copy config *.xml files
foreach(var configFile in Files.getFilesFromDir_returnFullPath(projectWebInf,"*.xml", false))
- Files.Copy(configFile, targetFolder);
+ Files.copy(configFile, targetFolder);
// make sure target folder has at least 1 file
Assert.That(Files.getFilesFromDir_returnFullPath(targetFolder).Count > 0, "There wer no config files copied to: " + targetFolder);
View
2  3rdParty/IBM/Analysis_Workflows/Analysis_WorkFlow_Phase_5.cs
@@ -51,7 +51,7 @@ public void task1_createFinalAssessmentFile()
public void copyFinalAssessmentFileToWorkflowFolder()
{
- Files.Copy(finalAssessmentFile,workflowFolder);
+ Files.copy(finalAssessmentFile,workflowFolder);
}
View
24 3rdParty/MarkdownSharp/PoC - MarkdownSharp Transformations.h2
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<H2>
+ <SourceCode>//var topPanel = panel.add_Panel(true);
+var topPanel = "PoC - MarkdownSharp Transformations".popupWindow();
+var textArea_Source = topPanel.add_TextArea();
+var textArea_Transformed = textArea_Source.insert_Right()
+ .add_TextArea();
+var browser = textArea_Transformed.insert_Above()
+ .add_WebBrowser();
+Action&lt;string&gt; applyTransform =
+ (source) =&gt; {
+ var transformed = new Markdown().Transform(source);
+ textArea_Transformed.set_Text(transformed);
+ browser.set_Html(transformed);
+ };
+
+textArea_Source.onTextChange(applyTransform)
+ .set_Text("#Hello World");
+
+//using MarkdownSharp
+//O2Ref:NuGet\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll
+</SourceCode>
+ <ReferencedAssemblies />
+</H2>
View
2  3rdParty/Microsoft/CatNet/API_CatNet.cs
@@ -21,7 +21,7 @@
using Rules = Microsoft.ACESec.CATNet.Core.Rules;
//O2File:Findings_ExtensionMethods.cs
-
+//Installer:CatNet_Installer.cs!CatNet_1.1/SourceDir/Microsoft.ACESec.CATNet.Core.dll
//O2Ref:_O2_Scanner_MsCatNet.exe
//O2Ref:CatNet_1.1/SourceDir/Microsoft.ACESec.CATNet.Core.dll
//_O2Ref:CatNet_64/CAT.NET/Microsoft.ACESec.CATNet.Core.dll
View
6 3rdParty/Microsoft/CatNet/CatNet.cs → 3rdParty/Microsoft/CatNet/CatNet_Installer.cs
@@ -10,16 +10,16 @@ public class DynamicType
{
public void dynamicMethod()
{
- new O2.XRules.Database.APIs.CatNet().start();
+ new O2.XRules.Database.APIs.CatNet_Installer().start();
}
}
namespace O2.XRules.Database.APIs
{
- public class CatNet : Tool_API
+ public class CatNet_Installer : Tool_API
{
- public CatNet()
+ public CatNet_Installer()
{
config("CatNet_1.1",
"http://download.microsoft.com/download/3/3/4/334E8A84-0F1B-4E3C-AF5F-99DA8AE0601F/CATNETx32.msi".uri(),
View
BIN  3rdParty/Microsoft/CatNet/TestReport/CatNet_HacmeBank.xlsx
Binary file not shown
View
15 3rdParty/Microsoft/HtmlAgilityPack/HtmlAgilityPack - Filter Html Code (using IE).h2
@@ -1,22 +1,21 @@
<?xml version="1.0"?>
<H2>
- <SourceCode>var topPanel = "HtmlAgilityPack - Filter Html Code".popupWindow();
-//var topPanel = panel.clear().add_Panel();
+ <SourceCode>//var topPanel = "HtmlAgilityPack - Filter Html Code".popupWindow();
+var topPanel = panel.clear().add_Panel();
var treeView = topPanel.insert_Right("XPath query result")
.add_TreeView_for_HtmlTags();
-var ie = topPanel.add_GroupBox("Browser").add_IE().silent(true);
+var ie = topPanel.add_GroupBox("Browser").add_WebBrowser().silent(true);
-ie.open("http://demo.testfire.net");
+ie.open("http://demo.testfire.net").waitForCompleted();
-var htmlContent = ie.IE.Html;
+var htmlContent = ie.html();
+
var query = "//tr";
treeView.add_Nodes(htmlContent.htmlDocument().select(query));
//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
-
-//O2File:WatiN_IE_ExtensionMethods.cs
-//O2Ref:WatiN.Core.1x.dll</SourceCode>
+//O2File:HtmlAgilityPack_Extra_ExtensionMethods.cs</SourceCode>
<ReferencedAssemblies />
</H2>
View
2  3rdParty/Microsoft/HtmlAgilityPack/HtmlAgilityPack - Filter Html Code.h2
@@ -18,7 +18,7 @@ textBox.sendKeys(query.line());
return "ok";
//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
-//O2File:HtmlAgilityPack_ExtensionMethods_SourceCodeViewer.cs
+//O2File:HtmlAgilityPack_Extra_ExtensionMethods.cs
</SourceCode>
<ReferencedAssemblies />
</H2>
View
68 3rdParty/Microsoft/HtmlAgilityPack/HtmlAgilityPack_ExtensionMethods_SourceCodeViewer.cs
@@ -1,68 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using O2.DotNetWrappers.ExtensionMethods;
-using O2.External.SharpDevelop.Ascx;
-using O2.External.SharpDevelop.ExtensionMethods;
-using System.Xml;
-using System.IO;
-using System.Windows.Forms;
-
-//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
-
-namespace O2.XRules.Database.Utils
-{
- public static class HtmlAgilityPack_ExtensionMethods_SourceCodeViewer
- {
-
- public static ascx_SourceCodeViewer showHtmlNodeLocation(this ascx_SourceCodeViewer codeViewer, HtmlAgilityPack.HtmlNode htmlNode)
- {
- codeViewer.editor().showHtmlNodeLocation(htmlNode);
- return codeViewer;
- }
-
- public static ascx_SourceCodeEditor showHtmlNodeLocation(this ascx_SourceCodeEditor codeEditor, HtmlAgilityPack.HtmlNode htmlNode)
- {
-
- var startLine = htmlNode.Line;
- var startColumn = htmlNode.LinePosition;
-
- var endLine = startLine;
- var endColumn = startColumn;
-
- if (htmlNode.NextSibling != null)
- {
- endLine = htmlNode.NextSibling.Line;
- endColumn = htmlNode.NextSibling.LinePosition;
- }
- else
- endColumn += htmlNode.html().size();
- "selecting CodeEditor location: {0}:{1} -> {2}:{3}".info(startLine, startColumn, endLine, endColumn);
- codeEditor.clearMarkers();
- codeEditor.selectTextWithColor(startLine, startColumn, endLine, endColumn);
- codeEditor.caret_Line(startLine);
- codeEditor.refresh();
-
- return codeEditor;
- }
- public static TreeView after_TagSelect_showIn_SouceCodeViewer(this TreeView htmlTags_TreeView, ascx_SourceCodeViewer htmlCodeViewer)
- {
- htmlTags_TreeView.afterSelect<HtmlAgilityPack.HtmlNode>(
- (htmlNode) =>
- {
- try
- {
- htmlCodeViewer.showHtmlNodeLocation(htmlNode);
- htmlCodeViewer.editor().caret(htmlNode.Line, htmlNode.LinePosition);
- }
- catch (Exception ex)
- {
- "[after_TagSelect_showIn_SouceCodeViewer] Error: {0}".error(ex.Message);
- }
- });
- return htmlTags_TreeView;
- }
-
- }
-}
View
272 3rdParty/Microsoft/HtmlAgilityPack/HtmlAgilityPack_Extra_ExtensionMethods.cs
@@ -0,0 +1,272 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.External.SharpDevelop.Ascx;
+using O2.External.SharpDevelop.ExtensionMethods;
+using System.Xml;
+using System.IO;
+using System.Windows.Forms;
+
+//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
+
+namespace O2.XRules.Database.Utils
+{
+
+ public static class HtmlAgilityPack_ExtensionMethods_SourceCodeViewer
+ {
+
+ public static ascx_SourceCodeViewer showHtmlNodeLocation(this ascx_SourceCodeViewer codeViewer, HtmlAgilityPack.HtmlNode htmlNode)
+ {
+ codeViewer.editor().showHtmlNodeLocation(htmlNode);
+ return codeViewer;
+ }
+
+ public static ascx_SourceCodeEditor showHtmlNodeLocation(this ascx_SourceCodeEditor codeEditor, HtmlAgilityPack.HtmlNode htmlNode)
+ {
+
+ var startLine = htmlNode.Line;
+ var startColumn = htmlNode.LinePosition;
+
+ var endLine = startLine;
+ var endColumn = startColumn;
+
+ if (htmlNode.NextSibling != null)
+ {
+ endLine = htmlNode.NextSibling.Line;
+ endColumn = htmlNode.NextSibling.LinePosition;
+ }
+ else
+ endColumn += htmlNode.html().size();
+ "selecting CodeEditor location: {0}:{1} -> {2}:{3}".info(startLine, startColumn, endLine, endColumn);
+ codeEditor.clearMarkers();
+ codeEditor.selectTextWithColor(startLine, startColumn, endLine, endColumn);
+ codeEditor.caret_Line(startLine);
+ codeEditor.refresh();
+
+ return codeEditor;
+ }
+ public static TreeView after_TagSelect_showIn_SouceCodeViewer(this TreeView htmlTags_TreeView, ascx_SourceCodeViewer htmlCodeViewer)
+ {
+ htmlTags_TreeView.afterSelect<HtmlAgilityPack.HtmlNode>(
+ (htmlNode) =>
+ {
+ try
+ {
+ htmlCodeViewer.showHtmlNodeLocation(htmlNode);
+ htmlCodeViewer.editor().caret(htmlNode.Line, htmlNode.LinePosition);
+ }
+ catch (Exception ex)
+ {
+ "[after_TagSelect_showIn_SouceCodeViewer] Error: {0}".error(ex.Message);
+ }
+ });
+ return htmlTags_TreeView;
+ }
+
+ }
+
+
+ public static class HtmlAgilityPack_ExtensionMethods_TreeView
+ {
+ #region TreeView mappings
+
+ public static TreeView add_Node(this TreeView treeView, HtmlAgilityPack.HtmlDocument htmlDocument)
+ {
+ return treeView.add_Node(htmlDocument.DocumentNode);
+ }
+
+ public static TreeView add_Node(this TreeView treeView, HtmlAgilityPack.HtmlNode htmlNode)
+ {
+ treeView.rootNode().add_Node(htmlNode);
+ return treeView;
+ }
+
+ public static TreeNode add_Node(this TreeNode treeNode, HtmlAgilityPack.HtmlNode htmlNode)
+ {
+ return treeNode.add_Node(htmlNode.Name, htmlNode, true);
+ }
+
+ public static TreeView add_Nodes(this TreeView treeView, List<HtmlAgilityPack.HtmlNode> htmlNodes)
+ {
+ treeView.rootNode().add_Nodes(htmlNodes);
+ return treeView;
+ }
+
+ public static TreeNode add_Nodes(this TreeNode treeNode, List<HtmlAgilityPack.HtmlNode> htmlNodes)
+ {
+ foreach (var htmlNode in htmlNodes)
+ treeNode.add_Node(htmlNode);
+ return treeNode;
+ }
+
+ #endregion
+ }
+
+
+
+ public static class HtmlAgilityPack_ExtensionMethods_GuiHelpers
+ {
+ public static TextBox add_HtmlTags_Viewer_with_Filter(this Control control, string htmlCode)
+ {
+ var htmlTags_TreeView = control.add_TreeView_for_HtmlTags();
+ return htmlTags_TreeView.add_HtmlTagFilter(htmlCode);
+ //return htmlTags_TreeView;
+ }
+
+ public static TreeView add_TreeView_for_HtmlTags(this Control control)
+ {
+ return control.add_TreeView_for_HtmlTags(null);
+ }
+
+ public static TreeView add_TreeView_for_HtmlTags(this Control control, Action<string> applyFilter)
+ {
+ control.clear();
+ var htmlTags_TreeView = control.add_TreeView();
+ htmlTags_TreeView.beforeExpand<HtmlAgilityPack.HtmlNode>(
+ (treeNode, htmlNode) =>
+ {
+ if (htmlNode.Attributes != null)
+ foreach (var attribute in htmlNode.Attributes)
+ treeNode.add_Node("a: {0}={1}".format(attribute.Name, attribute.Value));
+ treeNode.add_Node("v: {0}".format(htmlNode.InnerHtml));
+ if (htmlNode.ChildNodes != null)
+ foreach (var childNode in htmlNode.ChildNodes)
+ if (childNode.html().valid())
+ treeNode.add_Node("n: {0}".format(childNode.Name), childNode, true);
+ });
+
+ var treeView_ContextMenu = htmlTags_TreeView.add_ContextMenu();
+ treeView_ContextMenu.add_MenuItem("Sort Nodes", () => htmlTags_TreeView.sort());
+ treeView_ContextMenu.add_MenuItem("Don't Sort Nodes", () => htmlTags_TreeView.sort(false));
+ //treeView_ContextMenu.add_MenuItem("Show all nodes",()=> htmlNodeFilter.sendKeys("//*".line()));
+
+ if (applyFilter.notNull())
+ htmlTags_TreeView.insert_Below_HtmlTagFilter(applyFilter);
+ return htmlTags_TreeView;
+ }
+
+ public static TextBox insert_Below_HtmlTagFilter(this Control control, Action<string> applyFilter)
+ {
+ var sampleXPathQueries = new List<string> { "//*",
+ "//a",
+ "//img",
+ "//a[contains(@href,'news')]",
+ "//a[contains(text(),'S')]",
+ "//a[text()='Blogs']" };
+ var htmlNodeFilter = control.insert_Below<TextBox>(25).fill();
+ var sampleQueries_MenuItem = htmlNodeFilter.add_ContextMenu().add_MenuItem("Sample queries");
+
+ foreach (var xPathQuery in sampleXPathQueries)
+ sampleQueries_MenuItem.add_MenuItem(xPathQuery, (text) => htmlNodeFilter.set_Text(text.str()));
+
+ htmlNodeFilter.onEnter(
+ (text) =>
+ {
+ applyFilter(text);
+ });
+
+ return htmlNodeFilter;
+ }
+
+ public static TextBox add_HtmlTagFilter(this TreeView htmlTags_TreeView, string htmlCode)
+ {
+ TextBox htmlNodeFilter = null;
+ Action<string> applyFilter =
+ (filter) =>
+ {
+ htmlCode.showFilteredHtmlContentInTreeView(filter, htmlTags_TreeView, htmlNodeFilter);
+ };
+
+ htmlNodeFilter = htmlTags_TreeView.insert_Below_HtmlTagFilter(applyFilter);
+
+ return htmlNodeFilter;
+ }
+
+ public static string showFilteredHtmlContentInTreeView(this string htmlCode, string filter, TreeView htmlTags_TreeView, TextBox htmlNodeFilter)
+ {
+ htmlTags_TreeView.clear();
+ try
+ {
+ ">showing htmlcode with size: {0}".info(htmlCode.size());
+ htmlNodeFilter.backColor(Color.White);
+ var htmlDocument = htmlCode.htmlDocument();
+ if (filter.valid())
+ htmlTags_TreeView.add_Nodes(htmlDocument.select(filter));
+ else
+ {
+ htmlTags_TreeView.add_Node(htmlDocument);
+ htmlTags_TreeView.expand();
+ }
+ "HtmlTags_TreeView nodes: {0}".info(htmlTags_TreeView.nodes().size());
+
+ }
+ catch (System.Exception ex)
+ {
+ ex.log("in htmlNodeFilter.onEnter");
+ htmlNodeFilter.backColor(Color.Red);
+ }
+ htmlTags_TreeView.applyPathFor_1NodeMissingNodeBug();
+ return htmlCode;
+ }
+
+ #region string mappings
+
+ public static string htmlToXml(this string htmlCode)
+ {
+ return htmlCode.htmlToXml(true);
+ }
+
+ public static string htmlToXml(this string htmlCode, bool xmlFormat)
+ {
+ try
+ {
+ var stringWriter = new StringWriter();
+ var xmlWriter = XmlWriter.Create(stringWriter);
+ xmlWriter.Flush();
+ var htmlDocument = htmlCode.htmlDocument();
+
+ htmlDocument.Save(xmlWriter);
+ if (xmlFormat)
+ return stringWriter.str().xmlFormat();
+ return stringWriter.str();
+ }
+ catch (Exception ex)
+ {
+ ex.log("[string.htmlToXml]");
+ return ex.Message;
+ }
+ }
+
+ public static string tidyHtml(this string htmlCode)
+ {
+ var htmlDocument = htmlCode.htmlDocument();
+ var tidiedhtml = htmlDocument.tidyHtml();
+ if (tidiedhtml.valid())
+ return tidiedhtml;
+ return htmlCode;
+ }
+
+ public static string tidyHtml(this HtmlAgilityPack.HtmlDocument htmlDocument)
+ {
+ try
+ {
+ htmlDocument.OptionCheckSyntax = true;
+ htmlDocument.OptionFixNestedTags = true;
+ htmlDocument.OptionAutoCloseOnEnd = true;
+ htmlDocument.OptionOutputAsXml = true;
+ //htmlDocument.OptionDefaultStreamEncoding = Encoding.Default;
+ var formatedCode = htmlDocument.DocumentNode.OuterHtml.xmlFormat().xRoot().innerXml().trim();
+ return formatedCode;
+ }
+ catch (Exception ex)
+ {
+ ex.log("[string.tidyHtml]");
+ return null;
+ }
+ }
+ #endregion
+ }
+}
View
6 3rdParty/Microsoft/HtmlAgilityPack/Util - Search Html code using HtmlAgilityPack.h2
@@ -33,7 +33,7 @@ var viewAsXml = false;
optionsPanel.add_CheckBox("View as Xml",0,5, (value) =&gt; viewAsXml = value);
optionsPanel.add_Link("view in browser", 5,100,
()=&gt; O2Gui.open&lt;Panel&gt;("Browser view of HtmlCode",400,400)
- .add_Browser()
+ .add_WebBrowser()
.silent(true)
.open(htmlCodeViewer.get_Text().save()))
.bringToFront();
@@ -106,9 +106,7 @@ foreach(var xPathQuery in sampleXPathQueries)
pageToOpen.sendKeys(defaultPage.line());
-//O2File:HtmlAgilityPack_ExtensionMethods_SourceCodeViewer.cs
-//using O2.External.IE.ExtensionMethods
-//O2Ref:O2_External_IE.dll
+//O2File:HtmlAgilityPack_Extra_ExtensionMethods.cs
//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
//O2Ref:System.Xml.dll
//O2Ref:System.Xml.Linq.dll</SourceCode>
View
3  3rdParty/Microsoft/MSBuild/Program_UseWith_O2_CreatedExes.cs
@@ -1,4 +1,5 @@
-using System;
+//O2Tag:SkipGlobalCompilation
+using System;
using System.IO.Compression;
using System.Collections.Generic;
using System.Linq;
View
3  3rdParty/Microsoft/MSBuild/Program_UseWith_Roslyn_CreatedExes.cs
@@ -1,4 +1,5 @@
-using System;
+//O2Tag:SkipGlobalCompilation
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
View
4 3rdParty/Microsoft/VisualStudio/API_VisualStudio_2010_WPF.cs
@@ -10,17 +10,15 @@
using O2.DotNetWrappers.ExtensionMethods;
using O2.XRules.Database.Utils;
using O2.FluentSharp.VisualStudio;
-using O2.API.Visualization.ExtensionMethods;
+//O2Ref:O2_FluentSharp_WPF.dll
//O2File:API_VisualStudio_2010.cs
-//O2File:WPF_Controls_ExtensionMethods.cs
//O2Ref:EnvDTE.dll
//O2Ref:EnvDTE80.dll
//O2Ref:Extensibility.dll
//O2Ref:Microsoft.VisualStudio.CommandBars.dll
//O2Ref:Microsoft.VisualStudio.Shell.ViewManager.dll
-//O2Ref:O2_API_Visualization.dll
//O2Ref:PresentationCore.dll
//O2Ref:PresentationFramework.dll
View
6 3rdParty/NodeJS/Util - NodeJS REPL Editor.h2
@@ -65,8 +65,8 @@ codeEditor.onTextChange(
});
topPanel.parent().parent().insert_Above(40,"Actions")
.add_Link("Execute Javascript code" , ()=&gt; executeScript(code))
- .append_Link("Termine execution", ()=&gt;stopExecution())
- .append_Link("Open NodeJs Scripts folder", ()=&gt; "Hello World.js".local().directoryName().startProcess())
+ .append_Link("Termine execution", ()=&gt;stopExecution())
+ .append_Link("Open NodeJs Scripts folder", ()=&gt; "Hello World.js".local().directoryName().startProcess())
.append_CheckBox("Execute on text Change",(value)=&gt; executeOnTextChange = value);
//.tick();
@@ -88,6 +88,6 @@ return "ok";
//O2File:NodeJS.cs
//O2File:CmdExeAPI.cs
//O2Tag_DontAddExtraO2Files
- //O2Ref: Microsoft.CSharp.dll</SourceCode>
+//O2Ref: Microsoft.CSharp.dll</SourceCode>
<ReferencedAssemblies />
</H2>
View
77 3rdParty/NuGet/API_Nuget.cs
@@ -0,0 +1,77 @@
+// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
+using System;
+using System.Linq;
+using System.Threading;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using System.Text;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.DotNet;
+using O2.DotNetWrappers.ExtensionMethods;
+
+namespace O2.XRules.Database.APIs
+{
+ public class API_NuGet
+ {
+ public string NuGet_Exe { get; set;}
+ public string NuGet_Exe_DownloadUrl { get; set;}
+
+ public API_NuGet()
+ {
+ this.NuGet_Exe = PublicDI.config.ToolsOrApis
+ .pathCombine("NuGet").createDir()
+ .pathCombine("NuGet.exe");
+ this.NuGet_Exe_DownloadUrl = "http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=nuget&DownloadId=412077&FileTime=129851621946970000&Build=19310";
+ this.checkInstall();
+ }
+
+ public string execute(string command)
+ {
+ return this.NuGet_Exe.startProcess_getConsoleOut(command);
+ }
+ }
+
+ public static class API_NuGet_ExtensionMethods
+ {
+ public static API_NuGet checkInstall(this API_NuGet nuGet)
+ {
+ if (nuGet.NuGet_Exe.fileExists())
+ "[API_NuGet] found NuGet.exe: {0}".info(nuGet.NuGet_Exe);
+ else
+ {
+ "[API_NuGet] NuGet.exe not found, so downloading it".debug();
+ nuGet.NuGet_Exe_DownloadUrl.download(nuGet.NuGet_Exe);
+ }
+ return nuGet;
+ }
+
+ public static string list(this API_NuGet nuGet, string filter)
+ {
+ return nuGet.execute("list " + filter);
+ }
+ public static string install(this API_NuGet nuGet, string packageName)
+ {
+ return nuGet.execute("install " + packageName);
+ }
+
+ public static string setAPI(this API_NuGet nuGet, string apiKey)
+ {
+ return nuGet.execute("SetApiKey " + apiKey);
+ }
+
+ public static string pack(this API_NuGet nuGet, string pathToNuSpec)
+ {
+ if (pathToNuSpec.fileExists())
+ return nuGet.execute("Pack " + pathToNuSpec);
+ return "[API_NuGet] could not find provided NuSpec file: {0}".error(pathToNuSpec);
+ }
+
+ public static string push(this API_NuGet nuGet, string pathToNuSpec)
+ {
+ if (pathToNuSpec.fileExists())
+ return nuGet.execute("Push " + pathToNuSpec);
+ return "[API_NuGet] could not find provided NuSpec file: {0}".error(pathToNuSpec);
+ }
+ }
+}
View
90 3rdParty/OWASP/OWASP_Summit_2011/UnitTests_Test_AttendeeData.cs
@@ -1,45 +1,45 @@
-// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Text;
-using O2.Kernel;
-using O2.Kernel.ExtensionMethods;
-using O2.DotNetWrappers.ExtensionMethods;
-using O2.XRules.Database.APIs;
-using NUnit.Framework;
-//O2File:API_OWASP_Summit_2011.cs
-//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
-//O2Ref:nunit.framework.dll
-
-namespace O2.UnitTests.OWASP_Summit_2011
-{
- [TestFixture]
- public class Test_AttendeeData
- {
- [Test]
- public string canParseAllTemplates()
- {
- var summitApi = new API_OWASP_Summit_2011();
- var attendeesPages = summitApi.attendees(true);
- foreach(var testPage in attendeesPages)
- {
- if (testPage.contains("Summit_2011_Attendee"))
- {
- var page = testPage.split("|")[0].trim();
- //return testPage;
-
- var wikiApi = new OwaspWikiAPI(false);
-
- var templateData = new WikiText_Template();
-
- templateData.parse(wikiApi,page);
- Assert.That(templateData.Status.str() == "Parsed", "Could not parse page: {0}".format(page));
- }
- }
- return "ok";
- }
-
- }
-}
+// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Text;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.XRules.Database.APIs;
+using NUnit.Framework;
+//O2File:API_OWASP_Summit_2011.cs
+//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
+//O2Ref:nunit.framework.dll
+
+namespace O2.UnitTests.OWASP_Summit_2011
+{
+ [TestFixture]
+ public class Test_AttendeeData
+ {
+ [Test]
+ public string canParseAllTemplates()
+ {
+ var summitApi = new API_OWASP_Summit_2011();
+ var attendeesPages = summitApi.attendees(true);
+ foreach(var testPage in attendeesPages)
+ {
+ if (testPage.contains("Summit_2011_Attendee"))
+ {
+ var page = testPage.split("|")[0].trim();
+ //return testPage;
+
+ var wikiApi = new OwaspWikiAPI(false);
+
+ var templateData = new WikiText_Template();
+
+ templateData.parse(wikiApi,page);
+ Assert.That(templateData.Status.str() == "Parsed", "Could not parse page: {0}".format(page));
+ }
+ }
+ return "ok";
+ }
+
+ }
+}
View
6 3rdParty/OWASP/WebScarab/API_WebScarab.cs
@@ -21,6 +21,12 @@
//O2File:Tool_API.cs
//O2Ref:O2_Misc_Microsoft_MPL_Libs.dll
+//O2Ref:WindowsFormsIntegration.dll
+//O2Ref:PresentationFramework.dll
+//O2Ref:PresentationCore.dll
+//O2Ref:WindowsBase.dll
+//O2Ref:System.Xaml.dll
+
using O2.XRules.Database.Utils;
namespace O2.XRules.Database.APIs
View
5 3rdParty/SoSNet/SoSNet_ExtensionMethods.cs
@@ -13,8 +13,9 @@
using SOS.Net.Core.Cdb;
using SOS.Net.Core.Cdb.Commands;
-//O2Ref:SosNet\SOS.Net.Core.dll
-//O2Ref:SosNet\SOS.Net.exe
+//Installer:Installer_SosNet.cs!SosNet\SOS.Net.Core.dll
+//O2Ref:SosNet\Debug\SOS.Net.Core.dll
+//O2Ref:SosNet\Debug\SOS.Net.exe
namespace O2.XRules.Database.Utils
{
View
4 3rdParty/Veracode/API_Veracode_DetailedXmlFindings.cs.o2
@@ -78,7 +78,7 @@ namespace O2.XRules.Database.APIs
if (apiVeracode.WorkDir.isNull())
apiVeracode.ReportXmlFile = unzipedFiles[1];
else
- apiVeracode.ReportXmlFile = Files.Copy(unzipedFiles[1],apiVeracode.WorkDir);
+ apiVeracode.ReportXmlFile = Files.copy(unzipedFiles[1],apiVeracode.WorkDir);
apiVeracode.DetailedReport = detailedreport.Load(apiVeracode.ReportXmlFile);
}
@@ -183,7 +183,7 @@ namespace O2.XRules.Database.APIs
if (cSharpFile.fileExists())
{
if (targetDir.valid())
- return Files.Copy(cSharpFile, targetDir);
+ return Files.copy(cSharpFile, targetDir);
return cSharpFile;
}
return null;
View
8 3rdParty/_Installers/Installer_Mdbg_Sample_4_0.cs
@@ -14,13 +14,13 @@ public class testInstall
{
public static void test()
{
- new Installer_MDbg_Sample().start();
+ new Installer_MDbg_Sample_4_0().start();
}
}
- public class Installer_MDbg_Sample : Tool_API
+ public class Installer_MDbg_Sample_4_0 : Tool_API
{
- public Installer_MDbg_Sample()
+ public Installer_MDbg_Sample_4_0()
{
config("MDbg_Sample",
"http://download.microsoft.com/download/E/5/B/E5BF5F79-45FB-4ACA-AA6F-4F2C0DFE29C8/MDbgSample4.EXE".uri(),
@@ -28,7 +28,7 @@ public Installer_MDbg_Sample()
install_MDbg();
}
- public Installer_MDbg_Sample install_MDbg()
+ public Installer_MDbg_Sample_4_0 install_MDbg()
{
if (this.isInstalled().isFalse())
{
View
13 3rdParty/_Installers/Installer_SosNet.cs
@@ -7,10 +7,11 @@
using O2.XRules.Database.Utils;
//O2File:Tool_API.cs
-//O2File:API_NGit.cs
+//_O2File:API_NGit.cs
//O2File:_Extra_methods_Roslyn_API.cs
//O2File:API_MSBuild.cs
+//O2Ref:O2_FluentSharp_NGit.dll
//O2Ref:Mono.Posix.dll
//O2Ref:ICSharpCode.SharpZipLib.dll
//O2Ref:Roslyn.Services.dll
@@ -90,10 +91,10 @@ public void download_Update_and_Install()
if (pssCor4Zip.fileExists())
{
pssCor4Zip.unzip(Install_Dir);
- Files.Copy(pssCor4_x86,x86_Folder);
- Files.Copy(pssCor4_x86.replace(".dll",".pdb"),x86_Folder);
- Files.Copy(pssCor4_x64,x64_Folder);
- Files.Copy(pssCor4_x64.replace(".dll",".pdb"),x64_Folder);
+ Files.copy(pssCor4_x86,x86_Folder);
+ Files.copy(pssCor4_x86.replace(".dll",".pdb"),x86_Folder);
+ Files.copy(pssCor4_x64,x64_Folder);
+ Files.copy(pssCor4_x64.replace(".dll",".pdb"),x64_Folder);
}
else
"[psscor4 install], could not find psscor4 zip file: {0}".error(pssCor4Zip);
@@ -141,7 +142,7 @@ public Installer_SosNet compileUsingRoslyn()
//new System.Reflection.Assembly().GetName
var assemblyName = "{0}.{1}".format(assembly.GetName().Name, assembly.EntryPoint.isNull() ? "dll" : "exe");
var assemblyLocation = roslynAssemblies.pathCombine(assemblyName);
- Files.Copy(assembly.Location, roslynAssemblies).info();
+ Files.copy(assembly.Location, roslynAssemblies).info();
}
return this;
}
View
38 3rdParty/_Installers/IronPython.cs
@@ -1,38 +0,0 @@
-using System;
-using System.Diagnostics;
-using O2.Kernel;
-using O2.Kernel.ExtensionMethods;
-using O2.DotNetWrappers.ExtensionMethods;
-using O2.XRules.Database.Utils;
-//O2File:Tool_API.cs
-
-namespace O2.XRules.Database.APIs
-{
- public class testInstall
- {
- public static void test()
- {
- new IronPython_Install().start();
- }
- }
-
- public class IronPython_Install : Tool_API
- {
- public IronPython_Install()
- {
- config("IronPython",
- "IronPython.msi",
- "http://download.codeplex.com/Download/Release?ProjectName=ironpython&DownloadId=352994&FileTime=129760937686670000&Build=18978".uri(),
- "SourceDir\\IronPython 2.7\\ipy.exe");
- install_JustMsiExtract_into_TargetDir();
- }
- //
-
- public Process start()
- {
- if (this.isInstalled())
- return this.Executable.startProcess();
- return null;
- }
- }
-}
View
120 APIs/Findings_Filtering/Findings_DemoData.cs
@@ -1,60 +1,60 @@
-// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-using System;
-using System.IO;
-using System.Linq;
-using System.Threading;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using O2.DotNetWrappers.DotNet;
-using O2.DotNetWrappers.O2Findings;
-using O2.DotNetWrappers.Windows;
-using O2.DotNetWrappers.ExtensionMethods;
-using O2.ImportExport.OunceLabs.Ozasmt_OunceV6;
-using O2.Interfaces.O2Core;
-using O2.Interfaces.O2Findings;
-using O2.Kernel;
-using O2.Kernel.ExtensionMethods;
-using O2.External.SharpDevelop.ExtensionMethods;
-using O2.External.SharpDevelop.Ascx;
-using O2.Views.ASCX.O2Findings;
-
-//O2File:Findings_ExtensionMethods.cs
-
-//O2Ref:O2_ImportExport_OunceLabs.dll
-
-namespace O2.XRules.Database.Findings
-{
-
- public static class Findings_DemoData
- {
- public static string tempFindingsFolder = "".tempDir().pathCombine("_demoFindings");
-
-
- public static List<IO2Finding> hacmeBank_AllFindings()
- {
- try
- {
- tempFindingsFolder.createDir();
- var findingsFile = tempFindingsFolder.pathCombine("HacmeBank_COMPLETE_TRACES.ozasmt");
- if (findingsFile.fileExists().isFalse())
- {
- var tempFolder = "HacmeBank_COMPLETE_TRACES.zip".local().unzip_File();
- var tempUnzipedFile = tempFolder.files()[0];
- Files.MoveFile(tempUnzipedFile, findingsFile);
- Files.deleteFolder(tempFolder);
- }
- return findingsFile.loadFindingsFile();
- }
- catch(Exception ex)
- {
- ex.log("in Findings_DemoData.hacmeBank_AllFindings");
- return new List<IO2Finding>();
- }
-
- //var testFile = "HacmeBank_COMPLETE_TRACES.zip".local();
- //var tempFile = testFile.unzip_FileAndReturtListOfUnzipedFiles()[0];
- //var o2Findings = tempFile.loadFindingsFile();
- //return
- }
- }
-}
+// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
+using System;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using O2.DotNetWrappers.DotNet;
+using O2.DotNetWrappers.O2Findings;
+using O2.DotNetWrappers.Windows;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.ImportExport.OunceLabs.Ozasmt_OunceV6;
+using O2.Interfaces.O2Core;
+using O2.Interfaces.O2Findings;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.External.SharpDevelop.ExtensionMethods;
+using O2.External.SharpDevelop.Ascx;
+using O2.Views.ASCX.O2Findings;
+
+//O2File:Findings_ExtensionMethods.cs
+
+//O2Ref:O2_ImportExport_OunceLabs.dll
+
+namespace O2.XRules.Database.Findings
+{
+
+ public static class Findings_DemoData
+ {
+ public static string tempFindingsFolder = "".tempDir().pathCombine("_demoFindings");
+
+
+ public static List<IO2Finding> hacmeBank_AllFindings()
+ {
+ try
+ {
+ tempFindingsFolder.createDir();
+ var findingsFile = tempFindingsFolder.pathCombine("HacmeBank_COMPLETE_TRACES.ozasmt");
+ if (findingsFile.fileExists().isFalse())
+ {
+ var tempFolder = "HacmeBank_COMPLETE_TRACES.zip".local().unzip_File();
+ var tempUnzipedFile = tempFolder.files()[0];
+ Files.moveFile(tempUnzipedFile, findingsFile);
+ Files.deleteFolder(tempFolder);
+ }
+ return findingsFile.loadFindingsFile();
+ }
+ catch(Exception ex)
+ {
+ ex.log("in Findings_DemoData.hacmeBank_AllFindings");
+ return new List<IO2Finding>();
+ }
+
+ //var testFile = "HacmeBank_COMPLETE_TRACES.zip".local();
+ //var tempFile = testFile.unzip_FileAndReturtListOfUnzipedFiles()[0];
+ //var o2Findings = tempFile.loadFindingsFile();
+ //return
+ }
+ }
+}
View
4 APIs/Google/Blogger/API_Blogger.cs
@@ -13,6 +13,8 @@
using O2.Views.ASCX.ExtensionMethods;
using O2.Views.ASCX.classes.MainGUI;
using O2.External.IE.ExtensionMethods;
+using O2.External.IE.Interfaces;
+using O2.External.IE.Wrapper;
using SHDocVw;
using WatiN.Core;
using O2.XRules.Database.Utils;
@@ -231,7 +233,7 @@ private static API_Blogger buildGui()
panel.clear();
var hostPanel = panel.add_1x1("write","live view",false);
- var newPostBody = hostPanel[0].add_Browser();
+ var newPostBody = (O2BrowserIE)hostPanel[0].add_O2_Browser_IE();
var optionsTab = newPostBody.insert_Above<TabControl>(100);
var bloggerView = hostPanel[1].add_IE();
var bloggerApi = new API_Blogger(bloggerView);
View
0  APIs/IronPython/IronPython.cs → APIs/IronPython/IronPython_Install.cs
File renamed without changes
View
1  APIs/IronPython/PoC - IronPython REPL - Simple.h2
@@ -34,6 +34,7 @@ codeEditor.parent().insert_Above(20).add_Link("Execute Pyhton code" , ()=&gt; ex
//using Microsoft.Scripting
//using IronPython
//using IronPython.Hosting
+//Installer:IronPython_Install.cs!IronPython\SourceDir\GAC\IronPython.dll
//O2Ref:IronPython\SourceDir\GAC\IronPython.dll
//O2Ref:IronPython\SourceDir\GAC\Microsoft.Dynamic.dll
//O2Ref:IronPython\SourceDir\GAC\Microsoft.Scripting.dll
View
13 APIs/MDbg/MDbg_ExtensionMethods.cs
@@ -12,12 +12,13 @@
using Microsoft.Samples.Debugging.CorMetadata;
using Microsoft.Samples.Debugging.CorDebug.NativeApi;
-//O2Ref:MDbg_Sample\MDbg\mdbgeng.dll
-//O2Ref:MDbg_Sample\MDbg\corapi.dll
-//O2Ref:MDbg_Sample\MDbg\mdbgeng.dll
-//O2Ref:MDbg_Sample\MDbg\mdbg.exe
-//O2Ref:MDbg_Sample\MDbg\mdbgext.dll
-//O2Ref:MDbg_Sample\MDbg\raw.dll
+//Installer:Installer_MDbg_Sample_4_0.cs!MDbg_Sample\MDbg\mdbgeng.dll
+//O2Ref:MDbg_Sample\MDbg Sample\bin\debug\mdbgeng.dll
+//O2Ref:MDbg_Sample\MDbg Sample\bin\debug\corapi.dll
+//O2Ref:MDbg_Sample\MDbg Sample\bin\debug\mdbgeng.dll
+//O2Ref:MDbg_Sample\MDbg Sample\bin\debug\mdbg.exe
+//O2Ref:MDbg_Sample\MDbg Sample\bin\debug\mdbgext.dll
+//O2Ref:MDbg_Sample\MDbg Sample\bin\debug\raw.dll
namespace O2.XRules.Database.Utils
{
View
6 APIs/MediaWiki/MediaWikiEditor.cs.o2
@@ -20,7 +20,6 @@ using O2.External.IE.ExtensionMethods;
using O2.XRules.Database.APIs;
using O2.XRules.Database.Utils;
-using O2.API.Visualization.ExtensionMethods;
using AvalonDock;
//O2File:OwaspWikiAPI.cs
@@ -34,7 +33,6 @@ using AvalonDock;
//O2File:ascx_MediaWiki_PageEditor_Simple.cs
//O2Ref:AvalonDock.dll
-//O2Ref:O2_API_Visualization.dll
//O2Ref:PresentationCore.dll
//O2Ref:WindowsBase.dll
//O2Ref:PresentationFramework.dll
@@ -448,8 +446,8 @@ namespace O2.XRules.Database.APIs
var rawWiki = topPanel[0].add_TextArea();
var bottomPanel = topPanel[1].add_1x1x1("Pure Html", "Browser (pure html View)", "Browser (view using site's Styles)");
var htmlViewer = bottomPanel[0].add_RichTextBox();
- var browserSimple = bottomPanel[1].add_Browser();
- var browserWithSyles = bottomPanel[2].add_Browser();
+ var browserSimple = bottomPanel[1].add_WebBrowser();
+ var browserWithSyles = bottomPanel[2].add_WebBrowser();
Action<string> processWikiText =
(wikiText)=>{
View
484 APIs/MediaWiki/MediaWiki_GuiControls/ascx_MediaWiki_Backup.cs
@@ -1,243 +1,243 @@
-// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using System.Text;
-using O2.Kernel;
-using O2.Kernel.ExtensionMethods;
-using O2.DotNetWrappers.Network;
-using O2.DotNetWrappers.DotNet;
-using O2.DotNetWrappers.Windows;
-using O2.DotNetWrappers.ExtensionMethods;
-using O2.Views.ASCX.classes.MainGUI;
-using O2.Views.ASCX.ExtensionMethods;
-using O2.Views.ASCX.CoreControls;
-
-//O2File:O2MediaWikiApi.cs
-
-
-namespace O2.XRules.Database.APIs
-{
- public class ascx_MediaWiki_Backup : Control
- {
- public O2MediaWikiAPI WikiApi {get ; set;}
-
- public TextBox BackupFolder_TextBox { get; set; }
- public ascx_Directory Backup_Directory { get; set; }
- public Button StartBackup_Button { get; set; }
- public Button CancelBackup_Button { get; set; }
- public CheckBox BackupPages_CheckBox { get; set; }
- public CheckBox BackupFiles_CheckBox { get; set; }
- public CheckBox BackupCategoryPages_CheckBox { get; set; }
- public CheckBox BackupTemplates_CheckBox { get; set; }
- public CheckBox BackupUsers_CheckBox { get; set; }
-
- public ProgressBar Status_ProgressBar { get; set; }
-
- public bool CancelBackup { get; set;}
-
- //public static void launchGui()
- //{
- // O2Gui.open<ascx_MediaWiki_Backup>("MediaWiki backup", 500,500).buildGui(new O2MediaWikiAPI());
- //}
-
- public ascx_MediaWiki_Backup()
- {
- }
-
- public ascx_MediaWiki_Backup(O2MediaWikiAPI wikiApi)
- {
- buildGui(wikiApi);
- }
-
-
- public ascx_MediaWiki_Backup buildGui(O2MediaWikiAPI wikiApi)
- {
- WikiApi = wikiApi;
-
- //var controls = this.add_1x1(false);
- //var configPanel = controls[0].add_Panel();
- //controls[1].add_LogViewer();
- var configPanel = this.add_Panel();
- configPanel.add_Label("Folder to store backup files",5,0);
- BackupFolder_TextBox = configPanel.add_TextBox().top(25);
- BackupFolder_TextBox.align_Right(configPanel)
- .widthAdd(-5);
-
- BackupPages_CheckBox = configPanel.add_CheckBox("Backup content pages", 50, 0, (value)=>{}).autoSize().tick();
- BackupFiles_CheckBox = configPanel.add_CheckBox("Backup files", 70, 0,(value)=>{}).autoSize().untick();
- BackupCategoryPages_CheckBox = configPanel.add_CheckBox("Backup category Pages", 90, 0,(value)=>{}).autoSize().tick();
- BackupTemplates_CheckBox = configPanel.add_CheckBox("Backup template pages", 110, 0,(value)=>{}).autoSize().tick();
- BackupUsers_CheckBox = configPanel.add_CheckBox("Backup users pages", 50, 150,(value)=>{}).autoSize().tick();
-
- StartBackup_Button = configPanel.add_Button("Start Backup",140,0)
- .onClick(backup);
- CancelBackup_Button = configPanel.add_Button("Cancel Backup",140,100)
- .onClick(cancelBackup).enabled(false);
-
- Status_ProgressBar = configPanel.add_ProgressBar(170,0);
- Status_ProgressBar.align_Right(configPanel)
- .widthAdd(-5);
-
- var rightPanel = configPanel.insert_Right<Panel>(configPanel.width()/3); // there is a small gui frezee here which needs to be solved
- Backup_Directory = rightPanel.add_Directory(@"C:\O2");
-
- setup();
-
- return this;
- }
-
- public void setup()
- {
- var backupFolder = @"C:\O2\_USERDATA\WikiBackup".pathCombine(WikiApi.typeName())
- .pathCombine(Files.getFileSaveDateTime_Now());
- BackupFolder_TextBox.set_Text(backupFolder);
-
- }
-
- public void backup()
- {
- O2Thread.mtaThread(
- ()=>{
- StartBackup_Button.enabled(false);
- CancelBackup_Button.enabled(true);
- CancelBackup = false;
-
- backup(BackupFolder_TextBox.get_Text(),
- BackupPages_CheckBox.value(),
- BackupFiles_CheckBox.value(),
- BackupCategoryPages_CheckBox.value(),
- BackupTemplates_CheckBox.value(),
- BackupUsers_CheckBox.value());
-
- StartBackup_Button.enabled(true);
- CancelBackup_Button.enabled(false);
- });
- }
-
- public void cancelBackup()
- {
- "Canceling MediaWik Backup".error();
- CancelBackup = true;
- }
- public void backup(string backupFolder, bool backupPages, bool backupFiles, bool backupCategoryPages, bool backupTemplates, bool backupUsers)
- {
- var o2Timer = new O2Timer("Backed up Wiki in").start();
- Backup_Directory.open(backupFolder);
- if (backupPages && CancelBackup.isFalse())
- backup_Pages(backupFolder);
- if (backupFiles && CancelBackup.isFalse())
- backup_Files(backupFolder);
- if (backupCategoryPages && CancelBackup.isFalse())
- backup_CategoryPages(backupFolder);
- if (backupTemplates && CancelBackup.isFalse())
- backup_Templates(backupFolder);
- if (backupUsers && CancelBackup.isFalse())
- backup_Users(backupFolder);
- //backupFolder.createDir();
- o2Timer.stop();
- }
-
- public void backup_Pages(string backupFolder)
- {
-
- var pages_BackupFolder = backupFolder.pathCombine("Pages");
- pages_BackupFolder.createDir();
-
- var categories = WikiApi.pages();
- savePages(backupFolder, pages_BackupFolder,categories, "pagesMappings.txt");
-
-
- /*var pages_BackupFolder = backupFolder.pathCombine("Pages");
- pages_BackupFolder.createDir();
-
- string pageMappings = "";
-
- // backup pages
- var pages = WikiApi.pages();
- "there are: {0} pages to backup".info(pages.size());
- foreach(var page in pages)
- {
- pageMappings += "{0} {1}".format(page, page.base64Encode()).line();
- var saveFileName = "{0}.wikitext.txt".format(Files.getSafeFileNameString(page));
- WikiApi.raw(page).saveAs(pages_BackupFolder.pathCombine(saveFileName));
- }
- pageMappings.saveAs(backupFolder.pathCombine("pagesMappings.txt")); */
- }
-
-
- public void backup_Files(string backupFolder)
- {
- var files_BackupFolder = backupFolder.pathCombine("Files");
- files_BackupFolder.createDir();
-
- var files = WikiApi.allImages();
- "there are {0} files to download".info(files.size());
- Status_ProgressBar.maximum(files.size());
- Status_ProgressBar.value(0);
- foreach(var file in files)
- {
- if (CancelBackup)
- {
- "In backup_Files, CancelBackup was set, so aborting backup".error();
- break;
- }
- var web = new Web();
- if (WikiApi.BasicAuth.valid())
- web.Headers_Request.add("Authorization","Basic " + WikiApi.BasicAuth);
- web.downloadBinaryFile(file, files_BackupFolder);
- Status_ProgressBar.increment(1);
- }
-
- }
-
- public void backup_CategoryPages(string backupFolder)
- {
- var categories_BackupFolder = backupFolder.pathCombine("Categories");
- categories_BackupFolder.createDir();
-
- var categories = WikiApi.categoryPages();
- savePages(backupFolder, categories_BackupFolder,categories, "categoryPagesMappings.txt");
- }
-
- public void backup_Templates(string backupFolder)
- {
- var templates_BackupFolder = backupFolder.pathCombine("Templates");
- templates_BackupFolder.createDir();
-
- var categories = WikiApi.templatePages();
- savePages(backupFolder, templates_BackupFolder,categories, "templatePagesMappings.txt");
- }
-
- public void backup_Users(string backupFolder)
- {
- var templates_BackupFolder = backupFolder.pathCombine("Users");
- templates_BackupFolder.createDir();
-
- var categories = WikiApi.userPages();
- savePages(backupFolder, templates_BackupFolder,categories, "userPagesMappings.txt");
- }
-
- public void savePages(string backupFolder, string targetFolder, List<string> pages, string mappingsFileName)
- {
- string pageMappings = "";
- "there are: {0} pages to save".info(pages.size());
- Status_ProgressBar.maximum(pages.size());
- Status_ProgressBar.value(0);
- foreach(var page in pages)
- {
- if (CancelBackup)
- {
- "In savePages, CancelBackup was set, so aborting backup".error();
- break;
- }
- pageMappings += "{0} {1}".format(page, page.base64Encode()).line();
- var saveFileName = "{0}.wikitext.txt".format(Files.getSafeFileNameString(page));
- WikiApi.raw(page).saveAs(targetFolder.pathCombine(saveFileName));
- Status_ProgressBar.increment(1);
- }
- pageMappings.saveAs(backupFolder.pathCombine(mappingsFileName));
- }
- }
+// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using System.Text;
+using O2.Kernel;
+using O2.Kernel.ExtensionMethods;
+using O2.DotNetWrappers.Network;
+using O2.DotNetWrappers.DotNet;
+using O2.DotNetWrappers.Windows;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.Views.ASCX.classes.MainGUI;
+using O2.Views.ASCX.ExtensionMethods;
+using O2.Views.ASCX.CoreControls;
+
+//O2File:O2MediaWikiApi.cs
+
+
+namespace O2.XRules.Database.APIs
+{
+ public class ascx_MediaWiki_Backup : Control
+ {
+ public O2MediaWikiAPI WikiApi {get ; set;}
+
+ public TextBox BackupFolder_TextBox { get; set; }
+ public ascx_Directory Backup_Directory { get; set; }
+ public Button StartBackup_Button { get; set; }
+ public Button CancelBackup_Button { get; set; }
+ public CheckBox BackupPages_CheckBox { get; set; }
+ public CheckBox BackupFiles_CheckBox { get; set; }
+ public CheckBox BackupCategoryPages_CheckBox { get; set; }
+ public CheckBox BackupTemplates_CheckBox { get; set; }
+ public CheckBox BackupUsers_CheckBox { get; set; }
+
+ public ProgressBar Status_ProgressBar { get; set; }
+
+ public bool CancelBackup { get; set;}
+
+ //public static void launchGui()
+ //{
+ // O2Gui.open<ascx_MediaWiki_Backup>("MediaWiki backup", 500,500).buildGui(new O2MediaWikiAPI());
+ //}
+
+ public ascx_MediaWiki_Backup()
+ {
+ }
+
+ public ascx_MediaWiki_Backup(O2MediaWikiAPI wikiApi)
+ {
+ buildGui(wikiApi);
+ }
+
+
+ public ascx_MediaWiki_Backup buildGui(O2MediaWikiAPI wikiApi)
+ {
+ WikiApi = wikiApi;
+
+ //var controls = this.add_1x1(false);
+ //var configPanel = controls[0].add_Panel();
+ //controls[1].add_LogViewer();
+ var configPanel = this.add_Panel();
+ configPanel.add_Label("Folder to store backup files",5,0);
+ BackupFolder_TextBox = configPanel.add_TextBox().top(25);
+ BackupFolder_TextBox.align_Right(configPanel)
+ .widthAdd(-5);
+
+ BackupPages_CheckBox = configPanel.add_CheckBox("Backup content pages", 50, 0, (value)=>{}).autoSize().tick();
+ BackupFiles_CheckBox = configPanel.add_CheckBox("Backup files", 70, 0,(value)=>{}).autoSize().untick();
+ BackupCategoryPages_CheckBox = configPanel.add_CheckBox("Backup category Pages", 90, 0,(value)=>{}).autoSize().tick();
+ BackupTemplates_CheckBox = configPanel.add_CheckBox("Backup template pages", 110, 0,(value)=>{}).autoSize().tick();
+ BackupUsers_CheckBox = configPanel.add_CheckBox("Backup users pages", 50, 150,(value)=>{}).autoSize().tick();
+
+ StartBackup_Button = configPanel.add_Button("Start Backup",140,0)
+ .onClick(backup);
+ CancelBackup_Button = configPanel.add_Button("Cancel Backup",140,100)
+ .onClick(cancelBackup).enabled(false);
+
+ Status_ProgressBar = configPanel.add_ProgressBar(170,0);
+ Status_ProgressBar.align_Right(configPanel)
+ .widthAdd(-5);
+
+ var rightPanel = configPanel.insert_Right<Panel>(configPanel.width()/3); // there is a small gui frezee here which needs to be solved
+ Backup_Directory = rightPanel.add_Directory(@"C:\O2");
+
+ setup();
+
+ return this;
+ }
+
+ public void setup()
+ {
+ var backupFolder = @"C:\O2\_USERDATA\WikiBackup".pathCombine(WikiApi.typeName())
+ .pathCombine(Files.getFileSaveDateTime_Now());
+ BackupFolder_TextBox.set_Text(backupFolder);
+
+ }
+
+ public void backup()
+ {
+ O2Thread.mtaThread(
+ ()=>{
+ StartBackup_Button.enabled(false);
+ CancelBackup_Button.enabled(true);
+ CancelBackup = false;
+
+ backup(BackupFolder_TextBox.get_Text(),
+ BackupPages_CheckBox.value(),
+ BackupFiles_CheckBox.value(),
+ BackupCategoryPages_CheckBox.value(),
+ BackupTemplates_CheckBox.value(),
+ BackupUsers_CheckBox.value());
+
+ StartBackup_Button.enabled(true);
+ CancelBackup_Button.enabled(false);
+ });
+ }
+
+ public void cancelBackup()
+ {
+ "Canceling MediaWik Backup".error();
+ CancelBackup = true;
+ }
+ public void backup(string backupFolder, bool backupPages, bool backupFiles, bool backupCategoryPages, bool backupTemplates, bool backupUsers)
+ {
+ var o2Timer = new O2Timer("Backed up Wiki in").start();
+ Backup_Directory.open(backupFolder);
+ if (backupPages && CancelBackup.isFalse())
+ backup_Pages(backupFolder);
+ if (backupFiles && CancelBackup.isFalse())
+ backup_Files(backupFolder);
+ if (backupCategoryPages && CancelBackup.isFalse())
+ backup_CategoryPages(backupFolder);
+ if (backupTemplates && CancelBackup.isFalse())
+ backup_Templates(backupFolder);
+ if (backupUsers && CancelBackup.isFalse())
+ backup_Users(backupFolder);
+ //backupFolder.createDir();
+ o2Timer.stop();
+ }
+
+ public void backup_Pages(string backupFolder)
+ {
+
+ var pages_BackupFolder = backupFolder.pathCombine("Pages");
+ pages_BackupFolder.createDir();
+
+ var categories = WikiApi.pages();
+ savePages(backupFolder, pages_BackupFolder,categories, "pagesMappings.txt");
+
+
+ /*var pages_BackupFolder = backupFolder.pathCombine("Pages");
+ pages_BackupFolder.createDir();
+
+ string pageMappings = "";
+
+ // backup pages
+ var pages = WikiApi.pages();
+ "there are: {0} pages to backup".info(pages.size());
+ foreach(var page in pages)
+ {
+ pageMappings += "{0} {1}".format(page, page.base64Encode()).line();
+ var saveFileName = "{0}.wikitext.txt".format(Files.getSafeFileNameString(page));
+ WikiApi.raw(page).saveAs(pages_BackupFolder.pathCombine(saveFileName));
+ }
+ pageMappings.saveAs(backupFolder.pathCombine("pagesMappings.txt")); */
+ }
+
+
+ public void backup_Files(string backupFolder)
+ {
+ var files_BackupFolder = backupFolder.pathCombine("Files");
+ files_BackupFolder.createDir();
+
+ var files = WikiApi.allImages();
+ "there are {0} files to download".info(files.size());
+ Status_ProgressBar.maximum(files.size());
+ Status_ProgressBar.value(0);
+ foreach(var file in files)
+ {
+ if (CancelBackup)
+ {
+ "In backup_Files, CancelBackup was set, so aborting backup".error();
+ break;
+ }
+ var web = new Web();
+ if (WikiApi.BasicAuth.valid())
+ web.Headers_Request.add("Authorization","Basic " + WikiApi.BasicAuth);
+ web.downloadBinaryFile(file, files_BackupFolder);
+ Status_ProgressBar.increment(1);
+ }
+
+ }
+
+ public void backup_CategoryPages(string backupFolder)
+ {
+ var categories_BackupFolder = backupFolder.pathCombine("Categories");
+ categories_BackupFolder.createDir();
+
+ var categories = WikiApi.categoryPages();
+ savePages(backupFolder, categories_BackupFolder,categories, "categoryPagesMappings.txt");
+ }
+
+ public void backup_Templates(string backupFolder)
+ {
+ var templates_BackupFolder = backupFolder.pathCombine("Templates");
+ templates_BackupFolder.createDir();
+
+ var categories = WikiApi.templatePages();
+ savePages(backupFolder, templates_BackupFolder,categories, "templatePagesMappings.txt");
+ }
+
+ public void backup_Users(string backupFolder)
+ {
+ var templates_BackupFolder = backupFolder.pathCombine("Users");
+ templates_BackupFolder.createDir();
+
+ var categories = WikiApi.userPages();
+ savePages(backupFolder, templates_BackupFolder,categories, "userPagesMappings.txt");
+ }
+
+ public void savePages(string backupFolder, string targetFolder, List<string> pages, string mappingsFileName)
+ {
+ string pageMappings = "";
+ "there are: {0} pages to save".info(pages.size());
+ Status_ProgressBar.maximum(pages.size());
+ Status_ProgressBar.value(0);
+ foreach(var page in pages)
+ {
+ if (CancelBackup)
+ {
+ "In savePages, CancelBackup was set, so aborting backup".error();
+ break;
+ }
+ pageMappings += "{0} {1}".format(page, page.base64Encode()).line();
+ var saveFileName = "{0}.wikitext.txt".format(Files.getSafeFileNameString(page));
+ WikiApi.raw(page).saveAs(targetFolder.pathCombine(saveFileName));
+ Status_ProgressBar.increment(1);
+ }
+ pageMappings.saveAs(backupFolder.pathCombine(mappingsFileName));
+ }
+ }
}
View
748 APIs/MediaWiki/MediaWiki_GuiControls/ascx_MediaWiki_PageEditor_Simple.cs
@@ -1,375 +1,373 @@
-// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-using System;
-using System.Drawing;
-using System.Linq;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using System.Text;
-using O2.Kernel;
-using O2.Kernel.ExtensionMethods;
-using O2.DotNetWrappers.Network;
-using O2.DotNetWrappers.DotNet;
-using O2.DotNetWrappers.Windows;
-using O2.DotNetWrappers.ExtensionMethods;
-using O2.Views.ASCX.classes.MainGUI;
-using O2.Views.ASCX.ExtensionMethods;
-using O2.Views.ASCX.CoreControls;
-using O2.External.IE.ExtensionMethods;
-using O2.External.IE.Wrapper;
-using O2.XRules.Database.Utils;
-//O2File:O2PlatformWikiAPI.cs
-//O2File:O2MediaWikiApi.cs
-//O2File:ascx_AskUserForLoginDetails.cs
-
-//O2Ref:O2_External_IE.dll
-
-namespace O2.XRules.Database.APIs
-{
- public class ascx_MediaWiki_PageEditor_Simple : Control
- {
- public O2MediaWikiAPI WikiApi { get; set; }
-
- public TextBox WikiPage_TextBox {get; set;}
-
- public RichTextBox WikiTextEditor { get; set; }
- public O2BrowserIE BrowserPreview { get; set; }
- public O2BrowserIE BrowserCurrent { get; set; }
- public ComboBox CurrentPageUrl { get; set; }
- public Button SaveButton { get; set; }
- public Label StatusLabel { get; set; }
- public ComboBox RecentChangesComboBox { get; set; }
-
- public static void lauchGui()
- {
- var pageEditor = O2Gui.open<ascx_MediaWiki_PageEditor_Simple>("MediaWiki Page Editor", 500,500)
- .buildGui(new O2PlatformWikiAPI());
- pageEditor.openPage("Main_Page");
- }
-
- public ascx_MediaWiki_PageEditor_Simple()
- {
-
- }
-
- public ascx_MediaWiki_PageEditor_Simple(O2MediaWikiAPI wikiApi)
- {
- buildGui(wikiApi);
- }
-
-
- public ascx_MediaWiki_PageEditor_Simple buildGui(O2MediaWikiAPI wikiApi)
- {
- try
- {
- WikiApi = wikiApi;
-
-
- var topPanel = this.add_Panel();
-
-
- var horizontalSplitterPosition = topPanel.height()/2;
- var verticalSplitterPosition = topPanel.width()/2;
- var controls = topPanel.add_1x2("WikiText","Preview","Live (Current page)",false,horizontalSplitterPosition,verticalSplitterPosition);
- WikiTextEditor = controls[0].add_RichTextBox();
- BrowserPreview = controls[1].add_Browser();
- BrowserCurrent = controls[2].add_Browser();
-
- WikiPage_TextBox = WikiTextEditor.insert_Above<TextBox>(50);
- var bottomPanel = WikiPage_TextBox.insert_Below<Panel>(30);
-
- RecentChangesComboBox = WikiPage_TextBox.insert_Right<Panel>(290)
- .add_Label("Recent Changes / Search")
- .top(3)
- .append_Control<ComboBox>()
- //.dropDownList()
- .width(150)
- .top(0);
- Action<string> populateRecentChangesComboBox =
- (filter) => {
- RecentChangesComboBox.backColor(Color.LightPink);
- O2Thread.mtaThread(
- ()=>{
- RecentChangesComboBox.clear();
- if (filter.valid().isFalse())
- RecentChangesComboBox.add_Items(WikiApi.recentPages());
- else
- RecentChangesComboBox.add_Items(WikiApi.pages(filter));
- RecentChangesComboBox.backColor(Color.White);
- });
- };
- RecentChangesComboBox.onSelection(
- ()=>{
- WikiPage_TextBox.set_Text(RecentChangesComboBox.get_Text());
- loadCurrentPage();
- });
- RecentChangesComboBox.onEnter(
- (text)=>{