Permalink
Browse files

Number of bug fixes, and major release of FluentSharp VisualStudio API

  • Loading branch information...
1 parent 2130a38 commit 0cc1ff974e7716e2c5d1e30169ddc8f0d9b754dd @DinisCruz DinisCruz committed Oct 1, 2012
Showing with 705 additions and 486 deletions.
  1. +2 −1 O2.FluentSharp.BCL/O2.FluentSharp.BCL.csproj
  2. +1 −4 O2.FluentSharp.BCL/O2.FluentSharp.BCL.nuspec
  3. +15 −3 O2.FluentSharp.BCL/O2_DotNetWrappers/ExtensionMethods/WinForms_ExtensionMethods_Form.cs
  4. +122 −0 O2.FluentSharp.BCL/O2_Views_ASCX/Ascx/REPL_Gui.cs
  5. +9 −9 O2.FluentSharp.BCL/Properties/AssemblyInfo.cs
  6. +2 −4 O2.FluentSharp.CoreLib/O2.FluentSharp.CoreLib.csproj
  7. +0 −19 O2.FluentSharp.CoreLib/O2.FluentSharp.CoreLib.nuspec
  8. +3 −1 O2.FluentSharp.CoreLib/O2ConfigSettings.cs
  9. +10 −64 O2.FluentSharp.CoreLib/O2_DotNetWrappers/DotNet/CompileEngine.cs
  10. +34 −0 O2.FluentSharp.CoreLib/O2_DotNetWrappers/DotNet/Utils.cs
  11. +6 −1 O2.FluentSharp.CoreLib/O2_DotNetWrappers/ExtensionMethods/Collections_ExtensionMethods.cs
  12. +76 −3 O2.FluentSharp.CoreLib/O2_DotNetWrappers/ExtensionMethods/CompileEngine_ExtensionMethods.cs
  13. +38 −24 O2.FluentSharp.CoreLib/O2_DotNetWrappers/ExtensionMethods/Items_ExtensionMethods.cs
  14. +3 −3 O2.FluentSharp.CoreLib/O2_Interfaces/O2Core/IO2Config.cs
  15. +37 −35 O2.FluentSharp.CoreLib/O2_Kernel/InterfacesBaseImpl/KO2Config.cs
  16. +6 −6 O2.FluentSharp.CoreLib/Properties/AssemblyInfo.cs
  17. 0 O2.FluentSharp.CoreLib/test.txt
  18. +8 −8 O2.FluentSharp.NGit/Properties/AssemblyInfo.cs
  19. +1 −1 O2.FluentSharp.REPL/O2.FluentSharp.REPL.csproj
  20. +7 −7 O2.FluentSharp.REPL/Properties/AssemblyInfo.cs
  21. +7 −7 O2.FluentSharp.Roslyn/Properties/AssemblyInfo.cs
  22. +1 −1 O2.FluentSharp.VisualStudio_2010/AddIn_Test.cs
  23. +1 −1 O2.FluentSharp.VisualStudio_2010/Controls/Control_WPF.xaml
  24. +1 −1 O2.FluentSharp.VisualStudio_2010/Controls/Control_WPF.xaml.cs
  25. +1 −1 O2.FluentSharp.VisualStudio_2010/Controls/Control_WinForms.xaml
  26. +1 −1 O2.FluentSharp.VisualStudio_2010/Controls/Control_WinForms.xaml.cs
  27. +1 −1 O2.FluentSharp.VisualStudio_2010/Controls/WindowPane_WPF.cs
  28. +1 −1 O2.FluentSharp.VisualStudio_2010/Controls/WindowPane_WinForms.cs
  29. +0 −154 O2.FluentSharp.VisualStudio_2010/ExtensionMethods/VS_Menus_ExtensionMethods.cs
  30. +6 −58 O2.FluentSharp.VisualStudio_2010/ExtensionMethods/VisualStudio_2010_ExtensionMethods.cs
  31. +9 −14 ...hods/{VS_ErrorListProvider_ExtensionMethods.cs → VisualStudio_2010_ExtensionMethods_ErrorList.cs}
  32. +3 −6 O2.FluentSharp.VisualStudio_2010/ExtensionMethods/VisualStudio_2010_ExtensionMethods_IVsUIShell.cs
  33. +151 −0 O2.FluentSharp.VisualStudio_2010/ExtensionMethods/VisualStudio_2010_ExtensionMethods_Menus.cs
  34. +102 −0 ...luentSharp.VisualStudio_2010/ExtensionMethods/VisualStudio_2010_ExtensionMethods_Multiple_Guis.cs
  35. +3 −3 O2.FluentSharp.VisualStudio_2010/NoSolution_Package.cs
  36. +11 −18 O2.FluentSharp.VisualStudio_2010/O2.FluentSharp.VisualStudio_2010.csproj
  37. +1 −1 O2.FluentSharp.VisualStudio_2010/Packages/Package_IWpfTextViewCreationListener.cs
  38. +1 −1 O2.FluentSharp.VisualStudio_2010/Packages/Package_IWpfTextViewMarginProvider.cs
  39. +7 −7 O2.FluentSharp.VisualStudio_2010/Properties/AssemblyInfo.cs
  40. +1 −1 O2.FluentSharp.VisualStudio_2010/VisualStudio_2010.cs
  41. +8 −7 O2.FluentSharp.VisualStudio_2010/VisualStudio_O2_Utils.cs
  42. +1 −2 O2.FluentSharp.WPF/O2.FluentSharp.WPF.csproj
  43. +7 −7 O2.FluentSharp.WPF/Properties/AssemblyInfo.cs
@@ -18,7 +18,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>bin\debug\</OutputPath>
+ <OutputPath>..\..\O2_Platform_ReferencedAssemblies\O2_Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -237,6 +237,7 @@
<Compile Include="O2_Views_ASCX\Ascx\O2Findings\ascx_TraceTreeView.Designer.cs">
<DependentUpon>ascx_TraceTreeView.cs</DependentUpon>
</Compile>
+ <Compile Include="O2_Views_ASCX\Ascx\REPL_Gui.cs" />
<Compile Include="O2_Views_ASCX\Ascx\Tasks\ascx_SimpleTaskGui.cs">
<SubType>Component</SubType>
</Compile>
@@ -18,8 +18,5 @@
<dependencies>
<dependency id="FluentSharp.CoreLib" />
</dependencies>
- </metadata>
- <files>
- <file src="_External_Dlls\*.dll" target="lib\net40" />
- </files>
+ </metadata>
</package>
@@ -115,12 +115,24 @@ public static Panel showAsForm(this string title, int width, int height)
{
return O2Gui.open<Panel>(title, width, height);
}
-
- public static T showAsForm<T>(this string title) where T : Control
+ public static T openForm<T>(this string textToAppendToFormTitle) where T : Form
+ {
+ T form = null;
+ O2Thread.staThread(
+ () =>
+ {
+ form = (T)typeof(T).ctor();
+ form.Text += textToAppendToFormTitle.valid() ? " - {0}".format(textToAppendToFormTitle) : "";
+ form.ShowDialog();
+ });
+ Utils.waitForNotNull(ref form);
+ return form;
+ }
+ public static T showAsForm<T>(this string title) where T : Control
{
return title.showAsForm<T>(600, 400);
}
- public static T showAsForm<T>(this string title, int width, int height) where T : Control
+ public static T showAsForm<T>(this string title, int width, int height) where T : Control
{
return (T)O2Gui.open<T>(title, width, height)
.add_H2Icon();
@@ -0,0 +1,122 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Threading;
+using O2.DotNetWrappers.ExtensionMethods;
+using O2.DotNetWrappers.DotNet;
+using System.Drawing;
+using O2.Views.ASCX.DataViewers;
+
+namespace O2.XRules.Database.Utils
+{
+ public class REPL_Gui
+ {
+ public Panel TopPanel { get; set; }
+ public Panel Code_Panel { get; set; }
+ public Panel Output_Panel { get; set; }
+ public Button Execute_Button { get; set; }
+ public RichTextBox Output_View_RichTextBox { get; set; }
+ public Panel Output_View_Object { get; set; }
+ public Action Execute { get; set; }
+ public Thread ExecutionThread { get; set; }
+
+ public Action On_ExecuteCode { get; set; }
+
+ public REPL_Gui buildGui(Control targetControl)
+ {
+ try
+ {
+ TopPanel = targetControl.clear().add_Panel();
+
+ Code_Panel = TopPanel.insert_Left("Code");
+
+ Output_Panel = TopPanel.add_GroupBox("Invoke and Result")
+ .add_GroupBox("Output").add_Panel();
+ Execute_Button = Output_Panel.parent().insert_Above(60).add_Button("Execute").fill();
+ Execute_Button.insert_Below(20).add_Link("stop execution", () => this.stopCurrentExecution());
+ Output_View_RichTextBox = Output_Panel.add_RichTextBox();
+ Output_View_Object = Output_Panel.add_Panel();
+ //set actions
+
+ Execute_Button.onClick(
+ ()=>{
+ try
+ {
+ ExecutionThread = O2Thread.mtaThread(()=> On_ExecuteCode.invoke());
+ }
+ catch(Exception ex)
+ {
+ ex.log();
+ }
+ });
+ }
+ catch(Exception ex)
+ {
+ ex.log("[REPL_Gui] in buildGui");
+ }
+ return this;
+ }
+ }
+
+ public static class REPL_Gui_ExtensionMethods
+ {
+ public static REPL_Gui add_REPL_Gui(this Control targetControl)
+ {
+ return new REPL_Gui().buildGui(targetControl);
+ }
+
+
+ public static REPL_Gui stopCurrentExecution(this REPL_Gui replGui)
+ {
+ if (replGui.ExecutionThread.notNull() && replGui.ExecutionThread.IsAlive)
+ {
+ "ExecutionThread is alive, so stopping it".info();
+ replGui.ExecutionThread.Abort();
+ replGui.Output_View_RichTextBox.textColor(Color.Red).set_Text("...current thread stopped...");
+ }
+ return replGui;
+ }
+
+ public static REPL_Gui showErrorMessage(this REPL_Gui replGui, string msg)
+ {
+ replGui.Output_View_Object.visible(false);
+ replGui.Output_View_RichTextBox.visible(true).textColor(Color.Red)
+ .set_Text(msg);
+ return replGui;
+ }
+ public static REPL_Gui showOutput(this REPL_Gui replGui, object result)
+ {
+ var richTextBox = replGui.Output_View_RichTextBox;
+ var panel = replGui.Output_View_Object;
+ richTextBox.visible(false);
+ panel.visible(false).clear();
+
+ if (result == null)
+ result = "[null value]";
+
+ switch (result.typeName())
+ {
+ case "Boolean":
+ case "String":
+ case "Int64":
+ case "Int32":
+ case "Int16":
+ case "Byte":
+ richTextBox.visible(true).textColor(Color.Black)
+ .set_Text(result.str());
+ break;
+ case "Bitmap":
+ panel.visible(true).add_PictureBox()
+ .load((Bitmap)result);
+ break;
+ default:
+ panel.visible(true).add_Control<ascx_ShowInfo>()
+ .show(result);
+ break;
+ }
+ return replGui;
+ }
+ }
+}
@@ -4,13 +4,13 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("O2.Platform.BCL")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("O2.Platform.BCL")]
-[assembly: AssemblyCopyright("Copyright © 2012")]
+// associated with an assembly.
+[assembly: AssemblyTitle("FluentSharp - BCL")]
+[assembly: AssemblyDescription("FluentSharp is an API that dramatically simplifies the use of .NET Framework APIs. It makes extensive use of .NET ExtensionMethods and it reduces the amount of code required (while making it more readable)")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("O2 Platform")]
+[assembly: AssemblyProduct("FluentSharp")]
+[assembly: AssemblyCopyright("O2 Platform")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("4.1.1")]
-[assembly: AssemblyFileVersion("4.1.1")]
+[assembly: AssemblyVersion("4.4.0")]
+[assembly: AssemblyFileVersion("4.4.0")]
@@ -18,7 +18,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>bin\debug\</OutputPath>
+ <OutputPath>..\..\O2_Platform_ReferencedAssemblies\O2_Assemblies\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_4</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -59,6 +59,7 @@
<Compile Include="O2_DotNetWrappers\DotNet\Serialize.cs" />
<Compile Include="O2_DotNetWrappers\DotNet\StringsAndLists.cs" />
<Compile Include="O2_DotNetWrappers\DotNet\TypeConfusion.cs" />
+ <Compile Include="O2_DotNetWrappers\DotNet\Utils.cs" />
<Compile Include="O2_DotNetWrappers\DotNet\XmlHelpers.cs" />
<Compile Include="O2_DotNetWrappers\ExtensionMethods\AppDomain_ExtensionMethods.cs" />
<Compile Include="O2_DotNetWrappers\ExtensionMethods\Collections_ExtensionMethods.cs" />
@@ -206,9 +207,6 @@
<None Include="TmpKey.snk" />
</ItemGroup>
<ItemGroup>
- <None Include="O2.FluentSharp.CoreLib.nuspec">
- <SubType>Designer</SubType>
- </None>
<None Include="O2_DotNetWrappers\Xsd\SourceCodeMappings.xsd">
<SubType>Designer</SubType>
</None>
@@ -1,19 +0,0 @@
-<?xml version="1.0"?>
-<package >
- <metadata>
- <id>FluentSharp.CoreLib</id>
- <version>4.3.0.0</version>
- <title>Fluent# - CoreLib</title>
- <authors>O2 Platform</authors>
- <owners>O2 Platform</owners>
- <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
- <projectUrl>http://o2platform.com</projectUrl>
- <iconUrl>https://www.owasp.org/images/f/f5/O2_Logo_no_Shadow.jpg</iconUrl>
- <requireLicenseAcceptance>false</requireLicenseAcceptance>
- <summary>FluentSharp is an API that dramatically simplifies the use of .NET Framework APIs. It makes extensive use of .NET ExtensionMethods and it reduces the amount of code required (while making it more readable). By now, a large part of the .NET Framework is already covered by Fluent ExtensionMethods (String, Xml, IO, Reflection, etc..)</summary>
- <description>FluentSharp is an API that dramatically simplifies the use of .NET Framework APIs. As an example, the reflection wrapper is probably one of the most powerful .NET Reflection APIs, since it provides (via user-friendly methods) full access to all .NET classes, methods, properties, fields and enums (regardless of their public/private status).</description>
- <releaseNotes>Removed *.txt content files</releaseNotes>
- <copyright>Copyright 2012</copyright>
- <tags>Fluent OWASP O2Platform Security</tags>
- </metadata>
-</package>
@@ -2,12 +2,14 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Reflection;
+using O2.DotNetWrappers.ExtensionMethods;
namespace O2.Kernel
{
public class O2ConfigSettings
{
- public static string O2Version = "4_3";
+ public static string O2Version = Assembly.GetExecutingAssembly().version();
//public static string defaultLocalScriptFolder = @"C:\O2\O2Scripts_Database\_Scripts";
public static string defaultLocalScriptName = "O2.Platform.Scripts";
public static string defaultO2LocalTempName = @"_TempDir_v" + O2Version;
Oops, something went wrong.

0 comments on commit 0cc1ff9

Please sign in to comment.