Skip to content

Commit

Permalink
merged rev. 308-283 from branches/plugin-architecture (branch re-inte…
Browse files Browse the repository at this point in the history
…gration) since we have made a lot of good progress on the plugin architecture and are ready to accept it into the main development line.
  • Loading branch information
stephen.swensen committed Jul 6, 2012
1 parent 9226d43 commit 6ef35b9
Show file tree
Hide file tree
Showing 20 changed files with 609 additions and 68 deletions.
3 changes: 2 additions & 1 deletion Debug.FsEye/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ open System.Windows.Forms
module Main =
let initEye() =
let eye = new Swensen.FsEye.Forms.WatchForm()
eye.Closing.Add(fun x -> x.Cancel <- false) //undo the close supression that the watch form otherwise tries to undertake.
eye.Watch("x", 3)
eye.Watch("y", [1;2;3;4;5;6;7])
eye.Watch("y", new System.Collections.Generic.List<int>(Seq.init 200 id))
eye


Expand Down
39 changes: 39 additions & 0 deletions FsEye.PropertyGrid.Plugin/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
namespace FsEye.PropertyGrid.Plugin

open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices

// 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("FsEye.PropertyGrid.Plugin")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("Microsoft")>]
[<assembly: AssemblyProduct("FsEye.PropertyGrid.Plugin")>]
[<assembly: AssemblyCopyright("Copyright © Microsoft 2011")>]
[<assembly: AssemblyTrademark("")>]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[<assembly: ComVisible(false)>]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[<assembly: Guid("02476582-997c-4780-859a-e81188e8339b")>]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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("1.0.0.0")>]
[<assembly: AssemblyFileVersion("1.0.0.0")>]

()
68 changes: 68 additions & 0 deletions FsEye.PropertyGrid.Plugin/FsEye.PropertyGrid.Plugin.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1f9b8cb8-8c0c-424c-9035-6562b637a233}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>FsEye.PropertyGrid.Plugin</RootNamespace>
<AssemblyName>FsEye.PropertyGrid.Plugin</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<Name>FsEye.PropertyGrid.Plugin</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\Debug\plugins</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<DocumentationFile>bin\Debug\FsEye.PropertyGrid.Plugin.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\plugins</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<DocumentationFile>bin\Release\FsEye.PropertyGrid.Plugin.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Numerics" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="PropertyGridPlugin.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FsEye\FsEye.fsproj">
<Name>FsEye</Name>
<Project>{20de2466-d7b1-4f72-b8f8-51f10f5f186e}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets" Condition="!Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
22 changes: 22 additions & 0 deletions FsEye.PropertyGrid.Plugin/PropertyGridPlugin.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace Swensen.FsEye.Plugins

open Swensen.FsEye
open System.Windows.Forms

///A PropertyGrid-based watch viewer
type PropertyGridWatchViewer() =
inherit PropertyGrid()
interface IWatchViewer with
///Set or refresh the PropertyGride SelectedObject with the given value (the label and type are not currently used).
member this.Watch(_, value, _) =
this.SelectedObject <- value
///Get the underlying Control of this watch view
member this.Control = this :> Control

///A Plugin that creates PropertyGridWatchViewers
type PropertyGridPlugin() =
interface IPlugin with
member __.Name = "Property Grid"
member __.Version = "1.0"
///Create a new instance of a PropertyGridWatchViewer
member __.CreateWatchViewer() = new PropertyGridWatchViewer() :> IWatchViewer
39 changes: 39 additions & 0 deletions FsEye.TreeView.Plugin/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
namespace FsEye.TreeView.Plugin

open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices

// 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("FsEye.TreeView.Plugin")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("Microsoft")>]
[<assembly: AssemblyProduct("FsEye.TreeView.Plugin")>]
[<assembly: AssemblyCopyright("Copyright © Microsoft 2011")>]
[<assembly: AssemblyTrademark("")>]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[<assembly: ComVisible(false)>]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[<assembly: Guid("d538e069-c83a-4b4b-b59c-bc0ef947290b")>]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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("1.0.0.0")>]
[<assembly: AssemblyFileVersion("1.0.0.0")>]

()
68 changes: 68 additions & 0 deletions FsEye.TreeView.Plugin/FsEye.TreeView.Plugin.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{669bc59d-958a-4096-affe-7776cf68b46e}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>FsEye.TreeView.Plugin</RootNamespace>
<AssemblyName>FsEye.TreeView.Plugin</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<Name>FsEye.TreeView.Plugin</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\Debug\plugins</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<DocumentationFile>bin\Debug\FsEye.TreeView.Plugin.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\plugins</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<DocumentationFile>bin\Release\FsEye.TreeView.Plugin.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Numerics" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="TreeViewPlugin.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FsEye\FsEye.fsproj">
<Name>FsEye</Name>
<Project>{20de2466-d7b1-4f72-b8f8-51f10f5f186e}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets" Condition="!Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
19 changes: 19 additions & 0 deletions FsEye.TreeView.Plugin/TreeViewPlugin.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace Swensen.FsEye.Plugins

open Swensen.FsEye
open Swensen.FsEye.Forms
open System.Windows.Forms

type TreeViewWatchViewer() =
let watchTreeView = new WatchTreeView()
interface IWatchViewer with
member this.Watch(label, value, ty) =
watchTreeView.Watch(label, value, ty)

member this.Control = watchTreeView :> Control

type TreeViewPlugin() =
interface IPlugin with
member this.Version = "1.0"
member this.Name = "Tree View"
member this.CreateWatchViewer() = new TreeViewWatchViewer() :> IWatchViewer
24 changes: 24 additions & 0 deletions FsEye.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{AB9395
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Debug.FsEye", "Debug.FsEye\Debug.FsEye.fsproj", "{FD9691CC-8069-4C02-B3B6-F990FBD6114D}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsEye.TreeView.Plugin", "FsEye.TreeView.Plugin\FsEye.TreeView.Plugin.fsproj", "{669BC59D-958A-4096-AFFE-7776CF68B46E}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsEye.PropertyGrid.Plugin", "FsEye.PropertyGrid.Plugin\FsEye.PropertyGrid.Plugin.fsproj", "{1F9B8CB8-8C0C-424C-9035-6562B637A233}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -65,6 +69,26 @@ Global
{FD9691CC-8069-4C02-B3B6-F990FBD6114D}.Release|Mixed Platforms.Build.0 = Release|x86
{FD9691CC-8069-4C02-B3B6-F990FBD6114D}.Release|x86.ActiveCfg = Release|x86
{FD9691CC-8069-4C02-B3B6-F990FBD6114D}.Release|x86.Build.0 = Release|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Debug|Any CPU.ActiveCfg = Debug|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Debug|Mixed Platforms.Build.0 = Debug|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Debug|x86.ActiveCfg = Debug|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Debug|x86.Build.0 = Debug|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Release|Any CPU.ActiveCfg = Release|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Release|Mixed Platforms.ActiveCfg = Release|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Release|Mixed Platforms.Build.0 = Release|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Release|x86.ActiveCfg = Release|x86
{669BC59D-958A-4096-AFFE-7776CF68B46E}.Release|x86.Build.0 = Release|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Debug|Any CPU.ActiveCfg = Debug|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Debug|Mixed Platforms.Build.0 = Debug|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Debug|x86.ActiveCfg = Debug|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Debug|x86.Build.0 = Debug|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Release|Any CPU.ActiveCfg = Release|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Release|Mixed Platforms.ActiveCfg = Release|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Release|Mixed Platforms.Build.0 = Release|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Release|x86.ActiveCfg = Release|x86
{1F9B8CB8-8C0C-424C-9035-6562B637A233}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions FsEye/Forms/WatchForm.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type WatchForm() as this =
let watchPanel = new WatchPanel(Dock=DockStyle.Fill)

do
//todo: this may be better added by the owning control...
///prevent form from disposing when closing
this.Closing.Add(fun args -> args.Cancel <- true ; this.Hide())
this.Controls.Add(watchPanel)
Expand Down
20 changes: 15 additions & 5 deletions FsEye/Forms/WatchPanel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,30 @@ limitations under the License.
namespace Swensen.FsEye.Forms
open System.Windows.Forms
open System.Reflection
open Swensen.FsEye

type WatchPanel() as this =
inherit Panel()
let treeView = new WatchTreeView(Dock=DockStyle.Fill)
inherit Panel()
let continueButton = new Button(Text="Async Continue", AutoSize=true, Enabled=false)
let asyncBreak = async {
let! _ = Async.AwaitEvent continueButton.Click
()
}

do
//must tree view (with dockstyle fill) first in order for it to be flush with button panel
let splitContainer = new SplitContainer(Dock=DockStyle.Fill, Orientation=Orientation.Vertical)
let tabControl = new TabControl(Dock=DockStyle.Fill)
let pluginManager = new PluginManager(tabControl)
let treeView = new WatchTreeView(Some(pluginManager), Dock=DockStyle.Fill)


do

splitContainer.Panel1.Controls.Add(treeView)
splitContainer.Panel2.Controls.Add(tabControl)

//must splitContainer (with dockstyle fill) first in order for it to be flush with button panel
//see: http://www.pcreview.co.uk/forums/setting-control-dock-fill-you-have-menustrip-t3240577.html
this.Controls.Add(treeView)
this.Controls.Add(splitContainer)
do
let buttonPanel = new FlowLayoutPanel(Dock=DockStyle.Top, AutoSize=true)
do
Expand Down
Loading

0 comments on commit 6ef35b9

Please sign in to comment.