0024699: Visualization - prototype interoperation of TKOpenGl viewer with Direct3D...
authordln <dln@opencascade.com>
Tue, 3 Jun 2014 06:11:33 +0000 (10:11 +0400)
committerbugmaster <bugmaster@opencascade.com>
Fri, 10 Oct 2014 11:06:42 +0000 (15:06 +0400)
Add new C# sample which allow to render the OCCT scene to a Direct3D context in a WPF application.
DirectX SDK is required in order to build this sample.

165 files changed:
dox/FILES_HTML.txt
dox/overview/overview.md
samples/CSharp/CSharp-vc10.sln [deleted file]
samples/CSharp/CSharp-vc9.sln [deleted file]
samples/CSharp/CSharp.sln [new file with mode: 0644]
samples/CSharp/CSharp_D3D.sln [new file with mode: 0644]
samples/CSharp/OCCTProxy/OCCTProxy.cpp
samples/CSharp/OCCTProxy/OCCTProxy.vcxproj
samples/CSharp/OCCTProxy_D3D/BridgeFBO.cxx [new file with mode: 0644]
samples/CSharp/OCCTProxy_D3D/BridgeFBO.hxx [new file with mode: 0644]
samples/CSharp/OCCTProxy_D3D/Direct3DProxy.cpp [new file with mode: 0644]
samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp [new file with mode: 0644]
samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcproj [new file with mode: 0644]
samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcxproj [new file with mode: 0644]
samples/CSharp/ReadMe.md
samples/CSharp/ReadMe_D3D.md [new file with mode: 0644]
samples/CSharp/WPF/About.xaml [deleted file]
samples/CSharp/WPF/About.xaml.cs [deleted file]
samples/CSharp/WPF/App.xaml [deleted file]
samples/CSharp/WPF/App.xaml.cs [deleted file]
samples/CSharp/WPF/IECommands.cs [deleted file]
samples/CSharp/WPF/IE_WPF.csproj [deleted file]
samples/CSharp/WPF/MainWindow.xaml [deleted file]
samples/CSharp/WPF/MainWindow.xaml.cs [deleted file]
samples/CSharp/WPF/MaterialDlg.xaml [deleted file]
samples/CSharp/WPF/MaterialDlg.xaml.cs [deleted file]
samples/CSharp/WPF/OCCViewer.cs [deleted file]
samples/CSharp/WPF/Properties/AssemblyInfo.cs [deleted file]
samples/CSharp/WPF/Properties/Resources.Designer.cs [deleted file]
samples/CSharp/WPF/Properties/Resources.resx [deleted file]
samples/CSharp/WPF/Properties/Settings.Designer.cs [deleted file]
samples/CSharp/WPF/Properties/Settings.settings [deleted file]
samples/CSharp/WPF/Simple Styles.xaml [deleted file]
samples/CSharp/WPF/TransparencyDialog.cs [deleted file]
samples/CSharp/WPF/TransparencyDialog.resx [deleted file]
samples/CSharp/WPF/app.config [deleted file]
samples/CSharp/WPF/res/MainFrame.ico [deleted file]
samples/CSharp/WPF/res/document.png [deleted file]
samples/CSharp/WPF/res/help.png [deleted file]
samples/CSharp/WPF/res/lamp.png [deleted file]
samples/CSharp/WPF/res/new.png [deleted file]
samples/CSharp/WPF/res/occ_logo.bmp [deleted file]
samples/CSharp/WPF/res/tool_color.png [deleted file]
samples/CSharp/WPF/res/tool_delete.png [deleted file]
samples/CSharp/WPF/res/tool_material.png [deleted file]
samples/CSharp/WPF/res/tool_shading.png [deleted file]
samples/CSharp/WPF/res/tool_transparency.png [deleted file]
samples/CSharp/WPF/res/tool_wireframe.png [deleted file]
samples/CSharp/WPF/res/view_axo.png [deleted file]
samples/CSharp/WPF/res/view_back.png [deleted file]
samples/CSharp/WPF/res/view_bottom.png [deleted file]
samples/CSharp/WPF/res/view_comp_off.png [deleted file]
samples/CSharp/WPF/res/view_comp_on.png [deleted file]
samples/CSharp/WPF/res/view_fitall.png [deleted file]
samples/CSharp/WPF/res/view_fitarea.png [deleted file]
samples/CSharp/WPF/res/view_front.png [deleted file]
samples/CSharp/WPF/res/view_glpan.png [deleted file]
samples/CSharp/WPF/res/view_left.png [deleted file]
samples/CSharp/WPF/res/view_pan.png [deleted file]
samples/CSharp/WPF/res/view_reset.png [deleted file]
samples/CSharp/WPF/res/view_right.png [deleted file]
samples/CSharp/WPF/res/view_rotate.png [deleted file]
samples/CSharp/WPF/res/view_top.png [deleted file]
samples/CSharp/WPF/res/view_zoom.png [deleted file]
samples/CSharp/WPF_D3D/About.xaml [new file with mode: 0644]
samples/CSharp/WPF_D3D/About.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/App.xaml [new file with mode: 0644]
samples/CSharp/WPF_D3D/App.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/D3DViewer.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/IECommands.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/IE_WPF_D3D.csproj [new file with mode: 0644]
samples/CSharp/WPF_D3D/MainWindow.xaml [new file with mode: 0644]
samples/CSharp/WPF_D3D/MainWindow.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/MaterialDlg.xaml [new file with mode: 0644]
samples/CSharp/WPF_D3D/MaterialDlg.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/OCCViewer.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/Properties/AssemblyInfo.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/Properties/Resources.Designer.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/Properties/Resources.resx [new file with mode: 0644]
samples/CSharp/WPF_D3D/Properties/Settings.Designer.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/Properties/Settings.settings [new file with mode: 0644]
samples/CSharp/WPF_D3D/Simple Styles.xaml [new file with mode: 0644]
samples/CSharp/WPF_D3D/TransparencyDialog.cs [new file with mode: 0644]
samples/CSharp/WPF_D3D/TransparencyDialog.resx [new file with mode: 0644]
samples/CSharp/WPF_D3D/app.config [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/MainFrame.ico [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/document.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/help.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/lamp.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/new.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/occ_logo.bmp [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/tool_color.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/tool_delete.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/tool_material.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/tool_shading.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/tool_transparency.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/tool_wireframe.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_axo.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_back.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_bottom.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_comp_off.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_comp_on.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_fitall.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_fitarea.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_front.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_glpan.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_left.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_pan.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_reset.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_right.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_rotate.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_top.png [new file with mode: 0644]
samples/CSharp/WPF_D3D/res/view_zoom.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/About.xaml [new file with mode: 0644]
samples/CSharp/WPF_WinForms/About.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/App.xaml [new file with mode: 0644]
samples/CSharp/WPF_WinForms/App.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/IECommands.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/IE_WPF_WinForms.csproj [new file with mode: 0644]
samples/CSharp/WPF_WinForms/MainWindow.xaml [new file with mode: 0644]
samples/CSharp/WPF_WinForms/MainWindow.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/MaterialDlg.xaml [new file with mode: 0644]
samples/CSharp/WPF_WinForms/MaterialDlg.xaml.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/OCCViewer.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/Properties/AssemblyInfo.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/Properties/Resources.Designer.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/Properties/Resources.resx [new file with mode: 0644]
samples/CSharp/WPF_WinForms/Properties/Settings.Designer.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/Properties/Settings.settings [new file with mode: 0644]
samples/CSharp/WPF_WinForms/Simple Styles.xaml [new file with mode: 0644]
samples/CSharp/WPF_WinForms/TransparencyDialog.cs [new file with mode: 0644]
samples/CSharp/WPF_WinForms/TransparencyDialog.resx [new file with mode: 0644]
samples/CSharp/WPF_WinForms/app.config [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/MainFrame.ico [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/document.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/help.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/lamp.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/new.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/occ_logo.bmp [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/tool_color.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/tool_delete.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/tool_material.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/tool_shading.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/tool_transparency.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/tool_wireframe.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_axo.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_back.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_bottom.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_comp_off.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_comp_on.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_fitall.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_fitarea.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_front.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_glpan.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_left.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_pan.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_reset.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_right.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_rotate.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_top.png [new file with mode: 0644]
samples/CSharp/WPF_WinForms/res/view_zoom.png [new file with mode: 0644]
samples/CSharp/msvc.bat
samples/CSharp/msvc_D3D.bat [new file with mode: 0644]
samples/CSharp/run_wpf.bat
samples/CSharp/run_wpf_D3D.bat [new file with mode: 0644]

index c3e94b4..06b7326 100644 (file)
@@ -9,6 +9,7 @@ overview/overview.md
 
 ../samples/mfc/standard/ReadMe.md
 ../samples/CSharp/ReadMe.md
+../samples/CSharp/ReadMe_D3D.md
 
 tutorial/tutorial.md
 
index 4aaa8d5..12c94e6 100644 (file)
@@ -623,5 +623,9 @@ Export:
   * Stl
   * Vrml
 
-See \subpage samples_csharp "Readme" for details.
+See \subpage samples_csharp_occt "Readme" for details.
+
+Also there is an other C# example with the same functionality which demonstrates integration of Direct3D Viewer into .NET applications using WPF front end.
+
+See \subpage samples_csharp_direct3d "Readme" for details.
 
diff --git a/samples/CSharp/CSharp-vc10.sln b/samples/CSharp/CSharp-vc10.sln
deleted file mode 100644 (file)
index cefb3f1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WPF", "WPF\IE_WPF.csproj", "{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WinForms", "WinForms\IE_WinForms.csproj", "{B9914BB3-B886-4B41-B48D-350EBEBEFD1F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCCTProxy", "OCCTProxy\OCCTProxy.vcxproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Win32 = Debug|Win32
-               Debug|x64 = Debug|x64
-               Release|Win32 = Release|Win32
-               Release|x64 = Release|x64
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.ActiveCfg = Debug|x86
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.Build.0 = Debug|x86
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.ActiveCfg = Debug|x64
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.Build.0 = Debug|x64
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.ActiveCfg = Release|x86
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.Build.0 = Release|x86
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.ActiveCfg = Release|x64
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.Build.0 = Release|x64
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.ActiveCfg = Debug|x86
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.Build.0 = Debug|x86
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.ActiveCfg = Debug|x64
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.Build.0 = Debug|x64
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.ActiveCfg = Release|x86
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.Build.0 = Release|x86
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.ActiveCfg = Release|x64
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.Build.0 = Release|x64
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.ActiveCfg = Debug|x64
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.Build.0 = Debug|x64
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.ActiveCfg = Release|x64
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.Build.0 = Release|x64
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
diff --git a/samples/CSharp/CSharp-vc9.sln b/samples/CSharp/CSharp-vc9.sln
deleted file mode 100644 (file)
index 6ec2e62..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WPF", "WPF\IE_WPF.csproj", "{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WinForms", "WinForms\IE_WinForms.csproj", "{B9914BB3-B886-4B41-B48D-350EBEBEFD1F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCCTProxy", "OCCTProxy\OCCTProxy.vcproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Win32 = Debug|Win32
-               Debug|x64 = Debug|x64
-               Release|Win32 = Release|Win32
-               Release|x64 = Release|x64
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.ActiveCfg = Debug|x86
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.Build.0 = Debug|x86
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.ActiveCfg = Debug|x64
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.Build.0 = Debug|x64
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.ActiveCfg = Release|x86
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.Build.0 = Release|x86
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.ActiveCfg = Release|x64
-               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.Build.0 = Release|x64
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.ActiveCfg = Debug|x86
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.Build.0 = Debug|x86
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.ActiveCfg = Debug|x64
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.Build.0 = Debug|x64
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.ActiveCfg = Release|x86
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.Build.0 = Release|x86
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.ActiveCfg = Release|x64
-               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.Build.0 = Release|x64
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.ActiveCfg = Debug|x64
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.Build.0 = Debug|x64
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.ActiveCfg = Release|x64
-               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.Build.0 = Release|x64
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
diff --git a/samples/CSharp/CSharp.sln b/samples/CSharp/CSharp.sln
new file mode 100644 (file)
index 0000000..e67bae1
--- /dev/null
@@ -0,0 +1,45 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WPF_WinForms", "WPF_WinForms\IE_WPF_WinForms.csproj", "{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WinForms", "WinForms\IE_WinForms.csproj", "{B9914BB3-B886-4B41-B48D-350EBEBEFD1F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCCTProxy", "OCCTProxy\OCCTProxy.vcxproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.ActiveCfg = Debug|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.Build.0 = Debug|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.ActiveCfg = Debug|x64
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.Build.0 = Debug|x64
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.ActiveCfg = Release|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.Build.0 = Release|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.ActiveCfg = Release|x64
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.Build.0 = Release|x64
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.ActiveCfg = Debug|x86
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|Win32.Build.0 = Debug|x86
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.ActiveCfg = Debug|x64
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Debug|x64.Build.0 = Debug|x64
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.ActiveCfg = Release|x86
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|Win32.Build.0 = Release|x86
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.ActiveCfg = Release|x64
+               {B9914BB3-B886-4B41-B48D-350EBEBEFD1F}.Release|x64.Build.0 = Release|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.ActiveCfg = Debug|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.Build.0 = Debug|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.ActiveCfg = Release|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.Build.0 = Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/samples/CSharp/CSharp_D3D.sln b/samples/CSharp/CSharp_D3D.sln
new file mode 100644 (file)
index 0000000..a0feddd
--- /dev/null
@@ -0,0 +1,35 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IE_WPF_D3D", "WPF_D3D\IE_WPF_D3D.csproj", "{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCCTProxy_D3D", "OCCTProxy_D3D\OCCTProxy_D3D.vcxproj", "{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.ActiveCfg = Debug|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|Win32.Build.0 = Debug|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.ActiveCfg = Debug|x64
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Debug|x64.Build.0 = Debug|x64
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.ActiveCfg = Release|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|Win32.Build.0 = Release|x86
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.ActiveCfg = Release|x64
+               {D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}.Release|x64.Build.0 = Release|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.ActiveCfg = Debug|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|Win32.Build.0 = Debug|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.ActiveCfg = Debug|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Debug|x64.Build.0 = Debug|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.ActiveCfg = Release|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|Win32.Build.0 = Release|Win32
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.ActiveCfg = Release|x64
+               {969912D9-78E7-4AB8-B4FF-6B52B4F03991}.Release|x64.Build.0 = Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
index 3dd4538..e7bc2a6 100644 (file)
@@ -1094,5 +1094,5 @@ private:
   NCollection_Haft<Handle_V3d_Viewer> myViewer;
   NCollection_Haft<Handle_V3d_View> myView;
   NCollection_Haft<Handle_AIS_InteractiveContext> myAISContext;
-  NCollection_Haft<Handle_OpenGl_GraphicDriver>   myGraphicDriver;
+  NCollection_Haft<Handle_OpenGl_GraphicDriver> myGraphicDriver;
 };
index 91100d2..6c7f469 100644 (file)
@@ -78,8 +78,6 @@
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\win64\bin\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">D:\builds\vc10\CR25067-master-occt\inc;$(IncludePath)</IncludePath>
-    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">D:\builds\vc10\CR25067-master-occt\win32\vc10\lib;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
diff --git a/samples/CSharp/OCCTProxy_D3D/BridgeFBO.cxx b/samples/CSharp/OCCTProxy_D3D/BridgeFBO.cxx
new file mode 100644 (file)
index 0000000..12fa944
--- /dev/null
@@ -0,0 +1,152 @@
+#include "BridgeFBO.hxx"
+
+#include <OpenGl_ArbFBO.hxx>
+
+#include <Graphic3d_TextureParams.hxx>
+
+#include <d3dx9.h>
+
+// list of required libraries
+#pragma comment(lib, "TKOpenGl.lib")
+#pragma comment(lib, "opengl32.lib")
+
+// =======================================================================
+// function : Init
+// purpose  :
+// =======================================================================
+Standard_Boolean BridgeFBO::Init (const Handle(OpenGl_Context)& theGlContext,
+                                  void*                         theD3DDevice)
+{
+  const OpenGl_GlFunctions* aFuncs = (const OpenGl_GlFunctions* )theGlContext->core11;
+  if (aFuncs->wglDXOpenDeviceNV == NULL)
+  {
+    return Standard_False;
+  }
+
+  myGlD3DHandle = aFuncs->wglDXOpenDeviceNV (theD3DDevice);
+  if (myGlD3DHandle == NULL)
+  {
+    std::cerr << "Could not create the GL <-> DirectX Interop" << std::endl;
+    return Standard_False;
+  }
+
+  theGlContext->arbFBO->glGenFramebuffers (1, &myGlFBufferId);
+  return Standard_True;
+}
+
+// =======================================================================
+// function : Release
+// purpose  :
+// =======================================================================
+void BridgeFBO::Release (OpenGl_Context* theGlContext)
+{
+  if (myGlD3DHandle != NULL)
+  {
+    const OpenGl_GlFunctions* aFuncs = (const OpenGl_GlFunctions* )theGlContext->core11;
+    if (myGlD3DSharedColorHandle != NULL)
+    {
+      aFuncs->wglDXUnregisterObjectNV (myGlD3DHandle, myGlD3DSharedColorHandle);
+      myGlD3DSharedColorHandle = NULL;
+    }
+
+    aFuncs->wglDXCloseDeviceNV (myGlD3DHandle);
+    myGlD3DHandle = NULL;
+  }
+
+  OpenGl_FrameBuffer::Release (theGlContext);
+}
+
+// =======================================================================
+// function : RegisterD3DColorBuffer
+// purpose  :
+// =======================================================================
+Standard_Boolean BridgeFBO::RegisterD3DColorBuffer (const Handle(OpenGl_Context)& theGlContext,
+                                                    void*                         theD3DBuffer,
+                                                    void*                         theBufferShare)
+{
+  const OpenGl_GlFunctions* aFuncs = (const OpenGl_GlFunctions* )theGlContext->core11;
+  if (myGlD3DSharedColorHandle != NULL)
+  {
+    if (!aFuncs->wglDXUnregisterObjectNV (myGlD3DHandle, myGlD3DSharedColorHandle))
+    {
+      return Standard_False;
+    }
+    myGlD3DSharedColorHandle = NULL;
+  }
+
+  if (!aFuncs->wglDXSetResourceShareHandleNV (theD3DBuffer, theBufferShare))
+  {
+    return Standard_False;
+  }
+
+  myColorTexture->Release (theGlContext.operator->());
+  myColorTexture->Create  (theGlContext);
+
+  myGlD3DSharedColorHandle = aFuncs->wglDXRegisterObjectNV (myGlD3DHandle,
+    theD3DBuffer, myColorTexture->TextureId(), GL_TEXTURE_2D, WGL_ACCESS_WRITE_DISCARD_NV);
+
+  if (myGlD3DSharedColorHandle == NULL)
+  {
+    std::cerr << "Could not register color buffer" << std::endl;
+    return Standard_False;
+  }
+
+  return Standard_True;
+}
+
+// =======================================================================
+// function : Resize
+// purpose  :
+// =======================================================================
+void BridgeFBO::Resize (const Handle(OpenGl_Context)& theGlContext,
+                        int theSizeX,
+                        int theSizeY)
+{
+  myVPSizeX = theSizeX;
+  myVPSizeY = theSizeY;
+
+  myDepthStencilTexture->Init (theGlContext, GL_DEPTH24_STENCIL8,
+                               GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8,
+                               myVPSizeX, myVPSizeY, Graphic3d_TOT_2D);
+}
+
+// =======================================================================
+// function : BindBuffer
+// purpose  :
+// =======================================================================
+void BridgeFBO::BindBuffer (const Handle(OpenGl_Context)& theGlContext)
+{
+  if (myGlD3DSharedColorHandle != NULL)
+  {
+    // Lock for OpenGL
+    const OpenGl_GlFunctions* aFuncs = (const OpenGl_GlFunctions* )theGlContext->core11;
+    aFuncs->wglDXLockObjectsNV (myGlD3DHandle, 1, &myGlD3DSharedColorHandle);
+  }
+  
+  OpenGl_FrameBuffer::BindBuffer (theGlContext);
+  theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+                                                GL_TEXTURE_2D, myColorTexture->TextureId(), 0);
+  theGlContext->arbFBO->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
+                                                GL_TEXTURE_2D, myDepthStencilTexture->TextureId(), 0);
+  if (theGlContext->arbFBO->glCheckFramebufferStatus (GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
+  {
+    std::cerr << "Invalid FBO can not be bound!\n";
+    Release (theGlContext.operator->());
+  }
+}
+
+// =======================================================================
+// function : UnbindBuffer
+// purpose  :
+// =======================================================================
+void BridgeFBO::UnbindBuffer (const Handle(OpenGl_Context)& theGlContext)
+{
+  // Unbind the frame buffer
+  OpenGl_FrameBuffer::UnbindBuffer (theGlContext);
+  if (myGlD3DSharedColorHandle != NULL)
+  {
+    // Unlock for Direct3D
+    const OpenGl_GlFunctions* aFuncs = (const OpenGl_GlFunctions* )theGlContext->core11;
+    aFuncs->wglDXUnlockObjectsNV (myGlD3DHandle, 1, &myGlD3DSharedColorHandle);
+  }
+}
diff --git a/samples/CSharp/OCCTProxy_D3D/BridgeFBO.hxx b/samples/CSharp/OCCTProxy_D3D/BridgeFBO.hxx
new file mode 100644 (file)
index 0000000..9860015
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef BRIDGE_FBO_HEADER
+#define BRIDGE_FBO_HEADER
+
+#include <OpenGl_GlCore20.hxx>
+#include <OpenGl_FrameBuffer.hxx>
+
+//! Implements bridge FBO for direct rendering to Direct3D surfaces.
+class BridgeFBO : public OpenGl_FrameBuffer
+{
+public:
+
+  //! Creates new bridge FBO.
+  BridgeFBO() : OpenGl_FrameBuffer()
+  {
+    //
+  }
+
+  //! Releases resources of bridge FBO.
+  ~BridgeFBO()
+  {
+    Release (NULL);
+  }
+
+  //! Releases resources of bridge FBO.
+  virtual void Release (OpenGl_Context* theGlContext);
+
+  //! Initializes OpenGL FBO for Direct3D interoperability.
+  Standard_Boolean Init (const Handle(OpenGl_Context)& theGlContext,
+                         void*                         theD3DDevice);
+
+  //! Binds Direcr3D color buffer to OpenGL texture.
+  Standard_Boolean RegisterD3DColorBuffer (const Handle(OpenGl_Context)& theGlContext,
+                                           void*                         theD3DBuffer,
+                                           void*                         theBufferShare);
+
+  //! Locks Direct3D objects for OpenGL drawing.
+  virtual void BindBuffer (const Handle(OpenGl_Context)& theGlContext);
+
+  //! Unlocks Direct3D objects after OpenGL drawing.
+  virtual void UnbindBuffer (const Handle(OpenGl_Context)& theGlContext);
+
+  //! Resizes  buffer according to Direct3D surfaces.
+  void Resize (const Handle(OpenGl_Context)& theGlContext,
+               int                           theSizeX,
+               int                           theSizeY);
+
+private:
+
+  HANDLE myGlD3DHandle;
+  HANDLE myGlD3DSharedColorHandle;
+};
+
+#endif
\ No newline at end of file
diff --git a/samples/CSharp/OCCTProxy_D3D/Direct3DProxy.cpp b/samples/CSharp/OCCTProxy_D3D/Direct3DProxy.cpp
new file mode 100644 (file)
index 0000000..407d93f
--- /dev/null
@@ -0,0 +1,278 @@
+#include <iostream>
+#include <windows.h>
+#include <d3dx9.h>
+
+using namespace System::Runtime::InteropServices;
+
+typedef HRESULT (WINAPI *DIRECT3DCREATE9EX)(UINT SDKVersion, IDirect3D9Ex**);
+
+LRESULT WINAPI MsgProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+  return DefWindowProcW (hWnd, msg, wParam, lParam);
+}
+
+WNDCLASSEXW THE_WNDCLASS_D3D =
+{
+  sizeof (WNDCLASSEXW),
+  CS_CLASSDC, MsgProc, NULL, NULL,
+  GetModuleHandle (NULL),
+  NULL, NULL, NULL, NULL, L"D3D", NULL
+};
+
+// =======================================================================
+// function : GetVertexProcessingCaps
+// purpose  :
+// =======================================================================
+DWORD GetVertexProcessingCaps (LPDIRECT3D9 theD3D)
+{
+  D3DCAPS9 aCaps;
+  return !SUCCEEDED (theD3D->GetDeviceCaps (D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &aCaps))
+      || !(aCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
+       ? D3DCREATE_SOFTWARE_VERTEXPROCESSING
+       : D3DCREATE_HARDWARE_VERTEXPROCESSING;
+}
+
+//! Encapsulates state of Direct3D renderer.
+class D3DRender
+{
+public:
+
+  D3DRender (int theSizeX = 512,
+             int theSizeY = 512)
+  : D3D (NULL),
+    D3DEx (NULL),
+    D3DDevice (NULL),
+    D3DDeviceEx (NULL),
+    D3DColorSurf (NULL),
+    D3DColorSurfShare (NULL),
+    FuncCreate9Ex (NULL),
+    WinSizeX (theSizeX),
+    WinSizeY (theSizeY)
+  {
+    CheckRegisterClass();
+    WinHandle = CreateWindowW (L"D3D", L"D3D",
+                               WS_OVERLAPPEDWINDOW, 0, 0, 1, 1,
+                               NULL, NULL, THE_WNDCLASS_D3D.hInstance, NULL);
+    Init();
+  }
+
+  ~D3DRender()
+  {
+    // do not release class instance shared between all renderers
+    //UnregisterClass (NULL, THE_WNDCLASS_D3D.hInstance);
+    if (D3DDevice != NULL)
+    {
+      D3DDevice->Release();
+    }
+    if (D3DDeviceEx != NULL)
+    {
+      D3DDeviceEx->Release();
+    }
+    if (D3D != NULL)
+    {
+      D3D->Release();
+    }
+    if (D3DEx != NULL)
+    {
+      D3DEx->Release();
+    }
+    if (D3DColorSurf != NULL)
+    {
+      D3DColorSurf->Release();
+      D3DColorSurfShare = NULL;
+    }
+  }
+
+  //! Creates Direct3D render target.
+  bool CreateRenderTarget()
+  {
+    if (!SetWindowPos (WinHandle, 0, 0, 0, WinSizeX, WinSizeY, 0))
+    {
+      return false;
+    }
+
+    if (D3DColorSurf != NULL)
+    {
+      D3DColorSurf->Release();
+      D3DColorSurfShare = NULL;
+    }
+
+    // Note: Render target surface should be lockable on
+    // Windows XP and non-lockable on Windows Vista or higher
+    if (FAILED (D3DDevice->CreateRenderTarget (WinSizeX, WinSizeY,
+                                               D3DFMT_X8R8G8B8, D3DMULTISAMPLE_NONE, 0, FuncCreate9Ex != NULL,
+                                               &D3DColorSurf, FuncCreate9Ex == NULL ? NULL : &D3DColorSurfShare)))
+    {
+      return false;
+    }
+
+    D3DDevice->SetRenderTarget (0, D3DColorSurf);
+    return true;
+  }
+
+private:
+
+  void Init()
+  {
+    // Vista requires the D3D "Ex" functions for optimal performance.
+    // The Ex functions are only supported with WDDM drivers, so they will not be available on XP.
+    HMODULE aD3D9 = GetModuleHandleW (L"d3d9");
+    FuncCreate9Ex = (DIRECT3DCREATE9EX )GetProcAddress (aD3D9, "Direct3DCreate9Ex");
+    
+    // Set up the structure used to create the D3DDevice
+    D3DPRESENT_PARAMETERS aParams;
+    ZeroMemory (&aParams, sizeof(aParams));
+    aParams.Windowed         = TRUE;
+    aParams.BackBufferHeight = 1;
+    aParams.BackBufferWidth  = 1;
+    aParams.SwapEffect       = D3DSWAPEFFECT_DISCARD;
+    aParams.BackBufferFormat = D3DFMT_X8R8G8B8;
+    (FuncCreate9Ex != NULL) ? InitializeD3DEx (aParams) : InitializeD3D (aParams);
+  }
+  
+  bool InitializeD3D (D3DPRESENT_PARAMETERS theParams)
+  {
+    D3D = Direct3DCreate9 (D3D_SDK_VERSION);
+    if (D3D == NULL)
+      return false;
+
+    DWORD aVertProcessCaps = GetVertexProcessingCaps (D3D);
+    HRESULT aResult = D3D->CreateDevice (D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, WinHandle,
+                                         aVertProcessCaps | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE,
+                                         &theParams, &D3DDevice);
+    return SUCCEEDED (aResult);
+  }
+  
+  bool InitializeD3DEx (D3DPRESENT_PARAMETERS theParams)
+  {
+    if (FAILED (FuncCreate9Ex (D3D_SDK_VERSION, &D3DEx))
+     || FAILED (D3DEx->QueryInterface (__uuidof (IDirect3D9), reinterpret_cast<void**> (&D3D))))
+    {
+      return false;
+    }
+
+    DWORD aVertProcessCaps = GetVertexProcessingCaps (D3D);
+    if (FAILED (D3DEx->CreateDeviceEx (D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, WinHandle,
+                                       aVertProcessCaps | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE,
+                                       &theParams, NULL, &D3DDeviceEx)))
+      return false;
+
+    return SUCCEEDED (D3DDeviceEx->QueryInterface (__uuidof (IDirect3DDevice9), reinterpret_cast<void**> (&D3DDevice)));
+  }
+
+  static void CheckRegisterClass()
+  {
+    static bool isRegistered = false;
+    if (!isRegistered)
+    {
+      RegisterClassExW (&THE_WNDCLASS_D3D);
+      isRegistered = true;
+    }
+  }
+
+public:
+
+  LPDIRECT3D9         D3D;
+  LPDIRECT3D9EX       D3DEx;
+  LPDIRECT3DDEVICE9   D3DDevice;
+  LPDIRECT3DDEVICE9EX D3DDeviceEx;
+
+  LPDIRECT3DSURFACE9  D3DColorSurf;
+  HANDLE              D3DColorSurfShare;
+
+  DIRECT3DCREATE9EX   FuncCreate9Ex;
+
+  HWND                WinHandle;
+  INT                 WinSizeX;
+  INT                 WinSizeY;
+
+};
+
+public ref struct WndSize
+{
+public:
+
+  WndSize(int theSizeX, int theSizeY)
+  {
+    mySize = new SIZE();
+    mySize->cx = theSizeX;
+    mySize->cy = theSizeY;
+  }
+
+  ~WndSize()
+  {
+    delete mySize;
+  }
+
+  property int cx
+  {
+    int get() { return mySize->cx; }
+  }
+
+  property int cy
+  {
+    int get() { return mySize->cy; }
+  }
+
+  LPSIZE GetPointer()
+  {
+    return mySize;
+  }
+
+private:
+
+  LPSIZE mySize;
+};
+
+public ref class Direct3DProxy
+{
+public :
+
+  Direct3DProxy()
+  {
+    //
+  }
+
+  // =======================================================================
+  // function : InitializeScene
+  // purpose  :
+  // =======================================================================
+  static System::IntPtr InitRender ([Out] System::IntPtr% theWinHandle,
+                                    [Out] System::IntPtr% theD3DDevice)
+  {
+    D3DRender* aRender = new D3DRender();
+    theWinHandle = System::IntPtr(aRender->WinHandle);
+    theD3DDevice = System::IntPtr(aRender->D3DDevice);
+
+    return System::IntPtr(aRender);
+  }
+
+  // =======================================================================
+  // function : ResizeWindow
+  // purpose  :
+  // =======================================================================
+  static void ResizeWindow ([In]  System::IntPtr% theRender,
+                            [In]  WndSize^%       theWndSize,
+                            [Out] System::IntPtr% theColorSurf,
+                            [Out] System::IntPtr% theColorSurfShare)
+  {
+    D3DRender* aRender = reinterpret_cast<D3DRender*> (theRender.ToPointer());
+    LPSIZE aSize = theWndSize->GetPointer();
+    aRender->WinSizeX = aSize->cx;
+    aRender->WinSizeY = aSize->cy;
+    aRender->CreateRenderTarget();
+
+    theColorSurf      = System::IntPtr(aRender->D3DColorSurf);
+    theColorSurfShare = System::IntPtr(aRender->D3DColorSurfShare);
+  }
+
+  // =======================================================================
+  // function : ReleaseRender
+  // purpose  :
+  // =======================================================================
+  static void ReleaseRender ([In] System::IntPtr% theRender)
+  {
+    D3DRender* aRender = reinterpret_cast<D3DRender*> (theRender.ToPointer());
+    delete aRender;
+  }
+};
\ No newline at end of file
diff --git a/samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp b/samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp
new file mode 100644 (file)
index 0000000..98da86e
--- /dev/null
@@ -0,0 +1,1109 @@
+#include "BridgeFBO.hxx"
+
+// include required OCCT headers
+#include <Standard_Version.hxx>
+#include <Message_ProgressIndicator.hxx>
+//for OCC graphic
+#include <Aspect_DisplayConnection.hxx>
+#include <WNT_Window.hxx>
+#include <Graphic3d_CView.hxx>
+#include <Graphic3d_Camera.hxx>
+#include <Graphic3d_TextureParams.hxx>
+#include <OpenGl_GraphicDriver.hxx>
+#include <OpenGl_CView.hxx>
+//for object display
+#include <V3d_Viewer.hxx>
+#include <V3d_View.hxx>
+#include <Visual3d_View.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <AIS_Shape.hxx>
+//topology
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Compound.hxx>
+//brep tools
+#include <BRep_Builder.hxx>
+#include <BRepTools.hxx>
+#include <MgtBRep.hxx>
+#include <PTColStd_PersistentTransientMap.hxx>
+//csfdb I/E
+#include <FSD_File.hxx>
+#include <ShapeSchema.hxx>
+#include <Storage_Data.hxx>
+#include <Storage_HSeqOfRoot.hxx>
+#include <Storage_Root.hxx>
+// iges I/E
+#include <IGESControl_Reader.hxx>
+#include <IGESControl_Controller.hxx>
+#include <IGESControl_Writer.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Interface_Static.hxx>
+//step I/E
+#include <STEPControl_Reader.hxx>
+#include <STEPControl_Writer.hxx>
+//for stl export
+#include <StlAPI_Writer.hxx>
+//for vrml export
+#include <VrmlAPI_Writer.hxx>
+//wrapper of pure C++ classes to ref classes
+#include <NCollection_Haft.h>
+
+// list of required OCCT libraries
+#pragma comment(lib, "TKernel.lib")
+#pragma comment(lib, "TKMath.lib")
+#pragma comment(lib, "TKBRep.lib")
+#pragma comment(lib, "PTKernel.lib")
+#pragma comment(lib, "TKPShape.lib")
+#pragma comment(lib, "TKShapeSchema.lib")
+#pragma comment(lib, "TKXSBase.lib")
+#pragma comment(lib, "TKService.lib")
+#pragma comment(lib, "TKV3d.lib")
+#pragma comment(lib, "TKOpenGl.lib")
+#pragma comment(lib, "TKIGES.lib")
+#pragma comment(lib, "TKSTEP.lib")
+#pragma comment(lib, "TKStl.lib")
+#pragma comment(lib, "TKVrml.lib")
+
+/// <summary>
+/// Proxy class encapsulating calls to OCCT C++ classes within
+/// C++/CLI class visible from .Net (CSharp)
+/// </summary>
+public ref class OCCTProxyD3D
+{
+public:
+
+  OCCTProxyD3D() : myBridgeFBO (NULL)
+  {
+    //
+  }
+
+  // ============================================
+  // Viewer functionality
+  // ============================================
+
+  /// <summary>
+  ///Initialize a viewer
+  /// </summary>
+  /// <param name="theWnd">System.IntPtr that contains the window handle (HWND) of the control</param>
+  bool InitViewer (System::IntPtr theWnd)
+  {
+    myGraphicDriver() = new OpenGl_GraphicDriver (Handle(Aspect_DisplayConnection)());
+    //myGraphicDriver()->ChangeOptions().contextDebug = true;
+
+    TCollection_ExtendedString a3DName ("Visu3D");
+    myViewer() = new V3d_Viewer (myGraphicDriver(), a3DName.ToExtString(), "", 1000.0,
+                                 V3d_XposYnegZpos, Quantity_NOC_GRAY30,
+                                 V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
+                                 Standard_True, Standard_False);
+
+    myViewer()->SetDefaultLights();
+    myViewer()->SetLightOn();
+    myView() = myViewer()->CreateView();
+    Handle(WNT_Window) aWNTWindow = new WNT_Window (reinterpret_cast<HWND> (theWnd.ToPointer()));
+    myView()->SetWindow(aWNTWindow);
+    if (!aWNTWindow->IsMapped())
+    {
+      aWNTWindow->Map();
+    }
+    myAISContext() = new AIS_InteractiveContext (myViewer());
+    myAISContext()->UpdateCurrentViewer();
+    myView()->MustBeResized();
+    return true;
+  }
+
+  /// <summary> Initializes OCCT viewer for OpenGL-Direct3D interoperability. </summary>
+  bool InitViewer (System::IntPtr theHWND,
+                   System::IntPtr theD3DDevice)
+  {
+    if (!InitViewer (theHWND))
+    {
+      return false;
+    }
+
+    Graphic3d_CView*       aCView     = reinterpret_cast<Graphic3d_CView*> (myView()->View()->CView());
+    OpenGl_CView*          aCViewGl   = reinterpret_cast<OpenGl_CView*>    (aCView->ptrView);
+    Handle(OpenGl_Context) aGlContext = aCViewGl->WS->GetGlContext();
+    if (aGlContext.IsNull())
+    {
+      return false;
+    }
+    if (!aGlContext->IsCurrent())
+    {
+      aGlContext->MakeCurrent();
+    }
+
+    myBridgeFBO = new BridgeFBO();
+    if (!myBridgeFBO->Init (aGlContext, theD3DDevice.ToPointer()))
+    {
+      return false;
+    }
+
+    aCView->ptrFBO = myBridgeFBO;
+    return true;
+  }
+
+  /// <summary> Resizes custom FBO for Direct3D output. </summary>
+  bool ResizeBridgeFBO (int theWinSizeX,
+                        int theWinSizeY,
+                        System::IntPtr theColorSurf,
+                        System::IntPtr theColorSurfShare)
+  {
+    if (myBridgeFBO == NULL)
+    {
+      return false;
+    }
+
+    OpenGl_CView* aCView = reinterpret_cast<OpenGl_CView*> (reinterpret_cast<Graphic3d_CView*> (myView()->View()->CView())->ptrView);
+    Handle(OpenGl_Context) aGlContext = aCView->WS->GetGlContext();
+    if (aGlContext.IsNull()
+    || !aGlContext->MakeCurrent())
+    {
+      return false;
+    }
+
+    myBridgeFBO->Resize (aGlContext, theWinSizeX, theWinSizeY);
+    if (!myBridgeFBO->RegisterD3DColorBuffer (aGlContext, theColorSurf.ToPointer(), theColorSurfShare.ToPointer()))
+    {
+      return false;
+    }
+
+    myView()->Camera()->SetAspect (Standard_Real (theWinSizeX) / Standard_Real (theWinSizeY));
+    return true;
+  }
+
+  /// <summary>
+  /// Make dump of current view to file
+  /// </summary>
+  /// <param name="theFileName">Name of dump file</param>
+  bool Dump (const char* theFileName)
+  {
+    if (myView().IsNull())
+    {
+      return false;
+    }
+    myView()->Redraw();
+    return myView()->Dump (theFileName) != Standard_False;
+  }
+
+  /// <summary>
+  ///Redraw view
+  /// </summary>
+  void RedrawView()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Redraw();
+    }
+  }
+
+  /// <summary>
+  ///Update view
+  /// </summary>
+  void UpdateView(void)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->MustBeResized();
+    }
+  }
+
+  /// <summary>
+  ///Set computed mode in false
+  /// </summary>
+  void SetDegenerateModeOn()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetComputedMode (Standard_False);
+    }
+  }
+
+  /// <summary>
+  ///Set computed mode in true
+  /// </summary>
+  void SetDegenerateModeOff()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetComputedMode (Standard_True);
+    }
+  }
+
+  /// <summary>
+  ///Fit all
+  /// </summary>
+  void WindowFitAll (int theXmin, int theYmin,
+                     int theXmax, int theYmax)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->WindowFitAll (theXmin, theYmin, theXmax, theYmax);
+    }
+  }
+
+  /// <summary>
+  ///Current place of window
+  /// </summary>
+  /// <param name="theZoomFactor">Current zoom</param>
+  void Place (int theX, int theY, float theZoomFactor)
+  {    
+    Quantity_Factor aZoomFactor = theZoomFactor;
+    if (!myView().IsNull())
+    {
+      myView()->Place (theX, theY, aZoomFactor);
+    }
+  }
+
+  /// <summary>
+  ///Set Zoom
+  /// </summary>
+  void Zoom (int theX1, int theY1, int theX2, int theY2)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Zoom (theX1, theY1, theX2, theY2);
+    }
+  }
+
+  /// <summary>
+  ///Set Pan
+  /// </summary>
+  void Pan (int theX, int theY)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Pan (theX, theY);
+    }
+  }
+
+  /// <summary>
+  ///Rotation
+  /// </summary>
+  void Rotation (int theX, int theY)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Rotation (theX, theY);
+    }
+  }
+
+  /// <summary>
+  ///Start rotation
+  /// </summary>
+  void StartRotation (int theX, int theY)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->StartRotation (theX, theY);
+    }
+  }
+
+  /// <summary>
+  ///Select by rectangle
+  /// </summary>
+  void Select (int theX1, int theY1, int theX2, int theY2)
+  {
+    if (!myAISContext().IsNull())
+    {
+      myAISContext()->Select (theX1, theY1, theX2, theY2, myView());
+    }
+  }
+
+  /// <summary>
+  ///Select by click
+  /// </summary>
+  void Select()
+  {
+    if (!myAISContext().IsNull())
+    {
+      myAISContext()->Select();
+    }
+  }
+
+  /// <summary>
+  ///Move view
+  /// </summary>
+  void MoveTo (int theX, int theY)
+  {
+    if (!myAISContext().IsNull() && !myView().IsNull())
+    {
+      myAISContext()->MoveTo (theX, theY, myView());
+    }
+  }
+
+  /// <summary>
+  ///Select by rectangle with pressed "Shift" key
+  /// </summary>
+  void ShiftSelect (int theX1, int theY1, int theX2, int theY2)
+  {
+    if (!myAISContext().IsNull() && !myView().IsNull())
+    {
+      myAISContext()->ShiftSelect (theX1, theY1, theX2, theY2, myView());
+    }
+  }
+
+  /// <summary>
+  ///Select by "Shift" key
+  /// </summary>
+  void ShiftSelect()
+  {
+    if (!myAISContext().IsNull())
+    {
+      myAISContext()->ShiftSelect();
+    }
+  }
+
+  /// <summary>
+  ///Set background color
+  /// </summary>
+  void BackgroundColor (int& theRed, int& theGreen, int& theBlue)
+  {
+    if (!myView().IsNull())
+    {
+      Quantity_Color aColor = myView()->BackgroundColor();
+      theRed   = (int )aColor.Red()   * 255;
+      theGreen = (int )aColor.Green() * 255;
+      theBlue  = (int )aColor.Blue()  * 255;
+    }
+  }
+
+  /// <summary>
+  ///Get background color Red
+  /// </summary>
+  int GetBGColR()
+  {
+    int anRgb[3];
+    BackgroundColor (anRgb[0], anRgb[1], anRgb[2]);
+    return anRgb[0];
+  }
+
+  /// <summary>
+  ///Get background color Green
+  /// </summary>
+  int GetBGColG()
+  {
+    int anRgb[3];
+    BackgroundColor (anRgb[0], anRgb[1], anRgb[2]);
+    return anRgb[1];
+  }
+
+  /// <summary>
+  ///Get background color Blue
+  /// </summary>
+  int GetBGColB()
+  {
+    int anRgb[3];
+    BackgroundColor (anRgb[0], anRgb[1], anRgb[2]);
+    return anRgb[2];
+  }
+
+  /// <summary>
+  ///Update current viewer
+  /// </summary>
+  void UpdateCurrentViewer()
+  {
+    if (!myAISContext().IsNull())
+    {
+      myAISContext()->UpdateCurrentViewer();
+    }
+  }
+
+  /// <summary>
+  ///Front side
+  /// </summary>
+  void FrontView()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj (V3d_Xpos);
+    }
+  }
+
+  /// <summary>
+  ///Top side
+  /// </summary>
+  void TopView()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj (V3d_Zpos);
+    }
+  }
+
+  /// <summary>
+  ///Left side
+  /// </summary>
+  void LeftView()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj (V3d_Ypos);
+    }
+  }
+
+  /// <summary>
+  ///Back side
+  /// </summary>
+  void BackView()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj (V3d_Xneg);
+    }
+  }
+
+  /// <summary>
+  ///Right side
+  /// </summary>
+  void RightView()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj (V3d_Yneg);
+    }
+  }
+
+  /// <summary>
+  ///Bottom side
+  /// </summary>
+  void BottomView()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj (V3d_Zneg);
+    }
+  }
+
+  /// <summary>
+  ///Axo side
+  /// </summary>
+  void AxoView()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetProj (V3d_XposYnegZpos);
+    }
+  }
+
+  /// <summary>
+  ///Scale
+  /// </summary>
+  float Scale()
+  {
+    return myView().IsNull()
+         ? -1.0f
+         : float(myView()->Scale());
+  }
+
+  /// <summary>
+  ///Zoom in all view
+  /// </summary>
+  void ZoomAllView()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->FitAll();
+      myView()->ZFitAll();
+    }
+  }
+
+  /// <summary>
+  ///Reset view
+  /// </summary>
+  void Reset()
+  {
+    if (!myView().IsNull())
+    {
+      myView()->Reset();
+    }
+  }
+
+  /// <summary>
+  ///Set display mode of objects
+  /// </summary>
+  /// <param name="theMode">Set current mode</param>
+  void SetDisplayMode (int theMode)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+
+    AIS_DisplayMode aCurrentMode = theMode == 0
+                                 ? AIS_WireFrame
+                                 : AIS_Shaded;
+    if (myAISContext()->NbCurrents() == 0
+     || myAISContext()->NbSelected() == 0)
+    {
+       myAISContext()->SetDisplayMode (aCurrentMode);
+    }
+    else
+    {
+       for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+       {
+         myAISContext()->SetDisplayMode (myAISContext()->Current(), theMode, Standard_False);
+       }
+    }
+    myAISContext()->UpdateCurrentViewer();
+  }
+
+  /// <summary>
+  ///Set color
+  /// </summary>
+  void SetColor (int theR, int theG, int theB)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+
+    Quantity_Color aCol (theR / 255.0, theG / 255.0, theB / 255.0, Quantity_TOC_RGB);
+    for (; myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+    {
+      myAISContext()->SetColor (myAISContext()->Current(), aCol.Name());
+    }
+  }
+
+  /// <summary>
+  ///Get object color red
+  /// </summary>
+  int GetObjColR()
+  {
+    int anRgb[3];
+    ObjectColor (anRgb[0], anRgb[1], anRgb[2]);
+    return anRgb[0];
+  }
+
+  /// <summary>
+  ///Get object color green
+  /// </summary>
+  int GetObjColG()
+  {
+    int anRgb[3];
+    ObjectColor (anRgb[0], anRgb[1], anRgb[2]);
+    return anRgb[1];
+  }
+
+  /// <summary>
+  ///Get object color blue
+  /// </summary>
+  int GetObjColB()
+  {
+    int anRgb[3];
+    ObjectColor (anRgb[0], anRgb[1], anRgb[2]);
+    return anRgb[2];
+  }
+
+  /// <summary>
+  ///Get object color R/G/B
+  /// </summary>
+  void ObjectColor (int& theRed, int& theGreen, int& theBlue)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+
+    theRed   = 255;
+    theGreen = 255;
+    theBlue  = 255;
+    myAISContext()->InitCurrent();
+    if (!myAISContext()->MoreCurrent())
+    {
+      return;
+    }
+
+    Handle(AIS_InteractiveObject) aCurrent = myAISContext()->Current();
+    if (aCurrent->HasColor())
+    {
+      Quantity_Color anObjCol = myAISContext()->Color (myAISContext()->Current());
+      theRed   = int(anObjCol.Red()   * 255.0);
+      theGreen = int(anObjCol.Green() * 255.0);
+      theBlue  = int(anObjCol.Blue()  * 255.0);
+    }
+  }
+
+  /// <summary>
+  ///Set background color R/G/B
+  /// </summary>
+  void SetBackgroundColor (int theRed, int theGreen, int theBlue)
+  {
+    if (!myView().IsNull())
+    {
+      myView()->SetBackgroundColor (Quantity_TOC_RGB, theRed / 255.0, theGreen / 255.0, theBlue / 255.0);
+    }
+  }
+
+  /// <summary>
+  ///Erase objects
+  /// </summary>
+  void EraseObjects()
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    for(myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+    {
+      myAISContext()->Erase (myAISContext()->Current(), Standard_True);
+    }
+    myAISContext()->ClearCurrents();
+  }
+
+  /// <summary>
+  ///Get version
+  /// </summary>
+  float GetOCCVersion()
+  {
+    return (float )OCC_VERSION;
+  }
+
+  /// <summary>
+  ///set material
+  /// </summary>
+  void SetMaterial (int theMaterial)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+    {
+      myAISContext()->SetMaterial (myAISContext()->Current(), (Graphic3d_NameOfMaterial )theMaterial);
+    }
+    myAISContext()->UpdateCurrentViewer();
+  }
+
+  /// <summary>
+  ///set transparency
+  /// </summary>
+  void SetTransparency (int theTrans)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+    for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextSelected())
+    {
+      myAISContext()->SetTransparency (myAISContext()->Current(), ((Standard_Real )theTrans) / 10.0);
+    }
+  }
+
+  /// <summary>
+  ///Return true if object is selected
+  /// </summary>
+  bool IsObjectSelected()
+  {
+    if (myAISContext().IsNull())
+    {
+      return false;
+    }
+    myAISContext()->InitCurrent();
+    return myAISContext()->MoreCurrent() != Standard_False;
+  }
+
+  /// <summary>
+  ///Return display mode
+  /// </summary>
+  int DisplayMode()
+  {
+    if (myAISContext().IsNull())
+    {
+      return -1;
+    }
+
+    bool isOneOrMoreInShading   = false;
+    bool isOneOrMoreInWireframe = false;
+    for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+    {
+      if (myAISContext()->IsDisplayed (myAISContext()->Current(), AIS_Shaded))
+      {
+        isOneOrMoreInShading = true;
+      }
+      if (myAISContext()->IsDisplayed (myAISContext()->Current(), AIS_WireFrame))
+      {
+        isOneOrMoreInWireframe = true;
+      }
+    }
+    if (isOneOrMoreInShading
+     && isOneOrMoreInWireframe)
+    {
+      return 10;
+    }
+    else if (isOneOrMoreInShading)
+    {
+      return 1;
+    }
+    else if (isOneOrMoreInWireframe)
+    {
+      return 0;
+    }
+    return -1;
+  }
+
+  /// <summary>
+  ///Create new view
+  /// </summary>
+  /// <param name="theWnd">System.IntPtr that contains the window handle (HWND) of the control</param>
+  void CreateNewView (System::IntPtr theWnd)
+  {
+    if (myAISContext().IsNull())
+    {
+      return;
+    }
+
+    myView() = myAISContext()->CurrentViewer()->CreateView();
+    if (myGraphicDriver().IsNull())
+    {
+      myGraphicDriver() = new OpenGl_GraphicDriver (Handle(Aspect_DisplayConnection)());
+      //myGraphicDriver()->ChangeOptions().contextDebug = true;
+    }
+    Handle(WNT_Window) aWNTWindow = new WNT_Window (reinterpret_cast<HWND> (theWnd.ToPointer()));
+    myView()->SetWindow (aWNTWindow);
+    Standard_Integer aWidth = 100, aHeight = 100;
+    aWNTWindow->Size (aWidth, aHeight);
+    if (!aWNTWindow->IsMapped())
+    {
+      aWNTWindow->Map();
+    }
+  }
+
+  /// <summary>
+  ///Set AISContext
+  /// </summary>
+  bool SetAISContext (OCCTProxyD3D^ theViewer)
+  {
+     this->myAISContext() = theViewer->GetContext();
+     if (myAISContext().IsNull())
+     {
+       return false;
+     }
+    return true;
+  }
+
+  /// <summary>
+  ///Get AISContext
+  /// </summary>
+  Handle_AIS_InteractiveContext GetContext()
+  {
+    return myAISContext();
+  }
+
+public:
+  // ============================================
+  // Import / export functionality
+  // ============================================
+
+  /// <summary>
+  ///Import BRep file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportBrep (System::String^ theFileName)
+  {
+    bool  isResult  = false;
+    int   aLength   = theFileName->Length;
+    char* aFilename = new char[aLength + 1];
+    for(int i = 0; i < aLength; ++i)
+    {
+      aFilename[i] = (char )theFileName->ToCharArray()[i];
+    }
+    aFilename[aLength] = '\0';
+    isResult = ImportBrep (aFilename);
+    delete[] aFilename;
+    return isResult;
+  }
+
+  /// <summary>
+  ///Import BRep file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportBrep (char* theFileName)
+  {
+    TopoDS_Shape aShape;
+    BRep_Builder aBuilder;
+    if (!BRepTools::Read (aShape, theFileName, aBuilder))
+    {
+      return false;
+    }
+    if (myAISContext()->HasOpenedContext())
+    {
+      myAISContext()->CloseLocalContext();
+    }
+    Handle(AIS_Shape) aPrs = new AIS_Shape (aShape);
+    myAISContext()->SetMaterial   (aPrs, Graphic3d_NOM_GOLD);
+    myAISContext()->SetDisplayMode(aPrs, AIS_Shaded, Standard_False);
+    myAISContext()->Display (aPrs);
+    return true;
+  }
+
+  /// <summary>
+  ///Import Csfdb file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportCsfdb (char* theFileName)
+  {
+    TCollection_AsciiString aName (theFileName);
+    if (FSD_File::IsGoodFileType (aName) != Storage_VSOk)
+    {
+      return false;
+    }
+
+    FSD_File aFileDriver;
+    if (aFileDriver.Open (aName, Storage_VSRead) != Storage_VSOk)
+    {
+      return false;
+    }
+
+    Handle(ShapeSchema)  aSchema = new ShapeSchema();
+    Handle(Storage_Data) aData   = aSchema->Read (aFileDriver);
+    if (aData->ErrorStatus() != Storage_VSOk)
+    {
+      return false;
+    }
+    aFileDriver.Close();
+
+    Handle(Storage_HSeqOfRoot) aRoots = aData->Roots();
+    for (Standard_Integer aRootIter = 1; aRootIter <= aRoots->Length(); ++aRootIter)
+    {
+      Handle(Storage_Root)        aStorRoot        = aRoots->Value (aRootIter);
+      Handle(Standard_Persistent) aStandPersistent = aStorRoot->Object();
+      Handle(PTopoDS_HShape)      aPShape          = Handle(PTopoDS_HShape)::DownCast (aStandPersistent);
+      if (!aPShape.IsNull())
+      {
+        PTColStd_PersistentTransientMap aMap;
+        TopoDS_Shape aTShape;
+        MgtBRep::Translate (aPShape, aMap, aTShape, MgtBRep_WithTriangle);
+        myAISContext()->Display (new AIS_Shape (aTShape), Standard_True);
+      }
+    }
+
+    return true;
+  }
+
+  /// <summary>
+  ///Import Step file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportStep (char* theFileName)
+  {
+    STEPControl_Reader aReader;
+    if (aReader.ReadFile (theFileName) != IFSelect_RetDone)
+    {
+      return false;
+    }
+
+    bool isFailsonly = false;
+    aReader.PrintCheckLoad( isFailsonly, IFSelect_ItemsByEntity );
+
+    int aNbRoot = aReader.NbRootsForTransfer();
+    aReader.PrintCheckTransfer (isFailsonly, IFSelect_ItemsByEntity);
+    for (Standard_Integer aRootIter = 1; aRootIter <= aNbRoot; ++aRootIter)
+    {
+      aReader.TransferRoot (aRootIter);
+      int aNbShap = aReader.NbShapes();
+      if (aNbShap > 0)
+      {
+        for (int aShapeIter = 1; aShapeIter <= aNbShap; ++aShapeIter)
+        {
+          myAISContext()->Display (new AIS_Shape (aReader.Shape (aShapeIter)), Standard_True);
+        }
+      }
+    }
+    return true;
+  }
+
+  /// <summary>
+  ///Import Iges file
+  /// </summary>
+  /// <param name="theFileName">Name of import file</param>
+  bool ImportIges (char* theFileName)
+  {
+    IGESControl_Reader aReader;
+    if (aReader.ReadFile (theFileName) != IFSelect_RetDone)
+    {
+      return false;
+    }
+
+    aReader.TransferRoots();
+    TopoDS_Shape aShape = aReader.OneShape();
+    myAISContext()->Display (new AIS_Shape (aShape), Standard_False);
+    myAISContext()->UpdateCurrentViewer();
+    return true;
+  }
+
+  /// <summary>
+  ///Export BRep file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportBRep (char* theFileName)
+  {
+    myAISContext()->InitCurrent();
+    if (!myAISContext()->MoreCurrent())
+    {
+      return false;
+    }
+
+    Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
+    return !anIS.IsNull()
+         && BRepTools::Write (anIS->Shape(), theFileName);
+  }
+
+  /// <summary>
+  ///Export Step file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportStep (char* theFileName)
+  {
+    STEPControl_StepModelType aType = STEPControl_AsIs;
+    STEPControl_Writer        aWriter;
+    for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+    {
+      Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
+      if (anIS.IsNull())
+      {
+        return false;
+      }
+
+      TopoDS_Shape aShape = anIS->Shape();
+      if (aWriter.Transfer (aShape, aType) != IFSelect_RetDone)
+      {
+        return false;
+      }
+    }
+    return aWriter.Write (theFileName) == IFSelect_RetDone;
+  }
+
+  /// <summary>
+  ///Export Iges file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportIges (char* theFileName)
+  {
+    IGESControl_Controller::Init();
+    IGESControl_Writer aWriter (Interface_Static::CVal ("XSTEP.iges.unit"),
+                                Interface_Static::IVal ("XSTEP.iges.writebrep.mode"));
+    for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+    {
+      Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
+      if (anIS.IsNull())
+      {
+        return false;
+      }
+
+      aWriter.AddShape (anIS->Shape());
+    }
+
+    aWriter.ComputeModel();
+    return aWriter.Write (theFileName) != Standard_False;
+  }
+
+  /// <summary>
+  ///Export Vrml file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportVrml (char* theFileName)
+  {
+    TopoDS_Compound aRes;
+    BRep_Builder    aBuilder;
+    aBuilder.MakeCompound (aRes);
+    for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+    {
+      Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
+      if (anIS.IsNull())
+      {
+        return false;
+      }
+      aBuilder.Add (aRes, anIS->Shape());
+    }
+
+    VrmlAPI_Writer aWriter;
+    aWriter.Write (aRes, theFileName);
+    return true;
+  }
+
+  /// <summary>
+  ///Export Stl file
+  /// </summary>
+  /// <param name="theFileName">Name of export file</param>
+  bool ExportStl (char* theFileName)
+  {
+    TopoDS_Compound aComp;
+    BRep_Builder    aBuilder;
+    aBuilder.MakeCompound (aComp);
+    for (myAISContext()->InitCurrent(); myAISContext()->MoreCurrent(); myAISContext()->NextCurrent())
+    {
+      Handle(AIS_Shape) anIS = Handle(AIS_Shape)::DownCast (myAISContext()->Current());
+      if (anIS.IsNull())
+      {
+        return false;
+      }
+      aBuilder.Add (aComp, anIS->Shape());
+    }
+
+    StlAPI_Writer aWriter;
+    aWriter.Write (aComp, theFileName);
+    return true;
+  }
+
+  /// <summary>
+  ///Define which Import/Export function must be called
+  /// </summary>
+  /// <param name="theFileName">Name of Import/Export file</param>
+  /// <param name="theFormat">Determines format of Import/Export file</param>
+  /// <param name="theIsImport">Determines is Import or not</param>
+  bool TranslateModel (System::String^ theFileName, int theFormat, bool theIsImport)
+  {
+    bool  isResult  = false;
+    int   aLength   = theFileName->Length;
+    char* aFilename = new char[aLength + 1];
+    for (int aCharIter = 0; aCharIter < aLength; ++aCharIter)
+    {
+      aFilename[aCharIter] = (char)theFileName->ToCharArray()[aCharIter];
+    }
+    aFilename[aLength] = '\0';
+
+    if (theIsImport)
+    {
+      switch (theFormat)
+      {
+        case 0: isResult = ImportBrep  (aFilename); break;
+        case 1: isResult = ImportCsfdb (aFilename); break;
+        case 2: isResult = ImportStep  (aFilename); break;
+        case 3: isResult = ImportIges  (aFilename); break;
+      }
+    }
+    else 
+    {
+      switch (theFormat)
+      {
+        case 0: isResult = ExportBRep (aFilename); break;
+        case 2: isResult = ExportStep (aFilename); break;
+        case 3: isResult = ExportIges (aFilename); break;
+        case 4: isResult = ExportVrml (aFilename); break;
+        case 5: isResult = ExportStl  (aFilename); break;
+        case 6: isResult = Dump (aFilename);      break;
+      }
+    }
+    delete[] aFilename;
+    return isResult;
+  }
+
+  /// <summary>
+  ///Initialize OCCTProxyD3D
+  /// </summary>
+  void InitOCCTProxy()
+  {
+    myGraphicDriver().Nullify();
+    myViewer().Nullify();
+    myView().Nullify();
+    myAISContext().Nullify();
+  }
+
+private:
+
+  NCollection_Haft<Handle_V3d_Viewer>             myViewer;
+  NCollection_Haft<Handle_V3d_View>               myView;
+  NCollection_Haft<Handle_AIS_InteractiveContext> myAISContext;
+  NCollection_Haft<Handle_OpenGl_GraphicDriver>   myGraphicDriver;
+  BridgeFBO*                                      myBridgeFBO;     //!< Provides output to Direct3D buffers
+
+};
diff --git a/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcproj b/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcproj
new file mode 100644 (file)
index 0000000..db2b50a
--- /dev/null
@@ -0,0 +1,379 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="9.00"
+       Name="OCCTProxy_D3D"
+       ProjectGUID="{969912D9-78E7-4AB8-B4FF-6B52B4F03991}"
+       RootNamespace="OCCTProxy_D3D"
+       Keyword="Win32Proj"
+       TargetFrameworkVersion="131072"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+               <Platform
+                       Name="x64"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="..\win32\bind"
+                       IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+                       CharacterSet="2"
+                       ManagedExtensions="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\OCC\;$(CSF_OPT_INC);&quot;$(DXSDK_DIR)Include&quot;"
+                               PreprocessorDefinitions="WNT;_DEBUG"
+                               MinimalRebuild="false"
+                               BasicRuntimeChecks="0"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="$(OutDir)/OCCTProxy_D3D.dll"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="$(CSF_OPT_LIB32D)"
+                               GenerateDebugInformation="true"
+                               AssemblyDebug="1"
+                               ProgramDatabaseFile="$(OutDir)/OCCTProxy_D3D.pdb"
+                               SubSystem="2"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
+                               ImportLibrary="$(OutDir)/OCCTProxy_D3D.lib"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Debug|x64"
+                       OutputDirectory="..\win64\bind"
+                       IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+                       CharacterSet="2"
+                       ManagedExtensions="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\OCC\;$(CSF_OPT_INC);&quot;$(DXSDK_DIR)Include&quot;"
+                               PreprocessorDefinitions="WNT;_DEBUG"
+                               MinimalRebuild="false"
+                               BasicRuntimeChecks="0"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="$(OutDir)/OCCTProxy_D3D.dll"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="$(CSF_OPT_LIB64D)"
+                               GenerateDebugInformation="true"
+                               AssemblyDebug="1"
+                               ProgramDatabaseFile="$(OutDir)/OCCTProxy_D3D.pdb"
+                               SubSystem="2"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
+                               ImportLibrary="$(OutDir)/OCCTProxy_D3D.lib"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory="..\win32\bin"
+                       IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+                       CharacterSet="2"
+                       ManagedExtensions="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="..\OCC\;$(CSF_OPT_INC);&quot;$(DXSDK_DIR)Include&quot;"
+                               PreprocessorDefinitions="WNT"
+                               RuntimeLibrary="2"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="$(OutDir)/OCCTProxy_D3D.dll"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="$(CSF_OPT_LIB32)"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
+                               ImportLibrary="$(OutDir)/OCCTProxy_D3D.lib"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|x64"
+                       OutputDirectory="..\win64\bin"
+                       IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+                       CharacterSet="2"
+                       ManagedExtensions="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="..\OCC\;$(CSF_OPT_INC);&quot;$(DXSDK_DIR)Include&quot;"
+                               PreprocessorDefinitions="WNT"
+                               RuntimeLibrary="2"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="$(OutDir)/OCCTProxy_D3D.dll"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="$(CSF_OPT_LIB64)"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
+                               ImportLibrary="$(OutDir)/OCCTProxy_D3D.lib"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath=".\BridgeFBO.cxx"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\OCCTProxyD3D.cpp"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Header Files"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+                       <File
+                               RelativePath=".\BridgeFBO.hxx"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Resource Files"
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcxproj b/samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcxproj
new file mode 100644 (file)
index 0000000..e5176b4
--- /dev/null
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{969912D9-78E7-4AB8-B4FF-6B52B4F03991}</ProjectGuid>
+    <RootNamespace>OCCTProxy_D3D</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+    <ProjectName>OCCTProxy_D3D</ProjectName>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <CLRSupport>true</CLRSupport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <CLRSupport>true</CLRSupport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <CLRSupport>true</CLRSupport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <CLRSupport>true</CLRSupport>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\win32\bind\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">obj\$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\win64\bind\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">obj\$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\win32\bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">obj\$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\win64\bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>..\OCC\;$(CSF_OPT_INC);$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WNT;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>false</MinimalRebuild>
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(OutDir)OCCTProxy_D3D.dll</OutputFile>
+      <AdditionalLibraryDirectories>$(CSF_OPT_LIB32D);$(DXSDK_DIR)Lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AssemblyDebug>true</AssemblyDebug>
+      <ProgramDatabaseFile>$(OutDir)OCCTProxy_D3D.pdb</ProgramDatabaseFile>
+      <SubSystem>Windows</SubSystem>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImportLibrary>$(OutDir)OCCTProxy_D3D.lib</ImportLibrary>
+      <TargetMachine>MachineX86</TargetMachine>
+      <AdditionalDependencies>d3d9.lib;d3dx9d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>..\OCC\;$(CSF_OPT_INC);$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WNT;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>false</MinimalRebuild>
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(OutDir)OCCTProxy_D3D.dll</OutputFile>
+      <AdditionalLibraryDirectories>$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AssemblyDebug>true</AssemblyDebug>
+      <ProgramDatabaseFile>$(OutDir)OCCTProxy_D3D.pdb</ProgramDatabaseFile>
+      <SubSystem>Windows</SubSystem>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImportLibrary>$(OutDir)OCCTProxy_D3D.lib</ImportLibrary>
+      <TargetMachine>MachineX64</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>..\OCC\;$(CSF_OPT_INC);$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(OutDir)OCCTProxy_D3D.dll</OutputFile>
+      <AdditionalLibraryDirectories>$(CSF_OPT_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImportLibrary>$(OutDir)OCCTProxy_D3D.lib</ImportLibrary>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <AdditionalIncludeDirectories>..\OCC\;$(CSF_OPT_INC);$(DXSDK_DIR)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(OutDir)OCCTProxy_D3D.dll</OutputFile>
+      <AdditionalLibraryDirectories>$(CSF_OPT_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImportLibrary>$(OutDir)OCCTProxy_D3D.lib</ImportLibrary>
+      <TargetMachine>MachineX64</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="BridgeFBO.cxx" />
+    <ClCompile Include="Direct3DProxy.cpp" />
+    <ClCompile Include="OCCTProxyD3D.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="BridgeFBO.hxx" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
index 97cd8d3..f5605f5 100644 (file)
@@ -1,4 +1,4 @@
-OCCT CSharp sample {#samples_csharp}
+OCCT CSharp sample {#samples_csharp_occt}
 ================== 
        
 This sample demonstrates simple way of using OCCT libraries in .Net application
@@ -14,7 +14,7 @@ The sample implements two approaches for organizing user interface with C#.
 Both applications provide the same functionality as the standard OCCT 
 Import/Export sample.
 First project is called "IE_WinForms" and uses Windows Forms for GUI.
-Second application is called "IE_WPF" and uses Windows Presentation Foundation.
+Second application is called "IE_WPF_WinForms" and uses Windows Presentation Foundation.
 
 Note a few important details:
 
@@ -39,7 +39,7 @@ Note a few important details:
   control embedding OCCT viewer.
 
 Run msvc.bat to start MS Visual Studio for building the sample.
-Note that project files are provided only for VS 2008, you can open them in
+Note that project files are provided only for VS 2010, you can open them in
 newer versions of Visual Studio using automatic converter.
 After conversion check option "Target framework" in properties of C# projects 
 (tab "Application") to ensure that it corresponds to the version set in
@@ -51,4 +51,4 @@ Note that all batch scripts use configuration defined in OCCT custom.bat file
 as default; you can provide arguments specifying VS version, bitness, and mode
 to override these settings, e.g.:
 
-> msvc.bat vc9 win64 Debug
+> msvc.bat vc10 win64 Debug
diff --git a/samples/CSharp/ReadMe_D3D.md b/samples/CSharp/ReadMe_D3D.md
new file mode 100644 (file)
index 0000000..4a1a7eb
--- /dev/null
@@ -0,0 +1,56 @@
+Direct3D CSharp sample {#samples_csharp_direct3d}
+================== 
+       
+This sample demonstrates simple way of using OCCT and DirectX libraries in .Net application
+whitten using CSharp and Windows Presentation Foundation (WPF).
+
+The connection between .Net, OCCT (C++) and DirectX level is provided by proxy libraies,
+OCCProxy and D3DProxy, written in C++/CLI. The proxy OCCProxy library contains single ref class
+encapsulating OCCT viewer and providing functionality to manipulate this viewer
+and to import / export OCCT shapes from / to several supported formats of CAD 
+files (IGES, STEP, BREP). And the proxy D3DProxy library contains helper methods for rendering 
+via DirectX.  
+
+Organizing of user interface in this sample is provided by Windows Presentation Foundation (WPF).
+And it has the same functionality as the standard OCCT Import/Export sample. The project is 
+called "IE_WPF_D3D".
+
+Note a few important details:
+
+- to build this sample you should to download and install DirectX SDK
+  http://www.microsoft.com/en-us/download/details.aspx?id=6812
+
+- to encapsulate C++ class into a field of ref class, template class 
+  NCollection_Haft provided by OCCT is used
+  
+- in order to work consistently on 64-bit systems with OCCT libraries built in 
+  32-bit mode, C# assemblies need to have platform target explicitly set to "x86"
+  (in project Properties / Build)
+  
+- this sample demonstrates indirect method of wrapping C++ to C# using manually
+  created proxy library. Alternative method is available, wrapping individual
+  OCCT classes to C# equivalents so that their full API is available to C# user
+  and the code can be programmed on C# level similarly to C++ one. See desciption
+  of OCCT C# Wrapper in Advanced Samples and Tools on OCCT web site at 
+  http://www.opencascade.org/support/products/advsamples
+
+- in WPF sample, WinForms control is used to encapsulate OCC viewer since WPF 
+  does not provide necessary interface to embed OpenGl view. Other possible
+  solution could be to render OpenGl scene in off-screen buffer and map it
+  to WPF control as image. That approach would allow using all WPF features in
+  control embedding OCCT viewer.
+
+Run msvc.bat to start MS Visual Studio for building the sample.
+Note that project files are provided only for VS 2010, you can open them in
+newer versions of Visual Studio using automatic converter.
+After conversion check option "Target framework" in properties of C# projects 
+(tab "Application") to ensure that it corresponds to the version set in
+the properties of the C++ projects (e.g. ".Net Framework 4.0" for VS 2010).
+
+Run run_wpf-D3D.bat to launch the corresponding sample.
+
+Note that all batch scripts use configuration defined in OCCT custom.bat file
+as default; you can provide arguments specifying VS version, bitness, and mode
+to override these settings, e.g.:
+
+> msvc.bat vc10 win64 Debug
diff --git a/samples/CSharp/WPF/About.xaml b/samples/CSharp/WPF/About.xaml
deleted file mode 100644 (file)
index 59f2a05..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<Window
-       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-       x:Class="IE_WPF.AboutDialog"
-       x:Name="Window"
-       xmlns:local="clr-namespace:IE_WPF"
-       Title="About Import/Export Sample"
-       Width="312" Height="285">
-       
-       <StackPanel Orientation="Vertical">
-               <Label Content="Import/Export Sample," HorizontalAlignment="Center"/>
-               <Label Content="Open CASCADE Technology " HorizontalAlignment="Center"/>
-               <Image Source="occ_logo.bmp" Width="194" Height="100" />
-               <Label Content="Copyright (C) 2004-2013, Open CASCADE S.A.S" HorizontalAlignment="Center"/>
-               <Label Content="http://www.opencascade.com" HorizontalAlignment="Center"/>
-               <Button Content="OK" HorizontalAlignment="Center" Width="75" Command="local:IECommands.AboutOk"/>
-       </StackPanel>   
-</Window>
\ No newline at end of file
diff --git a/samples/CSharp/WPF/About.xaml.cs b/samples/CSharp/WPF/About.xaml.cs
deleted file mode 100644 (file)
index c3b0343..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-
-namespace IE_WPF
-{
-       /// <summary>
-       /// Interaction logic for About.xaml
-       /// </summary>
-       public partial class AboutDialog : Window
-       {
-               public AboutDialog()
-               {
-                       this.InitializeComponent();
-
-            CommandBinding aBind_Ok = new CommandBinding( IECommands.AboutOk );
-            aBind_Ok.Executed += OkCommand_Executed;
-            aBind_Ok.CanExecute += OkCommand_CanExecute;
-            CommandBindings.Add( aBind_Ok );
-               }
-  
-        private void OkCommand_Executed( object sender, ExecutedRoutedEventArgs e )
-        {
-            this.Close();
-        }
-
-        private void OkCommand_CanExecute( object sender, CanExecuteRoutedEventArgs e )
-        {
-            e.CanExecute = true;
-        }
-    }
-}
\ No newline at end of file
diff --git a/samples/CSharp/WPF/App.xaml b/samples/CSharp/WPF/App.xaml
deleted file mode 100644 (file)
index d3ba244..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<Application x:Class="IE_WPF.App"
-    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    StartupUri="MainWindow.xaml">
-    <Application.Resources>
-         
-       <ResourceDictionary>
-               <ResourceDictionary.MergedDictionaries>
-                       <ResourceDictionary Source="Simple Styles.xaml"/>
-               </ResourceDictionary.MergedDictionaries>
-       </ResourceDictionary>
-         
-    </Application.Resources>
-</Application>
diff --git a/samples/CSharp/WPF/App.xaml.cs b/samples/CSharp/WPF/App.xaml.cs
deleted file mode 100644 (file)
index c2a2e28..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Windows;
-
-namespace IE_WPF
-{
-    /// <summary>
-    /// Interaction logic for App.xaml
-    /// </summary>
-    public partial class App : Application
-    {
-    }
-}
diff --git a/samples/CSharp/WPF/IECommands.cs b/samples/CSharp/WPF/IECommands.cs
deleted file mode 100644 (file)
index 738260e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Input;
-
-namespace IE_WPF
-{
-    public class IECommands
-    {
-        public static RoutedUICommand New { get; private set; }
-        public static RoutedUICommand Close { get; private set; }
-        public static RoutedUICommand Quit { get; private set; }
-        public static RoutedUICommand About { get; private set; }
-        public static RoutedUICommand AboutOk { get; private set; }
-
-        static IECommands()
-        {
-            #region menu
-
-            InputGestureCollection inputsNew = new InputGestureCollection();
-            inputsNew.Add( new KeyGesture( Key.N, ModifierKeys.Control, "Ctrl + N" ) );
-            New = new RoutedUICommand( "New", "New", typeof(IECommands), inputsNew );
-            
-            Close = new RoutedUICommand( "Close", "Close", typeof(IECommands) );
-
-            InputGestureCollection inputsQuit = new InputGestureCollection();
-            inputsQuit.Add( new KeyGesture( Key.F4, ModifierKeys.Alt, "Alt + F4" ) );
-            Quit = new RoutedUICommand( "Quit", "Quit", typeof(IECommands), inputsQuit );
-
-            InputGestureCollection inputsAbout = new InputGestureCollection();
-            inputsAbout.Add( new KeyGesture( Key.F1 ) );
-            About = new RoutedUICommand( "About", "About", typeof(IECommands), inputsAbout );
-
-            #endregion
-
-            #region aboutDlg
-            InputGestureCollection inputsAboutOk = new InputGestureCollection();
-            inputsAboutOk.Add( new KeyGesture( Key.Enter ) );
-            AboutOk = new RoutedUICommand( "AboutOk", "AboutOk", typeof(IECommands), inputsAboutOk );
-            #endregion
-        }
-    }
-}
diff --git a/samples/CSharp/WPF/IE_WPF.csproj b/samples/CSharp/WPF/IE_WPF.csproj
deleted file mode 100644 (file)
index 2aa78ad..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-<?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)' == '' ">AnyCPU</Platform>
-    <ProductVersion>9.0.30729</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{D12A8897-5BF8-4345-BBB0-8ADE4B9FB9A7}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>IE_WPF</RootNamespace>
-    <AssemblyName>IE_WPF</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <WarningLevel>4</WarningLevel>
-    <ExpressionBlendVersion>3.0.1927.0</ExpressionBlendVersion>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <OldToolsVersion>3.5</OldToolsVersion>
-    <UpgradeBackupLocation />
-    <TargetFrameworkProfile />
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <DebugSymbols>true</DebugSymbols>
-    <OutputPath>..\win32\bind\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DebugType>full</DebugType>
-    <PlatformTarget>x86</PlatformTarget>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <OutputPath>..\win32\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <Optimize>true</Optimize>
-    <DebugType>pdbonly</DebugType>
-    <PlatformTarget>x86</PlatformTarget>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
-    <DebugSymbols>true</DebugSymbols>
-    <OutputPath>..\win64\bind\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <DebugType>full</DebugType>
-    <PlatformTarget>x64</PlatformTarget>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
-    <OutputPath>..\win64\bin\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <Optimize>true</Optimize>
-    <DebugType>pdbonly</DebugType>
-    <PlatformTarget>x64</PlatformTarget>
-    <ErrorReport>prompt</ErrorReport>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Core">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xaml" />
-    <Reference Include="System.Xml.Linq">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data.DataSetExtensions">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-    <Reference Include="UIAutomationProvider">
-      <RequiredTargetFramework>3.0</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="WindowsBase">
-      <RequiredTargetFramework>3.0</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="PresentationCore">
-      <RequiredTargetFramework>3.0</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="PresentationFramework">
-      <RequiredTargetFramework>3.0</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="WindowsFormsIntegration">
-      <RequiredTargetFramework>3.0</RequiredTargetFramework>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <ApplicationDefinition Include="App.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </ApplicationDefinition>
-    <Page Include="About.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </Page>
-    <Page Include="MaterialDlg.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </Page>
-    <Page Include="Simple Styles.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </Page>
-    <Page Include="MainWindow.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </Page>
-    <Compile Include="App.xaml.cs">
-      <DependentUpon>App.xaml</DependentUpon>
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="MainWindow.xaml.cs">
-      <DependentUpon>MainWindow.xaml</DependentUpon>
-      <SubType>Code</SubType>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="About.xaml.cs">
-      <DependentUpon>About.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="IECommands.cs" />
-    <Compile Include="MaterialDlg.xaml.cs">
-      <DependentUpon>MaterialDlg.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="Properties\AssemblyInfo.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Properties\Resources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>Resources.resx</DependentUpon>
-    </Compile>
-    <Compile Include="Properties\Settings.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Settings.settings</DependentUpon>
-      <DesignTimeSharedInput>True</DesignTimeSharedInput>
-    </Compile>
-    <Compile Include="OCCViewer.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="TransparencyDialog.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-    </EmbeddedResource>
-    <EmbeddedResource Include="TransparencyDialog.resx">
-      <DependentUpon>TransparencyDialog.cs</DependentUpon>
-    </EmbeddedResource>
-    <None Include="app.config" />
-    <None Include="Properties\Settings.settings">
-      <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
-    </None>
-    <AppDesigner Include="Properties\" />
-  </ItemGroup>
-  <ItemGroup>
-    <Resource Include="res\help.png" />
-    <Resource Include="res\lamp.png" />
-    <Resource Include="res\MainFrame.ico" />
-    <Resource Include="res\new.png" />
-    <Resource Include="res\tool_color.png" />
-    <Resource Include="res\tool_delete.png" />
-    <Resource Include="res\tool_material.png" />
-    <Resource Include="res\tool_shading.png" />
-    <Resource Include="res\tool_transparency.png" />
-    <Resource Include="res\tool_wireframe.png" />
-    <Resource Include="res\view_axo.png" />
-    <Resource Include="res\view_back.png" />
-    <Resource Include="res\view_bottom.png" />
-    <Resource Include="res\view_comp_off.png" />
-    <Resource Include="res\view_comp_on.png" />
-    <Resource Include="res\view_fitall.png" />
-    <Resource Include="res\view_fitarea.png" />
-    <Resource Include="res\view_front.png" />
-    <Resource Include="res\view_glpan.png" />
-    <Resource Include="res\view_left.png" />
-    <Resource Include="res\view_pan.png" />
-    <Resource Include="res\view_reset.png" />
-    <Resource Include="res\view_right.png" />
-    <Resource Include="res\view_rotate.png" />
-    <Resource Include="res\view_top.png" />
-    <Resource Include="res\view_zoom.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <Resource Include="res\occ_logo.bmp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\OCCTProxy\OCCTProxy.vcxproj">
-      <Project>{969912D9-78E7-4AB8-B4FF-6B52B4F03991}</Project>
-      <Name>OCCTProxy</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <!-- 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>
\ No newline at end of file
diff --git a/samples/CSharp/WPF/MainWindow.xaml b/samples/CSharp/WPF/MainWindow.xaml
deleted file mode 100644 (file)
index 5d54370..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-<Window
-    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-       x:Class="IE_WPF.MainWindow"
-       xmlns:local="clr-namespace:IE_WPF"
-    Title="Sample Import/Export" Height="600" Width="900" Icon="res/MainFrame.ico">
-       
-       <Window.Background>
-               <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ControlDarkColorKey}}"/>
-       </Window.Background>
-       
-       <Window.Resources>
-        <BooleanToVisibilityConverter x:Key="boolToVisibilityConverter"/>
-    </Window.Resources>
-               
-    <Grid>
-           <Grid.RowDefinitions>
-                       <RowDefinition Height="auto"/>
-                       <RowDefinition Height="auto"/>
-                       <RowDefinition />
-                       <RowDefinition Height="auto"/>
-               </Grid.RowDefinitions>
-        
-       <Menu Height="25" Grid.Row="0">
-               <MenuItem Header="File">
-                       <MenuItem Command="local:IECommands.New"/>
-                       <MenuItem Command="local:IECommands.Close"/>
-                               <MenuItem Header="Import" IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}">
-                                       <MenuItem Name="ImportBrep" Header="BRep..." Click="ImportBRep_Click"/>
-                                       <MenuItem Name="ImportIges" Header="Iges..." Click="ImportIges_Click"/>
-                    <MenuItem Name="ImportStep" Header="Step..." Click="ImportStep_Click"/>
-                               </MenuItem>
-                <MenuItem Header="Export" IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}">
-                                       <MenuItem Name="ExportBrep" Header="BRep..." Click="ExportBRep_Click"/>
-                                       <MenuItem Name="ExportIges" Header="Iges..." Click="ExportIges_Click"/>
-                                       <MenuItem Name="ExportStep" Header="Step..." Click="ExportStep_Click"/>
-                                       <MenuItem Name="ExportStl" Header="Stl..." Click="ExportStl_Click"/>
-                                       <MenuItem Name="ExportVrml" Header="Vrml..." Click="ExportVrml_Click"/>
-                                       <Separator/>
-                                       <MenuItem Name="ExportImage" Header="Image..." Click="ExportImage_Click"/>
-                               </MenuItem>
-                       <Separator/>
-                       <MenuItem Command="local:IECommands.Quit"/>
-               </MenuItem>
-               <MenuItem Header="View">
-                       <MenuItem Name="ActivateToolbar" IsCheckable="True" IsChecked="True" Header="Toolbar"/>
-                       <MenuItem Name="ActivateStatusbar" IsCheckable="True" IsChecked="True" Header="Statusbar"/>
-               </MenuItem>
-               <MenuItem Header="Help">
-                       <MenuItem Header="About" Command="local:IECommands.About"/>
-               </MenuItem>
-       </Menu>
-               
-               <ToolBarTray Background="White" Grid.Row="1">
-            <ToolBar Name="ToolBar" Band="1" BandIndex="1" 
-                                        Visibility="{Binding ElementName=ActivateToolbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}"
-                     MouseEnter="ToolBar_MouseEnter" MouseLeave="ToolBar_MouseLeave">
-                <Button ToolTip="New" Command="local:IECommands.New">
-                    <Image Source="res/new.png" Style="{StaticResource toolbarImageStyle}"/>
-                </Button>
-                       <Button ToolTip="About" Command="local:IECommands.About">
-                    <Image Source="res/help.png" Style="{StaticResource toolbarImageStyle}"/>
-                </Button>
-               </ToolBar>
-                       <ToolBar Name="DocumentToolBar" Band="1" BandIndex="2" 
-                     Visibility="{Binding ElementName=ActivateToolbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}"
-                                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}"
-                     MouseEnter="DocumentToolBar_MouseEnter" MouseLeave="ToolBar_MouseLeave">
-                <Button ToolTip="Wireframe" Click="Wireframe_Click"
-                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsWireframeEnabled}">
-                                       <Image Source="res/tool_wireframe.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                       <Button ToolTip="Shading" Click="Shading_Click"
-                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsShadingEnabled}">
-                                       <Image Source="res/tool_shading.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Color" Click="Color_Click"
-                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsColorEnabled}">
-                                       <Image Source="res/tool_color.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Material" Click="Material_Click"
-                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsMaterialEnabled}">
-                                       <Image Source="res/tool_material.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Transparency" Click="Transparency_Click"
-                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsTransparencyEnabled}">
-                                       <Image Source="res/tool_transparency.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Delete" Click="Delete_Click"
-                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDeleteEnabled}">
-                                       <Image Source="res/tool_delete.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-               </ToolBar>
-            <ToolBar Name="ViewToolBar" Band="1" BandIndex="1"
-                     Visibility="{Binding ElementName=ActivateToolbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}"
-                                        IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen}"
-                     MouseEnter="ViewToolBar_MouseEnter" MouseLeave="ToolBar_MouseLeave">
-                <Button ToolTip="FitAll" Name="FitAllBtn" Click="FitAllBtn_Click">
-                                       <Image Source="res/view_fitall.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                       <Button ToolTip="Zoom Window" Name="ZoomWindowBtn" Click="ZoomWindowBtn_Click"
-                                               IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsZoomWinEnabled}">
-                                       <Image Source="res/view_fitarea.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Dynamic Zooming" Name="DynamicZoomingBtn" Click="DynamicZoomingBtn_Click">
-                                       <Image Source="res/view_zoom.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Dynamic Panning" Name="DynamicPanningBtn" Click="DynamicPanningBtn_Click">
-                                       <Image Source="res/view_pan.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Global Panning" Name="GlobalPanningBtn" Click="GlobalPanningBtn_Click">
-                                       <Image Source="res/view_glpan.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Front" Name="FrontBtn" Click="FrontBtn_Click">
-                                       <Image Source="res/view_front.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Back" Name="BackBtn" Click="BackBtn_Click">
-                                       <Image Source="res/view_back.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Top" Name="TopBtn" Click="TopBtn_Click">
-                                       <Image Source="res/view_top.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Bottom" Name="BottomBtn" Click="BottomBtn_Click">
-                                       <Image Source="res/view_bottom.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Left" Name="LeftBtn" Click="LeftBtn_Click">
-                                       <Image Source="res/view_left.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Right" Name="RightBtn" Click="RightBtn_Click">
-                                       <Image Source="res/view_right.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Axo" Name="AxoBtn" Click="AxoBtn_Click">
-                                       <Image Source="res/view_axo.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Dynamic Rotation" Name="DynamicRotationBtn" Click="DynamicRotationBtn_Click">
-                                       <Image Source="res/view_rotate.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Reset" Name="ResetBtn" Click="ResetBtn_Click">
-                                       <Image Source="res/view_reset.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Hidden Off" Name="HiddenOffBtn" Click="HiddenOffBtn_Click"
-                                       IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsHlrOnPushed}">
-                                       <Image Source="vres/iew_comp_on.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-                               <Button ToolTip="Hidden On" Name="HiddenOnBtn" Click="HiddenOnBtn_Click"
-                                       IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsHlrOffPushed}">
-                                       <Image Source="res/view_comp_off.png" Style="{StaticResource toolbarImageStyle}"/>
-                               </Button>
-               </ToolBar>
-        </ToolBarTray>
-        
-               <TabControl Name="ViewPanel" Grid.Row="2"
-                    SelectionChanged="OnViewerChanged"
-                    Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=IsDocumentOpen, Converter={StaticResource boolToVisibilityConverter}}">
-            
-            <TabControl.ContextMenu>
-                <ContextMenu>
-                    <MenuItem Command="local:IECommands.New" Style="{StaticResource popupItem}"/>
-                    <MenuItem Command="local:IECommands.Close" Style="{StaticResource popupItem}"/>
-                </ContextMenu>
-            </TabControl.ContextMenu>
-            
-               </TabControl>
-        
-        <StatusBar Background="White"  Grid.Row="3" Visibility="{Binding ElementName=ActivateStatusbar, Path=IsChecked, Converter={StaticResource boolToVisibilityConverter}}">
-               <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=StatusBarText}"/>
-               </StatusBar>
-    </Grid>
-</Window>
diff --git a/samples/CSharp/WPF/MainWindow.xaml.cs b/samples/CSharp/WPF/MainWindow.xaml.cs
deleted file mode 100644 (file)
index d2535d3..0000000
+++ /dev/null
@@ -1,614 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using System.ComponentModel;
-using System.Windows.Forms.Integration;
-
-namespace IE_WPF
-{
-    /// <summary>
-    /// Interaction logic for MainWindow.xaml
-    /// </summary>
-    public partial class MainWindow : Window, INotifyPropertyChanged
-    {
-        public event PropertyChangedEventHandler PropertyChanged;
-        protected void RaisePropertyChanged( string thePropertyName )
-        {
-            if ( PropertyChanged != null )
-            {
-                PropertyChanged( this, new PropertyChangedEventArgs( thePropertyName ) );
-            }
-        }
-
-        public MainWindow()
-        {
-            InitializeComponent();
-
-            StatusBarText = String.Empty;
-            IsHlrOffPushed = false;
-            IsHlrOnPushed = true;
-            IsZoomWinEnabled = true;
-
-            #region menu operations
-
-            CommandBinding aBind_New = new CommandBinding( IECommands.New );
-            aBind_New.Executed += NewCommand_Executed;
-            CommandBindings.Add( aBind_New );
-
-            CommandBinding aBind_Close = new CommandBinding( IECommands.Close );
-            aBind_Close.Executed += CloseCommand_Executed;
-            aBind_Close.CanExecute += CloseCommand_CanExecute;
-            CommandBindings.Add( aBind_Close );
-
-            CommandBinding aBind_Quit = new CommandBinding( IECommands.Quit );
-            aBind_Quit.Executed += QuitCommand_Executed;
-            CommandBindings.Add( aBind_Quit );
-
-            CommandBinding aBind_About = new CommandBinding( IECommands.About );
-            aBind_About.Executed += AboutCommand_Executed;
-            CommandBindings.Add( aBind_About );
-
-            # endregion
-
-            PreviewKeyDown += new KeyEventHandler( OnPreviewKeyDown );
-            PreviewKeyUp += new KeyEventHandler( OnPreviewKeyUp );
-        }
-
-        private String myStatusBarText;
-        public String StatusBarText
-        {
-            get
-            {
-                return myStatusBarText;
-            }
-            private set
-            {
-                myStatusBarText = value;
-                RaisePropertyChanged( "StatusBarText" );
-            }
-        }
-
-        private bool isHlrOffPushed;
-        public Boolean IsHlrOffPushed
-        {
-            get
-            {
-                return isHlrOffPushed;
-            }
-            set
-            {
-                isHlrOffPushed = value;
-                RaisePropertyChanged("isHlrOffPushed");
-            }
-        }
-
-        private bool isHlrOnPushed;
-        public Boolean IsHlrOnPushed
-        {
-            get
-            {
-                return isHlrOnPushed;
-            }
-            set
-            {
-                isHlrOnPushed = value;
-                RaisePropertyChanged("IsHlrOnPushed");
-            }
-        }
-
-        private bool isZoomWinEnabled;
-        public Boolean IsZoomWinEnabled
-        {
-            get
-            {
-                return isZoomWinEnabled;
-            }
-            set
-            {
-                isZoomWinEnabled = value;
-                RaisePropertyChanged("IsZoomWinEnabled");
-            }
-        }
-
-        private OCCViewer ActiveViewer
-        {
-            get
-            {
-                if ( !IsDocumentOpen )
-                {
-                    return null;
-                }
-
-                WindowsFormsHost aHost = ( ViewPanel.SelectedContent ) as WindowsFormsHost;
-                if( aHost == null )
-                {
-                    return null;
-                }
-
-                return aHost.Child as OCCViewer;
-            }
-        }
-
-        public Boolean IsDocumentOpen
-        {
-            get
-            {
-                return ViewPanel.Items.Count > 0;
-            }
-        }
-
-        private int myDocumentCounter = 1;
-
-        private void NewCommand_Executed( object sender, ExecutedRoutedEventArgs e )
-        {
-            WindowsFormsHost aHost = new WindowsFormsHost();
-            OCCViewer aForm = new OCCViewer();
-            aForm.Show();
-            aHost.Child = aForm;
-
-            TabItem aNewTab = new TabItem();
-            aNewTab.Content = aHost;
-            aNewTab.IsSelected = true;
-            aNewTab.Header = "Document " + myDocumentCounter.ToString();
-            myDocumentCounter++;
-
-            ViewPanel.Items.Add( aNewTab );
-
-            // update XAML property
-            RaisePropertyChanged("IsDocumentOpen");
-        }
-
-        private void CloseCommand_Executed(object sender, ExecutedRoutedEventArgs e)
-        {
-            if ( ViewPanel.Items.Count > 0 )
-            {
-                ViewPanel.Items.Remove( ViewPanel.SelectedItem );
-            }
-
-            // update XAML property
-            RaisePropertyChanged( "IsDocumentOpen" );
-        }
-
-        private void CloseCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
-        {
-            e.CanExecute = IsDocumentOpen;
-        }
-
-        private void QuitCommand_Executed( object sender, ExecutedRoutedEventArgs e )
-        {
-            this.Close();
-        }
-
-        private void ImportBRep_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.ImportModel( ModelFormat.BREP );
-            }
-        }
-
-        private void ImportIges_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.ImportModel( ModelFormat.IGES );
-            }
-        }
-
-        private void ImportStep_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.ImportModel( ModelFormat.STEP );
-            }
-        }
-
-        private void ExportBRep_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.ExportModel( ModelFormat.BREP );
-            }
-        }
-
-        private void ExportStep_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.ExportModel( ModelFormat.STEP );
-            }
-        }
-
-        private void ExportIges_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.ExportModel( ModelFormat.IGES );
-            }
-        }
-
-        private void ExportStl_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.ExportModel( ModelFormat.STL );
-            }
-        }
-
-        private void ExportVrml_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.ExportModel( ModelFormat.VRML );
-            }
-        }
-
-        private void ExportImage_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.ExportModel( ModelFormat.IMAGE );
-            }
-        }
-
-        private void FitAllBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.FitAll();
-            }
-        }
-
-        private void ZoomWindowBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                IsZoomWinEnabled = false;
-                ActiveViewer.ZoomWindow();
-            }
-        }
-
-        private void DynamicZoomingBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.DynamicZooming();
-            }
-        }
-
-        private void DynamicPanningBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.DynamicPanning();
-            }
-        }
-
-        private void GlobalPanningBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.GlobalPanning();
-            }
-        }
-
-        private void FrontBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.FrontView();
-            }
-        }
-
-        private void BackBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.BackView();
-            }
-        }
-
-        private void TopBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.TopView();
-            }
-        }
-
-        private void BottomBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.BottomView();
-            }
-        }
-
-        private void LeftBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.LeftView();
-            }
-        }
-
-        private void RightBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.RightView();
-            }
-        }
-
-        private void AxoBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.AxoView();
-            }
-        }
-
-        private void ResetBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.Reset();
-            }
-        }
-
-        private void DynamicRotationBtn_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.DynamicRotation();
-            }
-        }
-
-        private void HiddenOffBtn_Click( object sender, RoutedEventArgs e )
-        {
-            IsHlrOffPushed = true;
-            IsHlrOnPushed = false;
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.HiddenOff();
-            }
-        }
-
-        private void HiddenOnBtn_Click( object sender, RoutedEventArgs e )
-        {
-            IsHlrOffPushed = false;
-            IsHlrOnPushed = true;
-            if (ActiveViewer != null)
-            {
-                ActiveViewer.HiddenOn();
-            }
-        }
-
-        private void AboutCommand_Executed( object sender, ExecutedRoutedEventArgs e )
-        {
-            AboutDialog aDlg = new AboutDialog();
-            aDlg.ShowDialog();
-        }
-
-        private void ToolBar_MouseEnter( object sender, MouseEventArgs e )
-        {
-            StatusBarText = "Toolbar";
-        }
-
-        private void DocumentToolBar_MouseEnter(object sender, MouseEventArgs e)
-        {
-            StatusBarText = "Document toolbar";
-        }
-
-        private void ViewToolBar_MouseEnter(object sender, MouseEventArgs e)
-        {
-            StatusBarText = "View toolbar";
-        }
-
-        private void ToolBar_MouseLeave( object sender, MouseEventArgs e )
-        {
-            StatusBarText = "";
-        }
-
-        public void OnZoomingFinished( object sender, EventArgs e )
-        {
-            IsZoomWinEnabled = true;
-        }
-
-        public bool IsWireframeEnabled
-        {
-            get
-            {
-                if ( ActiveViewer != null )
-                {
-                    return ActiveViewer.IsWireframeEnabled;
-                }
-                return false;
-            }
-        }
-
-        private void Wireframe_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.Wireframe();
-            }
-        }
-
-        private void Shading_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.Shading();
-            }
-        }
-
-        public bool IsShadingEnabled
-        {
-            get
-            {
-                if ( ActiveViewer != null )
-                {
-                    return ActiveViewer.IsShadingEnabled;
-                }
-                return false;
-            }
-        }
-
-        private void Color_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.Color();
-            }
-        }
-
-        public bool IsColorEnabled
-        {
-            get
-            {
-                if ( ActiveViewer != null )
-                {
-                    return ActiveViewer.IsColorEnabled;
-                }
-                return false;
-            }
-        }
-
-        private void Material_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.Material();
-            }
-        }
-
-        public bool IsMaterialEnabled
-        {
-            get
-            {
-                if ( ActiveViewer != null )
-                {
-                    return ActiveViewer.IsMaterialEnabled;
-                }
-                return false;
-            }
-        }
-
-        private void Transparency_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.Transparency();
-            }
-        }
-
-        public bool IsTransparencyEnabled
-        {
-            get
-            {
-                if ( ActiveViewer != null )
-                {
-                    return ActiveViewer.IsTransparencyEnabled;
-                }
-                return false;
-            }
-        }
-
-        private void Delete_Click( object sender, RoutedEventArgs e )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.Delete();
-            }
-        }
-
-        public bool IsDeleteEnabled
-        {
-            get
-            {
-                if ( ActiveViewer != null )
-                {
-                    return ActiveViewer.IsDeleteEnabled;
-                }
-                return false;
-            }
-        }
-
-        private void AvaliabiltyOfOperationToolbarChanged()
-        {
-            RaisePropertyChanged( "IsWireframeEnabled" );
-            RaisePropertyChanged( "IsShadingEnabled" );
-            RaisePropertyChanged( "IsTransparencyEnabled" );
-            RaisePropertyChanged( "IsColorEnabled" );
-            RaisePropertyChanged( "IsMaterialEnabled" );
-            RaisePropertyChanged( "IsDeleteEnabled" );
-        }
-
-        public void OnAvaliabiltyOfOperationsChanged( object sender, EventArgs e )
-        {
-            AvaliabiltyOfOperationToolbarChanged();
-        }
-
-        private void OnViewerChanged( object sender, SelectionChangedEventArgs e )
-        {
-            if ( e.RemovedItems.Count > 0 )
-            {
-                WindowsFormsHost aHost = ( ( e.RemovedItems[0] as TabItem).Content ) as WindowsFormsHost;
-                if( aHost == null )
-                {
-                    return;
-                }
-                OCCViewer aViewer = aHost.Child as OCCViewer;
-                if( aViewer != null )
-                {
-                    aViewer.ZoomingFinished -= new EventHandler( OnZoomingFinished );
-                    aViewer.AvaliabiltyOfOperationsChanged -= new EventHandler( OnAvaliabiltyOfOperationsChanged );
-                }
-            }
-
-            if ( e.AddedItems.Count > 0 )
-            {
-                WindowsFormsHost aHost = ( (e.AddedItems[0] as TabItem).Content ) as WindowsFormsHost;
-                if ( aHost == null )
-                {
-                    return;
-                }
-                OCCViewer aViewer = aHost.Child as OCCViewer;
-                if ( aViewer != null )
-                {
-                    aViewer.ZoomingFinished += new EventHandler( OnZoomingFinished );
-                    aViewer.AvaliabiltyOfOperationsChanged += new EventHandler( OnAvaliabiltyOfOperationsChanged );
-                }
-            }
-
-            AvaliabiltyOfOperationToolbarChanged();
-        }
-        private void OnPreviewKeyDown( object sender, KeyEventArgs args )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.OnKeyDown( args.Key );
-            }
-        }
-
-        private void OnPreviewKeyUp( object sender, KeyEventArgs args )
-        {
-            if ( ActiveViewer != null )
-            {
-                ActiveViewer.OnKeyUp();
-            }
-        }
-    }
-}
diff --git a/samples/CSharp/WPF/MaterialDlg.xaml b/samples/CSharp/WPF/MaterialDlg.xaml
deleted file mode 100644 (file)
index ef50086..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<Window
-       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-       xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-       x:Class="IE_WPF.MaterialDlg"
-       x:Name="Window"
-       Title="Material"
-       Width="133" Height="181" mc:Ignorable="d">
-
-       <StackPanel Orientation="Vertical" d:LayoutOverrides="Height" HorizontalAlignment="Center" VerticalAlignment="Center">
-               <RadioButton Name="PlasterBtn" Content="Plaster" Checked="PlasterBtn_Checked"/>
-               <RadioButton Name="BrassBtn" Content="Brass" Checked="BrassBtn_Checked"/>
-               <RadioButton Name="BronzeBtn" Content="Bronze" Checked="BronzeBtn_Checked"/>
-               <RadioButton Name="CopperBtn" Content="Copper" Checked="CopperBtn_Checked"/>
-               <RadioButton Name="GoldBtn" Content="Gold" Checked="GoldBtn_Checked"/>
-               <RadioButton Name="PewterBtn" Content="Pewter" Checked="PewterBtn_Checked"/>
-               <RadioButton Name="PlasticBtn" Content="Plastic" Checked="PlasticBtn_Checked"/>
-               <RadioButton Name="SilverBtn" Content="Silver" Checked="SilverBtn_Checked"/>
-       </StackPanel>
-</Window>
\ No newline at end of file
diff --git a/samples/CSharp/WPF/MaterialDlg.xaml.cs b/samples/CSharp/WPF/MaterialDlg.xaml.cs
deleted file mode 100644 (file)
index 0a8bebb..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-
-namespace IE_WPF
-{
-    public enum Material
-    {
-        Brass,
-        Bronze,
-        Copper,
-        Gold,
-        Pewter,
-        Plaster,
-        Plastic,
-        Silver
-    }
-
-       /// <summary>
-       /// Interaction logic for MaterialDlg.xaml
-       /// </summary>
-       public partial class MaterialDlg : Window
-       {
-               public MaterialDlg( OCCTProxy theView )
-               {
-                       this.InitializeComponent();
-
-            if ( theView == null )
-            {
-                MessageBox.Show( "Fatal Error during the graphic initialisation", "Error!" );
-            }
-
-            View = theView;
-
-            SetInitialState();
-               }
-
-        public OCCTProxy View { get; private set; }
-
-        private void PlasterBtn_Checked( object sender, RoutedEventArgs e )
-        {
-            View.SetMaterial( (int)Material.Plaster );
-            View.UpdateCurrentViewer();
-        }
-
-        private void BrassBtn_Checked( object sender, RoutedEventArgs e )
-        {
-            View.SetMaterial( (int)Material.Brass );
-            View.UpdateCurrentViewer();
-        }
-
-        private void BronzeBtn_Checked( object sender, RoutedEventArgs e )
-        {
-            View.SetMaterial( (int)Material.Bronze );
-            View.UpdateCurrentViewer();
-        }
-
-        private void CopperBtn_Checked( object sender, RoutedEventArgs e )
-        {
-            View.SetMaterial( (int)Material.Copper );
-            View.UpdateCurrentViewer();
-        }
-
-        private void GoldBtn_Checked( object sender, RoutedEventArgs e )
-        {
-            View.SetMaterial( (int)Material.Gold );
-            View.UpdateCurrentViewer();
-        }
-
-        private void PewterBtn_Checked( object sender, RoutedEventArgs e )
-        {
-            View.SetMaterial( (int)Material.Pewter );
-            View.UpdateCurrentViewer();
-        }
-
-        private void PlasticBtn_Checked( object sender, RoutedEventArgs e )
-        {
-            View.SetMaterial( (int)Material.Plastic );
-            View.UpdateCurrentViewer();
-        }
-
-        private void SilverBtn_Checked( object sender, RoutedEventArgs e )
-        {
-            View.SetMaterial( (int)Material.Silver );
-            View.UpdateCurrentViewer();
-        }
-
-        private void SetInitialState()
-        {
-            // TODO
-        }
-       }
-}
\ No newline at end of file
diff --git a/samples/CSharp/WPF/OCCViewer.cs b/samples/CSharp/WPF/OCCViewer.cs
deleted file mode 100644 (file)
index 649b6a4..0000000
+++ /dev/null
@@ -1,840 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-
-namespace IE_WPF
-{
-    public enum CurrentAction3d
-    {
-        CurAction3d_Nothing,
-        CurAction3d_DynamicZooming,
-        CurAction3d_WindowZooming,
-        CurAction3d_DynamicPanning,
-        CurAction3d_GlobalPanning,
-        CurAction3d_DynamicRotation
-    }
-    public enum CurrentPressedKey
-    {
-        CurPressedKey_Nothing,
-        CurPressedKey_Ctrl,
-        CurPressedKey_Shift
-    }
-    public enum ModelFormat
-    {
-        BREP,
-        CSFDB,
-        STEP,
-        IGES,
-        VRML,
-        STL,
-        IMAGE
-    }
-
-    public enum DisplayMode
-    {
-        Wireframe,
-        Shading
-    }
-
-    public class OCCViewer : System.Windows.Forms.Form
-    {
-        public event EventHandler ZoomingFinished;
-        protected void RaiseZoomingFinished()
-        {
-            if ( ZoomingFinished != null )
-            {
-                ZoomingFinished( this, EventArgs.Empty );
-            }
-        }
-
-        public event EventHandler AvaliabiltyOfOperationsChanged;
-        protected void RaiseAvaliabiltyOfOperationsChanged()
-        {
-            if ( AvaliabiltyOfOperationsChanged != null )
-            {
-                AvaliabiltyOfOperationsChanged( this, EventArgs.Empty );
-            }
-        }
-
-        public OCCTProxy View { get; private set; }
-        public CurrentAction3d CurrentMode { get; private set; }
-        private CurrentPressedKey CurrentPressedKey { get; set; }
-        private bool IsRectVisible { get; set; }
-        public bool DegenerateMode { get; private set; }
-
-        public bool IsWireframeEnabled { get; private set; }
-        public bool IsShadingEnabled { get; private set; }
-        public bool IsTransparencyEnabled { get; private set; }
-        public bool IsColorEnabled { get; private set; }
-        public bool IsMaterialEnabled { get; private set; }
-        public bool IsDeleteEnabled { get; private set; }
-
-        private float myCurZoom;// ~ Quantity_Factor
-        private int myXmin;
-        private int myYmin;
-        private int myXmax;
-        private int myYmax;
-        private int myRectDownX;
-        private int myRectDownY;
-        private int myButtonDownX;
-        private int myButtonDownY;
-
-        private ContextMenu Popup { get; set; }
-        private MenuItem ContextWireframe;
-        private MenuItem ContextShading;
-        private MenuItem ContextColor;
-        private MenuItem ContextMaterial;
-        private MenuItem ContextDelete;
-        private MenuItem ContextBackground;
-        private MenuItem ContextTransparency;
-
-
-        public OCCViewer()
-        {
-            InitializeComponent();
-
-            View = new OCCTProxy();
-            View.InitOCCTProxy();
-            if ( !View.InitViewer( this.Handle ) )
-            {
-                MessageBox.Show( "Fatal Error during the graphic initialisation", "Error!" );
-            }
-
-            CurrentMode = CurrentAction3d.CurAction3d_Nothing;
-            CurrentPressedKey = CurrentPressedKey.CurPressedKey_Nothing;
-            IsRectVisible = false;
-            DegenerateMode = true;
-        }
-
-        private void InitializeComponent()
-        {
-            ControlBox = false;
-            TopLevel = false;
-
-            this.ImeMode = System.Windows.Forms.ImeMode.NoControl;
-
-            SizeChanged += new System.EventHandler( OnSizeChanged );
-            Paint += new System.Windows.Forms.PaintEventHandler( OnPaint );
-
-            MouseDown += new System.Windows.Forms.MouseEventHandler( OnMouseDown );
-            MouseUp += new System.Windows.Forms.MouseEventHandler( OnMouseUp );
-            MouseMove += new System.Windows.Forms.MouseEventHandler( OnMouseMove );
-
-            Popup = new ContextMenu();
-            ContextWireframe = new MenuItem();
-            ContextShading = new MenuItem();
-            ContextColor = new MenuItem();
-            ContextMaterial = new MenuItem();
-            ContextTransparency = new MenuItem();
-            ContextDelete = new MenuItem();
-            ContextBackground = new MenuItem();
-
-            ContextWireframe.Text = "Wireframe";
-            ContextShading.Text = "Shading";
-            ContextColor.Text = "Color";
-            ContextMaterial.Text = "Material";
-            ContextTransparency.Text = "Transparency";
-            ContextDelete.Text = "Delete";
-            ContextBackground.Text = "Background";
-
-            ContextWireframe.Click += new System.EventHandler( ContextWireframe_Click );
-            ContextShading.Click += new System.EventHandler( ContextShading_Click );
-            ContextColor.Click += new System.EventHandler( ContextColor_Click );
-            ContextMaterial.Click += new System.EventHandler( ContextMaterial_Click );
-            ContextTransparency.Click += new System.EventHandler( ContextTransparency_Click );
-            ContextDelete.Click += new System.EventHandler( ContextDelete_Click );
-            ContextBackground.Click += new System.EventHandler( ContextBackground_Click );
-
-            Popup.MenuItems.AddRange( new MenuItem[] { ContextWireframe,
-                                                          ContextShading,
-                                                          ContextColor,
-                                                          ContextMaterial,
-                                                          ContextTransparency,
-                                                          ContextDelete,
-                                                       ContextBackground } );
-            Popup.Popup += new System.EventHandler( OnPopup );
-        }
-
-        private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)
-        {
-            View.RedrawView();
-            View.UpdateView();
-        }
-
-        private void OnSizeChanged(object sender, System.EventArgs e)
-        {
-            View.UpdateView();
-        }
-
-        public void ImportModel( ModelFormat theFormat )
-        {
-            int aFormat = 10;
-            OpenFileDialog anOpenDialog = new OpenFileDialog();
-            string aDataDir = ( (Environment.GetEnvironmentVariable("CASROOT")) + "\\..\\data" );
-            string aFilter = "";
-
-            switch ( theFormat )
-            {
-                case ModelFormat.BREP:
-                    anOpenDialog.InitialDirectory = (aDataDir + "\\occ");
-                    aFormat = 0;
-                    aFilter = "BREP Files (*.brep *.rle)|*.brep; *.rle";
-                    break;
-                case ModelFormat.CSFDB:
-                    aFormat = 1;
-                    aFilter = "CSFDB Files (*.csfdb)|*.csfdb";
-                    break;
-                case ModelFormat.STEP:
-                    anOpenDialog.InitialDirectory = (aDataDir + "\\step");
-                    aFormat = 2;
-                    aFilter = "STEP Files (*.stp *.step)|*.stp; *.step";
-                    break;
-                case ModelFormat.IGES:
-                    anOpenDialog.InitialDirectory = (aDataDir + "\\iges");
-                    aFormat = 3;
-                    aFilter = "IGES Files (*.igs *.iges)|*.igs; *.iges";
-                    break;
-                default:
-                    break;
-            }
-
-            anOpenDialog.Filter = aFilter + "|All files (*.*)|*.*";
-            if (anOpenDialog.ShowDialog() == DialogResult.OK)
-            {
-                string aFileName = anOpenDialog.FileName;
-                if (aFileName == "")
-                {
-                    return;
-                }
-
-                Cursor = System.Windows.Forms.Cursors.WaitCursor;
-                if ( !View.TranslateModel( aFileName, aFormat, true ) )
-                {
-                    MessageBox.Show( "Cann't read this file", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning );
-                }
-                Cursor = System.Windows.Forms.Cursors.Default;
-            }
-            View.ZoomAllView();
-        }
-
-        public void ExportModel( ModelFormat theFormat )
-        {
-            int aFormat = 10;
-            SaveFileDialog saveDialog = new SaveFileDialog();
-            string aDataDir = ( (Environment.GetEnvironmentVariable("CASROOT") ) + "\\..\\data" );
-            string aFilter = "";
-
-            switch ( theFormat )
-            {
-                case ModelFormat.BREP:
-                    saveDialog.InitialDirectory = ( aDataDir + "\\occ" );
-                    aFormat = 0;
-                    aFilter = "BREP Files (*.brep *.rle)|*.brep; *.rle";
-                    break;
-                case ModelFormat.CSFDB:
-                    aFormat = 1;
-                    aFilter = "CSFDB Files (*.csfdb)|*.csfdb";
-                    break;
-                case ModelFormat.STEP:
-                    saveDialog.InitialDirectory = ( aDataDir + "\\step" );
-                    aFormat = 2;
-                    aFilter = "STEP Files (*.stp *.step)|*.step; *.stp";
-                    break;
-                case ModelFormat.IGES:
-                    saveDialog.InitialDirectory = ( aDataDir + "\\iges" );
-                    aFormat = 3;
-                    aFilter = "IGES Files (*.igs *.iges)| *.iges; *.igs";
-                    break;
-                case ModelFormat.VRML:
-                    saveDialog.InitialDirectory = ( aDataDir + "\\vrml" );
-                    aFormat = 4;
-                    aFilter = "VRML Files (*.vrml)|*.vrml";
-                    break;
-                case ModelFormat.STL:
-                    saveDialog.InitialDirectory = ( aDataDir + "\\stl" );
-                    aFormat = 5;
-                    aFilter = "STL Files (*.stl)|*.stl";
-                    break;
-                case ModelFormat.IMAGE:
-                    saveDialog.InitialDirectory = ( aDataDir + "\\images" );
-                    aFormat = 6;
-                    aFilter = "Images Files (*.bmp)|*.bmp";
-                    break;
-                default:
-                    break;
-            }
-
-            saveDialog.Filter = aFilter;
-            if ( saveDialog.ShowDialog() == DialogResult.OK )
-            {
-                string aFileName = saveDialog.FileName;
-                if ( aFileName == "" )
-                {
-                    return;
-                }
-
-                Cursor = System.Windows.Forms.Cursors.WaitCursor;
-                if ( !View.TranslateModel( aFileName, aFormat, false ) )
-                {
-                    MessageBox.Show( "Can not write this file", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning );
-                }
-                Cursor = System.Windows.Forms.Cursors.Default;
-            }
-        }
-
-        public void FitAll()
-        {
-            View.ZoomAllView();
-        }
-
-        public void ZoomWindow()
-        {
-            CurrentMode = CurrentAction3d.CurAction3d_WindowZooming;
-        }
-
-        public void DynamicZooming()
-        {
-            CurrentMode = CurrentAction3d.CurAction3d_DynamicZooming;
-        }
-
-        public void DynamicPanning()
-        {
-            CurrentMode = CurrentAction3d.CurAction3d_DynamicPanning;
-        }
-
-        public void GlobalPanning()
-        {
-            myCurZoom = View.Scale();
-            CurrentMode = CurrentAction3d.CurAction3d_GlobalPanning;
-        }
-
-        public void AxoView()
-        {
-            View.AxoView();
-        }
-
-        public void FrontView()
-        {
-            View.FrontView();
-        }
-
-        public void TopView()
-        {
-            View.TopView();
-        }
-
-        public void LeftView()
-        {
-            View.LeftView();
-        }
-
-        public void BackView()
-        {
-            View.BackView();
-        }
-
-        public void RightView()
-        {
-            View.RightView();
-        }
-
-        public void Reset()
-        {
-            View.Reset();
-        }
-
-        public void BottomView()
-        {
-            View.BottomView();
-        }
-
-        public void HiddenOff()
-        {
-            View.SetDegenerateModeOff();
-            DegenerateMode = false;
-        }
-
-        public void HiddenOn()
-        {
-            View.SetDegenerateModeOn();
-            DegenerateMode = true;
-        }
-
-        public void DynamicRotation()
-        {
-            CurrentMode = CurrentAction3d.CurAction3d_DynamicRotation;
-        }
-
-        public void SelectionChanged()
-        {
-            switch ( View.DisplayMode() )
-            {
-                case -1:
-                    IsShadingEnabled = false;
-                    IsWireframeEnabled = false;
-                    break;
-                case 0:
-                    IsWireframeEnabled = false;
-                    IsShadingEnabled = true;
-                    IsTransparencyEnabled = false;
-                    break;
-                case 1:
-                    IsWireframeEnabled = true;
-                    IsShadingEnabled = false;
-                    IsTransparencyEnabled = true;
-                    break;
-                case 10:
-                    IsWireframeEnabled = true;
-                    IsShadingEnabled = true;
-                    IsTransparencyEnabled = true;
-                    break;
-                default:
-                    break;
-            }
-
-            if ( View.IsObjectSelected() )
-            {
-                IsColorEnabled = true;
-                IsMaterialEnabled = true;
-                IsDeleteEnabled = true;
-            }
-            else
-            {
-                IsColorEnabled = false;
-                IsMaterialEnabled = false;
-                IsTransparencyEnabled = false;
-                IsDeleteEnabled = false;
-            }
-
-            RaiseAvaliabiltyOfOperationsChanged();
-        }
-
-        public void ChangeColor( bool IsObjectColor )
-        {
-            int r, g, b;
-            if ( IsObjectColor )
-            {
-                r = View.GetObjColR();
-                g = View.GetObjColG();
-                b = View.GetObjColB();
-            }
-            else
-            {
-                r = View.GetBGColR();
-                g = View.GetBGColG();
-                b = View.GetBGColB();
-            }
-            System.Windows.Forms.ColorDialog ColDlg = new System.Windows.Forms.ColorDialog();
-            ColDlg.Color = System.Drawing.Color.FromArgb( r, g, b );
-            if ( ColDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK )
-            {
-                System.Drawing.Color c = ColDlg.Color;
-                r = c.R;
-                g = c.G;
-                b = c.B;
-                if ( IsObjectColor )
-                {
-                    View.SetColor( r, g, b );
-                }
-                else
-                {
-                    View.SetBackgroundColor( r, g, b );
-                }
-            }
-            View.UpdateCurrentViewer();
-        }
-
-        public void Wireframe()
-        {
-            View.SetDisplayMode( (int)DisplayMode.Wireframe );
-            View.UpdateCurrentViewer();
-
-            SelectionChanged();
-            RaiseZoomingFinished();
-        }
-
-        public void Shading()
-        {
-            View.SetDisplayMode( (int)DisplayMode.Shading );
-            View.UpdateCurrentViewer();
-
-            SelectionChanged();
-            RaiseZoomingFinished();
-        }
-
-        public void Color()
-        {
-            ChangeColor( true );
-        }
-
-        public void Background()
-        {
-            ChangeColor( false );
-        }
-
-        public void Material()
-        {
-            MaterialDlg aDlg = new MaterialDlg( View );
-            aDlg.ShowDialog();
-        }
-
-        public void Transparency()
-        {
-            TransparencyDialog dlg = new TransparencyDialog();
-            dlg.View = View;
-            dlg.ShowDialog( this );
-        }
-
-        public void Delete()
-        {
-            View.EraseObjects();
-        }
-
-        public void OnKeyDown( System.Windows.Input.Key theKey )
-        {
-            if ( theKey == System.Windows.Input.Key.LeftShift ||
-                 theKey == System.Windows.Input.Key.RightShift )
-            {
-                CurrentPressedKey = CurrentPressedKey.CurPressedKey_Shift;
-            }
-            else if (theKey == System.Windows.Input.Key.LeftCtrl ||
-                     theKey == System.Windows.Input.Key.RightCtrl )
-            {
-                CurrentPressedKey = CurrentPressedKey.CurPressedKey_Ctrl;
-            }
-        }
-
-        public void OnKeyUp()
-        {
-            CurrentPressedKey = CurrentPressedKey.CurPressedKey_Nothing;
-        }
-
-        protected void MultiDragEvent( int x, int y, int theState )
-        {
-            if ( theState == -1 ) //mouse is down
-            {
-                myButtonDownX = x;
-                myButtonDownY = y;
-            }
-            else if ( theState ==  1) //mouse is up
-            {
-                View.ShiftSelect( Math.Min( myButtonDownX, x ), Math.Min( myButtonDownY, y ),
-                                  Math.Max( myButtonDownX, x ), Math.Max( myButtonDownY, y ) );
-            }
-        }
-
-        protected void DragEvent( int x, int y, int theState )
-        {
-            if ( theState == -1 ) //mouse is down
-            {
-                myButtonDownX = x;
-                myButtonDownY = y;
-            }
-            else if ( theState == 1 ) //mouse is up
-            {
-                View.Select( Math.Min( myButtonDownX, x ), Math.Min( myButtonDownY, y ),
-                             Math.Max( myButtonDownX, x ), Math.Max( myButtonDownY, y ) );
-            }
-        }
-
-        private void DrawRectangle( bool draw )
-        {
-            System.Drawing.Graphics gr = System.Drawing.Graphics.FromHwnd(Handle);
-            System.Drawing.Pen p = null;
-            if ( IsRectVisible || !draw )//erase the rect
-            {
-                int r = View.GetBGColR();
-                int g = View.GetBGColG();
-                int b = View.GetBGColB();
-                p = new System.Drawing.Pen( System.Drawing.Color.FromArgb(r, g, b) );
-                IsRectVisible = false;
-                View.UpdateView();
-            }
-            else if ( draw )
-            {
-                p = new System.Drawing.Pen( System.Drawing.Color.White );
-                IsRectVisible = true;
-            }
-            if ( p == null )
-            {
-                return;
-            }
-            int x = Math.Min( myXmin, myXmax );
-            int y = Math.Min( myYmin, myYmax );
-            gr.DrawRectangle( p, x, y, Math.Abs(myXmax - myXmin), Math.Abs(myYmax - myYmin) );
-            myRectDownX = Math.Max( myXmin, myXmax );
-            myRectDownY = Math.Max( myYmin, myYmax );
-        }
-
-        private void OnMouseDown( object sender, System.Windows.Forms.MouseEventArgs e )
-        {
-            if ( e.Button == MouseButtons.Left )
-            {
-                myXmin = e.X;
-                myXmax = e.X;
-                myYmin = e.Y;
-                myYmax = e.Y;
-                if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
-                {
-                    // start the dinamic zooming....
-                    CurrentMode = CurrentAction3d.CurAction3d_DynamicZooming;
-                }
-                else
-                {
-                    switch ( CurrentMode )
-                    {
-                        case CurrentAction3d.CurAction3d_Nothing:
-                            if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift )
-                            {
-                                MultiDragEvent( myXmax, myYmax, -1 );
-                            }
-                            else
-                            {
-                                DragEvent( myXmax, myYmax, -1 );
-                            }
-                            break;
-                        case CurrentAction3d.CurAction3d_DynamicRotation:
-                            if ( !DegenerateMode )
-                            {
-                                View.SetDegenerateModeOn();
-                            }
-                            View.StartRotation( e.X, e.Y );
-                            break;
-                        case CurrentAction3d.CurAction3d_WindowZooming:
-                            Cursor = Cursors.Hand;
-                            break;
-                        default:
-                            break;
-                    }
-                }
-            }
-            else if ( e.Button == MouseButtons.Right )
-            {
-                if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
-                {
-                    if ( !DegenerateMode )
-                    {
-                        View.SetDegenerateModeOn();
-                    }
-                    View.StartRotation( e.X, e.Y );
-                }
-                else
-                {
-                    Popup.Show( this, new System.Drawing.Point( e.X, e.Y ) );
-                }
-            }
-        }
-
-        private void OnMouseUp( object sender, System.Windows.Forms.MouseEventArgs e ) 
-        {
-            if ( e.Button == MouseButtons.Left )
-            {
-                if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
-                {
-                    return;
-                }
-                switch ( CurrentMode )
-                {
-                    case CurrentAction3d.CurAction3d_Nothing:
-                        if ( e.X == myXmin && e.Y == myYmin )
-                        {
-                            myXmax = e.X;
-                            myYmax = e.Y;
-                            if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift )
-                            {
-                                View.ShiftSelect();
-                            }
-                            else
-                            {
-                                View.Select();
-                            }
-                        }
-                        else
-                        {
-                            myXmax = e.X;
-                            myYmax = e.Y;
-                            DrawRectangle( false );
-                            if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Shift )
-                            {
-                                MultiDragEvent( myXmax, myYmax, 1 );
-                            }
-                            else
-                            {
-                                DragEvent( myXmax, myYmax, 1 );
-                            }
-                        }
-                        break;
-                    case CurrentAction3d.CurAction3d_DynamicZooming:
-                        CurrentMode = CurrentAction3d.CurAction3d_Nothing;
-                        break;
-                    case CurrentAction3d.CurAction3d_WindowZooming:
-                        myXmax = e.X;
-                        myYmax = e.Y;
-                        DrawRectangle( false );
-                        int ValZWMin = 1;
-                        if ( Math.Abs(myXmax - myXmin) > ValZWMin && 
-                             Math.Abs(myXmax - myYmax) > ValZWMin )
-                        {
-                            View.WindowFitAll( myXmin, myYmin, myXmax, myYmax );
-                        }
-                        Cursor = Cursors.Arrow;
-                        RaiseZoomingFinished();
-                        CurrentMode = CurrentAction3d.CurAction3d_Nothing;
-                        break;
-                    case CurrentAction3d.CurAction3d_DynamicPanning:
-                        CurrentMode = CurrentAction3d.CurAction3d_Nothing;
-                        break;
-                    case CurrentAction3d.CurAction3d_GlobalPanning:
-                        View.Place( e.X, e.Y, myCurZoom );
-                        CurrentMode = CurrentAction3d.CurAction3d_Nothing;
-                        break;
-                    case CurrentAction3d.CurAction3d_DynamicRotation:
-                        CurrentMode = CurrentAction3d.CurAction3d_Nothing;
-                        if ( !DegenerateMode )
-                        {
-                            View.SetDegenerateModeOff();
-                        }
-                        else
-                        {
-                            View.SetDegenerateModeOn();
-                        }
-                        break;
-                    default:
-                        break;
-                }
-            }
-            else if ( e.Button == MouseButtons.Right )
-            {
-                if ( !DegenerateMode )
-                {
-                    View.SetDegenerateModeOff();
-                }
-                else
-                {
-                    View.SetDegenerateModeOn();
-                }
-            }
-
-            SelectionChanged();
-        }
-
-        private void OnMouseMove( object sender, System.Windows.Forms.MouseEventArgs e )
-        {
-            if ( e.Button == MouseButtons.Left ) //left button is pressed
-            {
-                if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
-                {
-                    View.Zoom(myXmax, myYmax, e.X, e.Y);
-                    myXmax = e.X;
-                    myYmax = e.Y;
-                }
-                else
-                {
-                    switch ( CurrentMode )
-                    {
-                        case CurrentAction3d.CurAction3d_Nothing:
-                            DrawRectangle( false );
-                            myXmax = e.X;
-                            myYmax = e.Y;
-                            DrawRectangle( true );
-                            break;
-                        case CurrentAction3d.CurAction3d_DynamicZooming:
-                            View.Zoom( myXmax, myYmax, e.X, e.Y );
-                            myXmax = e.X;
-                            myYmax = e.Y;
-                            break;
-                        case CurrentAction3d.CurAction3d_WindowZooming:
-                            DrawRectangle( false );
-                            myXmax = e.X;
-                            myYmax = e.Y;
-                            DrawRectangle( true );//add brush here
-                            break;
-                        case CurrentAction3d.CurAction3d_DynamicPanning:
-                            View.Pan( e.X - myXmax, myYmax - e.Y );
-                            myXmax = e.X;
-                            myYmax = e.Y;
-                            break;
-                        case CurrentAction3d.CurAction3d_GlobalPanning:
-                            break;
-                        case CurrentAction3d.CurAction3d_DynamicRotation:
-                            View.Rotation( e.X, e.Y );
-                            View.RedrawView();
-                            break;
-                        default:
-                            break;
-                    }
-                }
-            }
-            else if ( e.Button == MouseButtons.Middle ) //middle button is pressed
-            {
-                if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl )
-                {
-                    View.Pan( e.X - myXmax, myYmax - e.Y );
-                    myXmax = e.X;
-                    myYmax = e.Y;
-                }
-            }
-            else if ( e.Button == MouseButtons.Right ) //right button is pressed
-            {
-                if ( CurrentPressedKey == CurrentPressedKey.CurPressedKey_Ctrl) 
-                {
-                    View.Rotation( e.X, e.Y );
-                }
-            }
-            else // no buttons are pressed
-            {
-                myXmax = e.X;
-                myYmax = e.Y;
-                View.MoveTo( e.X, e.Y );
-            }
-        }
-
-        private void OnPopup( object sender, System.EventArgs e )
-        {
-            ContextWireframe.Enabled = IsWireframeEnabled;
-            ContextShading.Enabled = IsShadingEnabled;
-            ContextColor.Enabled = IsColorEnabled;
-            ContextMaterial.Enabled = IsMaterialEnabled;
-            ContextDelete.Enabled = IsDeleteEnabled;
-            ContextTransparency.Enabled = IsTransparencyEnabled;
-            ContextBackground.Enabled = true;
-        }
-
-        private void ContextWireframe_Click( object sender, System.EventArgs e )
-        {
-            Wireframe();
-        }
-
-        private void ContextShading_Click( object sender, System.EventArgs e )
-        {
-            Shading();
-        }
-
-        private void ContextColor_Click( object sender, System.EventArgs e )
-        {
-            Color();
-        }
-
-        private void ContextMaterial_Click( object sender, System.EventArgs e )
-        {
-            Material();
-        }
-
-        private void ContextTransparency_Click( object sender, System.EventArgs e )
-        {
-            Transparency();
-        }
-
-        private void ContextDelete_Click( object sender, System.EventArgs e )
-        {
-            Delete();
-        }
-
-        private void ContextBackground_Click( object sender, System.EventArgs e )
-        {
-            Background();
-        }
-    }
-}
diff --git a/samples/CSharp/WPF/Properties/AssemblyInfo.cs b/samples/CSharp/WPF/Properties/AssemblyInfo.cs
deleted file mode 100644 (file)
index 02445ca..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// 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("IE")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("IE")]
-[assembly: AssemblyCopyright("Copyright ©  2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 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)]
-
-//In order to begin building localizable applications, set 
-//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
-//inside a <PropertyGroup>.  For example, if you are using US english
-//in your source files, set the <UICulture> to en-US.  Then uncomment
-//the NeutralResourceLanguage attribute below.  Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
-    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
-    //(used if a resource is not found in the page, 
-    // or application resource dictionaries)
-    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
-    //(used if a resource is not found in the page, 
-    // app, or any theme specific resource dictionaries)
-)]
-
-
-// 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")]
diff --git a/samples/CSharp/WPF/Properties/Resources.Designer.cs b/samples/CSharp/WPF/Properties/Resources.Designer.cs
deleted file mode 100644 (file)
index 5855aaf..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.5472
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace IE_WPF.Properties {
-    using System;
-    
-    
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources {
-        
-        private static global::System.Resources.ResourceManager resourceMan;
-        
-        private static global::System.Globalization.CultureInfo resourceCulture;
-        
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources() {
-        }
-        
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager {
-            get {
-                if (object.ReferenceEquals(resourceMan, null)) {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IE_WPF.Properties.Resources", typeof(Resources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-        
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
-            get {
-                return resourceCulture;
-            }
-            set {
-                resourceCulture = value;
-            }
-        }
-    }
-}
diff --git a/samples/CSharp/WPF/Properties/Resources.resx b/samples/CSharp/WPF/Properties/Resources.resx
deleted file mode 100644 (file)
index af7dbeb..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/samples/CSharp/WPF/Properties/Settings.Designer.cs b/samples/CSharp/WPF/Properties/Settings.Designer.cs
deleted file mode 100644 (file)
index 7228f90..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.5472
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace IE_WPF.Properties {
-    
-    
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-        
-        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-        
-        public static Settings Default {
-            get {
-                return defaultInstance;
-            }
-        }
-    }
-}
diff --git a/samples/CSharp/WPF/Properties/Settings.settings b/samples/CSharp/WPF/Properties/Settings.settings
deleted file mode 100644 (file)
index 033d7a5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>
\ No newline at end of file
diff --git a/samples/CSharp/WPF/Simple Styles.xaml b/samples/CSharp/WPF/Simple Styles.xaml
deleted file mode 100644 (file)
index b130cea..0000000
+++ /dev/null
@@ -1,1134 +0,0 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/interactivedesigner/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
-       
-       <!-- SimpleStyles.XAML defines a set of control styles which are simplified starting points for creating your own controls -->
-       
-       <!-- Brushes : These are used to define the color for background, foreground, selection, enabled etc of all controls
-       If you want to change the color of a control you can just chnage the brush; if you want to add a new shape or change arrangement then also edit the template -->
-       
-       <!-- NormalBrush is used as the Background for SimpleButton, SimpleRepeatButton -->
-       <LinearGradientBrush x:Key="NormalBrush" EndPoint="0,1" StartPoint="0,0">
-               <GradientStop Color="#EEE" Offset="0.0"/>
-               <GradientStop Color="#CCC" Offset="1.0"/>
-       </LinearGradientBrush>
-       <LinearGradientBrush x:Key="NormalBorderBrush" EndPoint="0,1" StartPoint="0,0">
-               <GradientStop Color="#CCC" Offset="0.0"/>
-               <GradientStop Color="#444" Offset="1.0"/>
-       </LinearGradientBrush>
-       
-       <!-- LightBrush is used for content areas such as Menu, Tab Control background -->
-       <LinearGradientBrush x:Key="LightBrush" EndPoint="0,1" StartPoint="0,0">
-               <GradientStop Color="#FFF" Offset="0.0"/>
-               <GradientStop Color="#EEE" Offset="1.0"/>
-       </LinearGradientBrush>
-       
-       <!-- MouseOverBrush is used for MouseOver in Button, Radio Button, CheckBox -->
-       <LinearGradientBrush x:Key="MouseOverBrush" EndPoint="0,1" StartPoint="0,0">
-               <GradientStop Color="#FFF" Offset="0.0"/>
-               <GradientStop Color="#AAA" Offset="1.0"/>
-       </LinearGradientBrush>
-       
-       <!-- PressedBrush is used for Pressed in Button, Radio Button, CheckBox -->
-       <LinearGradientBrush x:Key="PressedBrush" EndPoint="0,1" StartPoint="0,0">
-               <GradientStop Color="#BBB" Offset="0.0"/>
-               <GradientStop Color="#EEE" Offset="0.1"/>
-               <GradientStop Color="#EEE" Offset="0.9"/>
-               <GradientStop Color="#FFF" Offset="1.0"/>
-       </LinearGradientBrush>
-       <LinearGradientBrush x:Key="PressedBorderBrush" EndPoint="0,1" StartPoint="0,0">
-               <GradientStop Color="#444" Offset="0.0"/>
-               <GradientStop Color="#888" Offset="1.0"/>
-       </LinearGradientBrush>
-
-       <!-- SelectedBackgroundBrush is used for the Selected item in ListBoxItem, ComboBoxItem-->
-       <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#DDD"/> 
-
-       <!-- Disabled Brushes are used for the Disabled look of each control -->
-       <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888"/>
-       <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE"/>
-       <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA"/>
-
-       <!-- Used for background of ScrollViewer, TreeView, ListBox, Expander, TextBox, Tab Control -->
-       <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF"/>
-       
-       <!-- DefaultedBorderBrush is used to show KeyBoardFocus -->
-       <LinearGradientBrush x:Key="DefaultedBorderBrush" EndPoint="0,1" StartPoint="0,0">
-               <GradientStop Color="#777" Offset="0.0"/>
-               <GradientStop Color="#000" Offset="1.0"/>
-       </LinearGradientBrush>
-
-       <SolidColorBrush x:Key="SolidBorderBrush" Color="#888"/>
-       <SolidColorBrush x:Key="LightBorderBrush" Color="#AAA"/>
-       <SolidColorBrush x:Key="LightColorBrush" Color="#DDD"/>
-       
-       <!-- Used for Checkmark, Radio button, TreeViewItem, Expander ToggleButton glyphs -->
-       <SolidColorBrush x:Key="GlyphBrush" Color="#444"/>
-       
-       
-       <!-- Style and Template pairs are used to define each control Part -->
-       <!-- The Style provides default values on the control; the Template gives the elements for each control -->
-       
-       <!-- SimpleButtonFocusVisual is used to show keyboard focus around a SimpleButton control -->
-       <Style x:Key="SimpleButtonFocusVisual">
-               <Setter Property="Control.Template">
-                       <Setter.Value>
-                               <ControlTemplate>
-                                       <Border>
-                                               <Rectangle Margin="2" Stroke="#60000000" StrokeThickness="1" StrokeDashArray="1 2"/>
-                                       </Border>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-
-    <Style TargetType="{x:Type Image}" x:Key="toolbarImageStyle">
-        <Style.Triggers>
-            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
-                <Setter Property="Opacity" Value="0.50"></Setter>
-            </DataTrigger>
-        </Style.Triggers>
-    </Style>
-
-    <Style TargetType="MenuItem" x:Key="popupItem">
-        <Setter Property="CommandTarget"
-                    Value="{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu} }"/>
-    </Style>
-
-    <!-- Simple Button - This control sets brushes on each state. Note that these brushes must be listed above since they are static resources -->
-       <Style x:Key="SimpleButton" TargetType="{x:Type Button}" BasedOn="{x:Null}">
-               <Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/>
-               <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
-               <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type Button}">
-                                       
-                                       <!-- We use Grid as a root because it is easy to add more elements to customize the button -->
-                                       <Grid x:Name="Grid">
-                                               <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
-                                               
-                                               <!-- Content Presenter is where the text content etc is placed by the control -->
-                                               <!-- The bindings are useful so that the control can be parameterized without editing the template -->
-                                               <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
-                                       </Grid>
-                                       
-                                       <!--Each state sets a brush on the Border in the template -->
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsKeyboardFocused" Value="true">
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsMouseOver" Value="true">
-                                                       <Setter Property="Background" Value="{DynamicResource MouseOverBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsPressed" Value="true">
-                                                       <Setter Property="Background" Value="{DynamicResource PressedBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource PressedBorderBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsEnabled" Value="true"/>
-                                               <Trigger Property="IsEnabled" Value="false">
-                                                       <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
-                                                       <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <Style x:Key="RadioButtonFocusVisual">
-               <Setter Property="Control.Template">
-                       <Setter.Value>
-                               <ControlTemplate>
-                                       <Border>
-                                               <Rectangle Margin="15,0,0,0" Stroke="#60000000" StrokeThickness="1" StrokeDashArray="1 2"/>
-                                       </Border>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <Style x:Key="CheckBoxFocusVisual">
-               <Setter Property="Control.Template">
-                       <Setter.Value>
-                               <ControlTemplate>
-                                       <Border>
-                                               <Rectangle Margin="15,0,0,0" Stroke="#60000000" StrokeThickness="1" StrokeDashArray="1 2"/>
-                                       </Border>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple CheckBox -->
-       <Style x:Key="SimpleCheckBox" TargetType="{x:Type CheckBox}">
-               <Setter Property="SnapsToDevicePixels" Value="true"/>
-               <Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}"/>
-               <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
-               <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type CheckBox}">
-                                       
-                                       <!-- BulletDecorator is used to provide baseline alignment between the checkmark and the Content -->
-                                       <BulletDecorator Background="Transparent">
-                                               <BulletDecorator.Bullet>
-                                                       <Grid Width="13" Height="13">
-                                                               <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
-                                                               <Path x:Name="CheckMark" Stroke="{DynamicResource GlyphBrush}" StrokeThickness="2" SnapsToDevicePixels="False" Data="M 0 0 L 13 13 M 0 13 L 13 0"/>
-                                                       </Grid>
-                                               </BulletDecorator.Bullet>
-                                               <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
-                                       </BulletDecorator>
-                                       
-                                       <!-- This uses Visibility to hide and show the CheckMark on IsChecked -->
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsChecked" Value="false">
-                                                       <Setter Property="Visibility" Value="Collapsed" TargetName="CheckMark"/>
-                                               </Trigger>
-                                               <Trigger Property="IsMouseOver" Value="true">
-                                                       <Setter Property="Background" Value="{DynamicResource MouseOverBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsPressed" Value="true">
-                                                       <Setter Property="Background" Value="{DynamicResource PressedBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource PressedBorderBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsEnabled" Value="false">
-                                                       <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                                       
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple Radio Button -->
-       <Style x:Key="SimpleRadioButton" TargetType="{x:Type RadioButton}">
-               <Setter Property="SnapsToDevicePixels" Value="true"/>
-               <Setter Property="FocusVisualStyle" Value="{DynamicResource RadioButtonFocusVisual}"/>
-               <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
-               <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type RadioButton}">
-                               
-                                       <!-- BulletDecorator is used to provide baseline alignment between the checkmark and the Content -->
-                                       <BulletDecorator Background="Transparent">
-                                               <BulletDecorator.Bullet>
-                                                       <Grid Width="13" Height="13">
-                                                               <Ellipse x:Name="Ellipse_Border" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/>
-                                                               <Ellipse Margin="4" x:Name="CheckMark" Fill="{DynamicResource GlyphBrush}"/>
-                                                       </Grid>
-                                               </BulletDecorator.Bullet>
-                                               <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
-                                       </BulletDecorator>
-                                       
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsChecked" Value="false">
-                                                       <Setter Property="Visibility" Value="Collapsed" TargetName="CheckMark"/>
-                                               </Trigger>
-                                               <Trigger Property="IsMouseOver" Value="true">
-                                                       <Setter Property="Fill" Value="{DynamicResource MouseOverBrush}" TargetName="Ellipse_Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsPressed" Value="true">
-                                                       <Setter Property="Fill" Value="{DynamicResource PressedBrush}" TargetName="Ellipse_Border"/>
-                                                       <Setter Property="Stroke" Value="{DynamicResource GlyphBrush}" TargetName="Ellipse_Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsEnabled" Value="false">
-                                                       <Setter Property="Fill" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Ellipse_Border"/>
-                                                       <Setter Property="Stroke" Value="#40000000" TargetName="Ellipse_Border"/>
-                                                       <Setter Property="Foreground" Value="#80000000"/>
-                                               </Trigger>
-                                               
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple Repeat Button - This is used by Simple ScrollBar for the up and down buttons -->
-       <Style x:Key="SimpleRepeatButton" d:IsControlPart="True" TargetType="{x:Type RepeatButton}" BasedOn="{x:Null}">
-               <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
-               <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type RepeatButton}">
-                                       <Grid>
-                                               <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
-                                               <ContentPresenter HorizontalAlignment="Center" x:Name="ContentPresenter" VerticalAlignment="Center" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsKeyboardFocused" Value="true">
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DefaultedBorderBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsMouseOver" Value="true">
-                                                       <Setter Property="Background" Value="{DynamicResource MouseOverBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsPressed" Value="true">
-                                                       <Setter Property="Background" Value="{DynamicResource PressedBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource PressedBorderBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsEnabled" Value="false">
-                                                       <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
-                                                       <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple Thumb - The Thumb is the draggable part of the Scrollbar -->
-       <Style x:Key="SimpleThumbStyle" d:IsControlPart="True" TargetType="{x:Type Thumb}" BasedOn="{x:Null}">
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type Thumb}">
-                                       <Grid Margin="0,0,0,0" x:Name="Grid">
-                                               <Rectangle HorizontalAlignment="Stretch" x:Name="Rectangle" VerticalAlignment="Stretch" Width="Auto" Height="Auto" RadiusX="2" RadiusY="2" Fill="{DynamicResource NormalBrush}" Stroke="{DynamicResource NormalBorderBrush}"/>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsFocused" Value="True"/>
-                                               <Trigger Property="IsMouseOver" Value="True"/>
-                                               <Trigger Property="IsEnabled" Value="False"/>
-                                               <Trigger Property="IsDragging" Value="True"/>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple ScrollRepeatButton Style - This RepeatButton is used above and below the Thumb in the Scrollbar. They are set to transparent si that they do not show over the scrollbar -->
-       <Style x:Key="SimpleScrollRepeatButtonStyle" d:IsControlPart="True" TargetType="{x:Type RepeatButton}">
-               <Setter Property="Background" Value="Transparent"/>
-               <Setter Property="BorderBrush" Value="Transparent"/>
-               <Setter Property="IsTabStop" Value="false"/>
-               <Setter Property="Focusable" Value="false"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type RepeatButton}">
-                                       <Grid>
-                                               <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}"/>
-                                       </Grid>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple ScrollBar  This makes use of SimpleThumb, SimpleRepeatButton and SimpleScrollRepeatButton -->
-       
-       <Style x:Key="SimpleScrollBar" TargetType="{x:Type ScrollBar}">
-               <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
-               <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type ScrollBar}">
-                                       <Grid x:Name="GridRoot" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Background="{TemplateBinding Background}">
-                                               <Grid.RowDefinitions>
-                                                       <RowDefinition MaxHeight="18"/>
-                                                       <RowDefinition Height="0.00001*"/>
-                                                       <RowDefinition MaxHeight="18"/>
-                                               </Grid.RowDefinitions>
-                                               
-                                               <RepeatButton x:Name="DecreaseRepeat" Style="{DynamicResource SimpleRepeatButton}" Command="ScrollBar.LineUpCommand">
-                                                       <Grid>
-                                                               <Path x:Name="DecreaseArrow" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" Data="M 0 4 L 8 4 L 4 0 Z"/>
-                                                       </Grid>
-                                               </RepeatButton>
-                                               
-                                               <!-- Track is a special layout container which sizes the thumb and the repeat button which do jump scrolling either side of it -->
-                                               <Track Grid.Row="1" x:Name="PART_Track" Orientation="Vertical" IsDirectionReversed="true">
-                                                       <Track.Thumb>
-                                                               <Thumb Style="{DynamicResource SimpleThumbStyle}"/>
-                                                       </Track.Thumb>
-                                                       <Track.IncreaseRepeatButton>
-                                                               <RepeatButton x:Name="PageUp" Style="{DynamicResource SimpleScrollRepeatButtonStyle}" Command="ScrollBar.PageDownCommand"/>
-                                                       </Track.IncreaseRepeatButton>
-                                                       <Track.DecreaseRepeatButton>
-                                                               <RepeatButton x:Name="PageDown" Style="{DynamicResource SimpleScrollRepeatButtonStyle}" Command="ScrollBar.PageUpCommand"/>
-                                                       </Track.DecreaseRepeatButton>
-                                               </Track>
-                                               
-                                               <RepeatButton Grid.Row="2" x:Name="IncreaseRepeat" Style="{DynamicResource SimpleRepeatButton}" Command="ScrollBar.LineDownCommand">
-                                                       <Grid>
-                                                               <Path x:Name="IncreaseArrow" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" Data="M 0 0 L 4 4 L 8 0 Z"/>
-                                                       </Grid>
-                                               </RepeatButton>
-                                       </Grid>
-                                       
-                                       <!-- This uses a single template for ScrollBar and rotate it to be Horizontal
-                                       It also changes the commands so that the it does Left and Right instead of Up and Down Commands -->
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="Orientation" Value="Horizontal">
-
-                                                       <!-- Rotate the ScrollBar from Vertical to Horizontal -->
-                                                       <Setter Property="LayoutTransform" TargetName="GridRoot">
-                                                               <Setter.Value>
-                                                                       <RotateTransform Angle="-90"/>
-                                                               </Setter.Value>
-                                                       </Setter>
-                                                       
-                                                       <!-- Track is bound to Orientation internally, so we need to rotate it back to Vertical -->
-                                                       <Setter TargetName="PART_Track" Property="Orientation" Value="Vertical"/>
-                                       
-                                                       <!-- Change the commands to do Horizontal commands -->
-                                                       <Setter Property="Command" Value="ScrollBar.LineLeftCommand" TargetName="DecreaseRepeat"/>
-                                                       <Setter Property="Command" Value="ScrollBar.LineRightCommand" TargetName="IncreaseRepeat"/>
-                                                       <Setter Property="Command" Value="ScrollBar.PageLeftCommand" TargetName="PageDown"/>
-                                                       <Setter Property="Command" Value="ScrollBar.PageRightCommand" TargetName="PageUp"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple ScrollViewer 
-       ScrollViewer is a Grid control which has a ContentPresenter and a Horizontal and Vertical ScrollBar 
-       It is used by ListBox, MenuItem, ComboBox, and TreeView -->
-       <Style x:Key="SimpleScrollViewer" TargetType="{x:Type ScrollViewer}" BasedOn="{x:Null}">
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type ScrollViewer}">
-                                       <Grid Background="{TemplateBinding Background}">
-                                               <Grid.ColumnDefinitions>
-                                                       <ColumnDefinition Width="*"/>
-                                                       <ColumnDefinition Width="Auto"/>
-                                               </Grid.ColumnDefinitions>
-                                               <Grid.RowDefinitions>
-                                                       <RowDefinition Height="*"/>
-                                                       <RowDefinition Height="Auto"/>
-                                               </Grid.RowDefinitions>
-                                               <ScrollContentPresenter Grid.Column="0" Grid.Row="0" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}"/>
-                                               
-                                               <!-- The visibility of the ScrollBars is controlled by the implementation fo the control -->
-                                               <ScrollBar Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" Grid.Row="1" x:Name="PART_HorizontalScrollBar" Style="{DynamicResource SimpleScrollBar}" Orientation="Horizontal" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" Minimum="0" Maximum="{TemplateBinding ScrollableWidth}" />
-                                               <ScrollBar Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Grid.Row="0" x:Name="PART_VerticalScrollBar" Style="{DynamicResource SimpleScrollBar}" Orientation="Vertical" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Minimum="0" Maximum="{TemplateBinding ScrollableHeight}" />
-                                       </Grid>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple ListBox - This uses SimpleScrollViewer to allow items to be scrolled and SimpleListBoxItem to define the look of each item -->
-       <Style x:Key="SimpleListBox" TargetType="{x:Type ListBox}">
-               <Setter Property="SnapsToDevicePixels" Value="true"/>
-               <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}"/>
-               <Setter Property="BorderBrush" Value="{DynamicResource SolidBorderBrush}"/>
-               <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
-               <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
-               <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type ListBox}">
-                                       <Grid>
-                                               <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
-                                               <ScrollViewer Margin="1" Style="{DynamicResource SimpleScrollViewer}" Focusable="false" Background="{TemplateBinding Background}">
-                                                       
-                                                       <!-- The StackPanel is used to display the children by setting IsItemsHost to be Trus -->
-                                                       <StackPanel Margin="2" IsItemsHost="true"/>
-                                                       
-                                               </ScrollViewer>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsEnabled" Value="false">
-                                                       <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsGrouping" Value="true">
-                                                       <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple ListBoxItem - This is used for each Item in a ListBox. The item's content is placed in the ContentPresenter -->
-       
-       <Style x:Key="SimpleListBoxItem" d:IsControlPart="True" TargetType="{x:Type ListBoxItem}">
-               <Setter Property="SnapsToDevicePixels" Value="true"/>
-               <Setter Property="OverridesDefaultStyle" Value="true"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type ListBoxItem}">
-                                       <Grid SnapsToDevicePixels="true">
-                                               <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
-                                               <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                               
-                                               <!-- Change IsSelected SelectedBackgroundBrush to set the selection color for the items -->
-                                               <Trigger Property="IsSelected" Value="true">
-                                                       <Setter Property="Background" Value="{DynamicResource SelectedBackgroundBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               
-                                               <Trigger Property="IsEnabled" Value="false">
-                                                       <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple Expander ToggleButton - This Button is used by the Expander control. When it is toggled it switches visibility on the Up_Arrow and Down_Arrow -->
-       <ControlTemplate x:Key="ExpanderToggleButton" TargetType="{x:Type ToggleButton}">
-               <Grid>
-                       <Rectangle Margin="0,0,0,0" x:Name="Rectangle" Fill="Transparent" Stroke="{DynamicResource NormalBorderBrush}"/>
-                       <Path HorizontalAlignment="Center" x:Name="Up_Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 0 L 4 4 L 8 0 Z"/>
-                       <Path Visibility="Collapsed" HorizontalAlignment="Center" x:Name="Down_Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 4 L 4 0 L 8 4 Z"/>
-               </Grid>
-               <ControlTemplate.Triggers>
-                       <Trigger Property="IsMouseOver" Value="true">
-                               <Setter Property="Fill" Value="{DynamicResource MouseOverBrush}" TargetName="Rectangle"/>
-                       </Trigger>
-                       <Trigger Property="IsPressed" Value="true">
-                               <Setter Property="Fill" Value="{DynamicResource PressedBrush}" TargetName="Rectangle"/>
-                       </Trigger>
-                       <Trigger Property="IsChecked" Value="true">
-                               <Setter Property="Visibility" Value="Visible" TargetName="Down_Arrow"/>
-                               <Setter Property="Visibility" Value="Collapsed" TargetName="Up_Arrow"/>
-                       </Trigger>
-                       <Trigger Property="IsEnabled" Value="False">
-                               <Setter Property="Fill" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Rectangle"/>
-                               <Setter Property="Stroke" Value="{DynamicResource DisabledBorderBrush}" TargetName="Rectangle"/>
-                               <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                               <Setter Property="Fill" Value="{DynamicResource DisabledForegroundBrush}" TargetName="Up_Arrow"/>
-                       </Trigger>
-               </ControlTemplate.Triggers>
-       </ControlTemplate>
-       
-       <!-- Simple Expander 
-        This uses the Simpler ExpanderToggleButton. It sets Visibility on the ContentPresenter to expand
-        Limitations : The Simple Expander only expands down -->
-       <Style x:Key="SimpleExpander" TargetType="{x:Type Expander}">
-               <Setter Property="Background" Value="{DynamicResource LightBrush}"/>
-               <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type Expander}">
-                                       <Grid>
-                                               <Grid.RowDefinitions>
-                                                       <RowDefinition Height="Auto"/>
-                                                       <RowDefinition Height="*" x:Name="ContentRow"/>
-                                               </Grid.RowDefinitions>
-                                               <Border Grid.Row="0" x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2,2,0,0">
-                                                       <Grid>
-                                                               <Grid.ColumnDefinitions>
-                                                                       <ColumnDefinition Width="20"/>
-                                                                       <ColumnDefinition Width="*"/>
-                                                               </Grid.ColumnDefinitions>
-                                                               <ToggleButton Template="{DynamicResource ExpanderToggleButton}" Background="{DynamicResource NormalBrush}" IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" OverridesDefaultStyle="True"/>
-                                                               <ContentPresenter Grid.Column="1" Margin="4" RecognizesAccessKey="True" ContentSource="Header"/>
-                                                       </Grid>
-                                               </Border>
-                                               <Border Visibility="Collapsed" Grid.Row="1" x:Name="ExpandSite" Background="{DynamicResource WindowBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1,0,1,1" CornerRadius="0,0,2,2">
-                                                       <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Focusable="false"/>
-                                               </Border>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsExpanded" Value="True">
-                                                       <Setter Property="Visibility" Value="Visible" TargetName="ExpandSite"/>
-                                               </Trigger>
-                                               <Trigger Property="IsEnabled" Value="False">
-                                                       <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
-                                                       <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple ComboBox Toggle Button - This is used in ComboBox to expand and collapse the ComboBox Popup-->
-       <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
-               <Grid>
-                       <Grid.ColumnDefinitions>
-                               <ColumnDefinition/>
-                               <ColumnDefinition Width="20"/>
-                       </Grid.ColumnDefinitions>
-                       <Rectangle Grid.ColumnSpan="2" HorizontalAlignment="Stretch" x:Name="Rectangle" VerticalAlignment="Stretch" Width="Auto" Height="Auto" RadiusX="5" RadiusY="5" Fill="{DynamicResource NormalBrush}" Stroke="{DynamicResource NormalBorderBrush}"/>
-                       <Rectangle Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" RadiusX="5" RadiusY="5" Fill="{DynamicResource WindowBackgroundBrush}" Stroke="{DynamicResource NormalBorderBrush}"/>
-                       <Path Grid.Column="1" HorizontalAlignment="Center" x:Name="Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 0 L 4 4 L 8 0 Z"/>
-               </Grid>
-               <ControlTemplate.Triggers>
-                       <Trigger Property="IsMouseOver" Value="true">
-                               <Setter Property="Fill" Value="{DynamicResource MouseOverBrush}" TargetName="Rectangle"/>
-                       </Trigger>
-                       <Trigger Property="IsChecked" Value="true">
-                               <Setter Property="Fill" Value="{DynamicResource PressedBrush}" TargetName="Rectangle"/>
-                       </Trigger>
-                       <Trigger Property="IsEnabled" Value="False">
-                               <Setter Property="Fill" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Rectangle"/>
-                               <Setter Property="Stroke" Value="{DynamicResource DisabledBorderBrush}" TargetName="Rectangle"/>
-                               <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                               <Setter Property="Fill" Value="{DynamicResource DisabledForegroundBrush}" TargetName="Arrow"/>
-                       </Trigger>
-               </ControlTemplate.Triggers>
-       </ControlTemplate>
-       
-       <!-- This is the area which contains the selected item in the ComboBox -->
-       
-       <ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
-               <!-- This must be named as PART_ContentHost -->
-               <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}"/>
-       </ControlTemplate>
-       
-       <!-- Simple ComboBox 
-       This uses the ComboBoxToggleButton to expand and collapse a Popup control
-       SimpleScrollViewer to allow items to be scrolled and SimpleComboBoxItem to define the look of each item 
-       The Popup shows a list of items in a StackPanel-->
-       
-       <Style x:Key="SimpleComboBox" TargetType="{x:Type ComboBox}">
-               <Setter Property="SnapsToDevicePixels" Value="true"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type ComboBox}">
-                                       <Grid>
-                                               <!-- The ToggleButton is databound to the ComboBox itself to toggle IsDropDownOpen -->
-                                               <ToggleButton Grid.Column="2" Template="{DynamicResource ComboBoxToggleButton}" x:Name="ToggleButton" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"/>
-                                               <ContentPresenter HorizontalAlignment="Left" Margin="3,3,23,3" x:Name="ContentSite" VerticalAlignment="Center" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" IsHitTestVisible="False"/>
-                                               
-                                               <!-- The TextBox must be named PART_EditableTextBox or ComboBox will not recognize it -->
-                                               <TextBox Visibility="Hidden" Template="{DynamicResource ComboBoxTextBox}" HorizontalAlignment="Left" Margin="3,3,23,3" x:Name="PART_EditableTextBox" Style="{x:Null}" VerticalAlignment="Center" Focusable="True" Background="Transparent" IsReadOnly="{TemplateBinding IsReadOnly}"/>
-                                               
-                                               <!-- The Popup shows the list of items in the ComboBox. IsOpen is databound to IsDropDownOpen which is toggled via the ComboBoxToggleButton -->
-                                               <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
-                                                       <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
-                                                               <Border x:Name="DropDownBorder" Background="{DynamicResource WindowBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1"/>
-                                                               <ScrollViewer Margin="4,6,4,6" Style="{DynamicResource SimpleScrollViewer}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
-                                                       
-                                                                       <!-- The StackPanel is used to display the children by setting IsItemsHost to be True -->
-                                                                       <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/>
-                                                               
-                                                               </ScrollViewer>
-                                                       </Grid>
-                                               </Popup>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>                                              
-                                               <!-- This forces the DropDown to have a minimum size if it is empty -->
-                                               <Trigger Property="HasItems" Value="false">
-                                                       <Setter Property="MinHeight" Value="95" TargetName="DropDownBorder"/>
-                                               </Trigger>
-                                               <Trigger Property="IsEnabled" Value="false">
-                                                       <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                                               </Trigger>
-                                               <Trigger Property="IsGrouping" Value="true">
-                                                       <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
-                                               </Trigger>
-                                               <Trigger Property="AllowsTransparency" SourceName="Popup" Value="true">
-                                                       <Setter Property="CornerRadius" Value="4" TargetName="DropDownBorder"/>
-                                                       <Setter Property="Margin" Value="0,2,0,0" TargetName="DropDownBorder"/>
-                                               </Trigger>
-                                               <Trigger Property="IsEditable" Value="true">
-                                                       <Setter Property="IsTabStop" Value="false"/>
-                                                       <Setter Property="Visibility" Value="Visible" TargetName="PART_EditableTextBox"/>
-                                                       <Setter Property="Visibility" Value="Hidden" TargetName="ContentSite"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple ComboBoxItem - This is used for each item inside of the ComboBox. You can change the selected color of each item below-->
-       <Style x:Key="SimpleComboBoxItem" d:IsControlPart="True" TargetType="{x:Type ComboBoxItem}">
-               <Setter Property="SnapsToDevicePixels" Value="true"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type ComboBoxItem}">
-                                       <Grid SnapsToDevicePixels="true">
-                                               <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
-                                               <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                       
-                                               <!-- Change IsHighlighted SelectedBackgroundBrush to set the selection color for the items -->
-                                               <Trigger Property="IsHighlighted" Value="true">
-                                                       <Setter Property="Background" Value="{DynamicResource SelectedBackgroundBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                               
-                                               <Trigger Property="IsEnabled" Value="false">
-                                                       <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple SimpleProgressBar
-        The template uses two Border controls to show the Track and Progress 
-        Limitations : It only supports a horizontal orientated ProgressBar -->
-       <Style x:Key="SimpleProgressBar" TargetType="{x:Type ProgressBar}">
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type ProgressBar}">
-                                       <Grid>
-                                       
-                                               <!-- This Border is the track. It must be named PART_Track -->
-                                               <Border x:Name="PART_Track" Background="{DynamicResource PressedBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1" CornerRadius="2"/>
-                                               
-                                               <!-- This Border shows progress. It must be named PART_Indicator for the control to function -->
-                                               <Border HorizontalAlignment="Left" x:Name="PART_Indicator" Background="{DynamicResource MouseOverBrush}" BorderBrush="{DynamicResource NormalBorderBrush}" BorderThickness="1" CornerRadius="2"/>
-                                       
-                                       </Grid>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple TextBox -->
-       <Style x:Key="SimpleTextBox" TargetType="{x:Type TextBox}">
-               <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
-               <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
-               <Setter Property="AllowDrop" Value="true"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type TextBox}">
-                                       <Grid>
-                                               <Border x:Name="Border" Background="{DynamicResource WindowBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1" Padding="2" CornerRadius="2">
-                                                       
-                                                       <!-- The implementation places the Content into the ScrollViewer. It must be named PART_ContentHost for the control to function -->
-                                                       <ScrollViewer Margin="0" x:Name="PART_ContentHost" Style="{DynamicResource SimpleScrollViewer}" Background="{TemplateBinding Background}"/>
-                                               
-                                               </Border>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsEnabled" Value="False">
-                                                       <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple Label - This template is just a ContentPresenter that shows the content of the Label -->
-       <Style x:Key="SimpleLabel" TargetType="{x:Type Label}">
-               <Setter Property="HorizontalContentAlignment" Value="Left"/>
-               <Setter Property="VerticalContentAlignment" Value="Top"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type Label}">
-                                       <Grid>
-                                               <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsEnabled" Value="false"/>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple Menu - This template uses a StackPanel to layout MenuItems --> 
-       <Style x:Key="SimpleMenu" TargetType="{x:Type Menu}">
-               <Setter Property="Background" Value="{DynamicResource LightBrush}"/>
-               <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
-               <Setter Property="SnapsToDevicePixels" Value="True"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type Menu}">
-                                       <Grid>
-                                               <Border Margin="1" x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
-                                               <StackPanel Background="{TemplateBinding Background}" IsItemsHost="True" ClipToBounds="True" Orientation="Horizontal"/>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsEnabled" Value="False">
-                                                       <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- This BitmapEffect is used by the Simple MenuItem -->
-       <DropShadowBitmapEffect x:Key="PopupDropShadow" ShadowDepth="1.5" Softness="0.15"/>
-       
-       <!-- Simple MenuItem - The template uses triggers to provide four different arrangements of menu item which are set via the Role property --> 
-       <Style x:Key="SimpleMenuItem" TargetType="{x:Type MenuItem}">
-               <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
-               <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
-               <Setter Property="Background" Value="Transparent"/>
-               <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type MenuItem}">
-                                       <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
-                                               <Grid>
-                                                       
-                                                       <!-- The Grid is used to hold together columns for an Icon, Content, Glyph checkmark and Arrow to show the next level
-                                                        Size sharing is used in Grid so that the Icon, Content, Arrow for each MenuItem align together -->
-                                                       <Grid.ColumnDefinitions>
-                                                               <ColumnDefinition MinWidth="17" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
-                                                               <ColumnDefinition Width="*"/>
-                                                               <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
-                                                               <ColumnDefinition Width="14"/>
-                                                       </Grid.ColumnDefinitions>
-                                                       
-                                                       <!-- ContentPresenter to show an Icon if needed -->
-                                                       <ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
-                                                       
-                                                       <!-- Glyph is a checkmark if needed for a checkable menu -->
-                                                       <Grid Visibility="Hidden" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center">
-                                                               <Path x:Name="GlyphPanelpath" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="M0,2 L0,4.8 L2.5,7.4 L7.1,2.8 L7.1,0 L2.5,4.6 z" FlowDirection="LeftToRight"/>
-                                                       </Grid>
-                                                       
-                                                       <!-- Content for the menu text etc -->
-                                                       <ContentPresenter Grid.Column="1" Margin="{TemplateBinding Padding}" x:Name="HeaderHost" RecognizesAccessKey="True" ContentSource="Header"/>
-                                                       
-                                                       <!-- Arrow drawn path which points to the next level of the menu -->
-                                                       <Grid Grid.Column="3" Margin="4,0,6,0" x:Name="ArrowPanel" VerticalAlignment="Center">
-                                                               <Path x:Name="ArrowPanelPath" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="M0,0 L0,8 L4,4 z"/>
-                                                       </Grid>
-                                                       
-                                                       <!-- The Popup is the body of the menu which expands down or across depending on the level of the item -->
-                                                       <Popup IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" x:Name="SubMenuPopup" Focusable="false" AllowsTransparency="true" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-3">
-                                                               <Grid x:Name="SubMenu">
-                                                                       <Border x:Name="SubMenuBorder" Background="{DynamicResource WindowBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1"/>
-                                                                       
-                                                                       <!-- StackPanel holds children of the menu. This is set bu IsItemsHost=True -->
-                                                                       <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
-                                                               </Grid>
-                                                       </Popup>
-                                                       
-                                               </Grid>
-                                       </Border>
-                                       
-                                       <!-- These triggers re-configure the four arrangements of MenuItem to show different levels of menu via Role -->
-                                       <ControlTemplate.Triggers>
-                                       
-                                               <!-- Role = TopLevelHeader : this is the root menu item in a menu; the Popup expands down -->
-                                               <Trigger Property="Role" Value="TopLevelHeader">
-                                                       <Setter Property="Margin" Value="0,1,0,1"/>
-                                                       <Setter Property="Padding" Value="6,3,6,3"/>
-                                                       <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
-                                                       <Setter Property="Placement" Value="Bottom" TargetName="SubMenuPopup"/>
-                                                       <Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
-                                               </Trigger>
-                                               
-                                               <!-- Role = TopLevelItem :  this is a child menu item from the top level without any child items-->
-                                               <Trigger Property="Role" Value="TopLevelItem">
-                                                       <Setter Property="Margin" Value="0,1,0,1"/>
-                                                       <Setter Property="Padding" Value="6,3,6,3"/>
-                                                       <Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
-                                               </Trigger>
-                                               
-                                               <!-- Role = SubMenuHeader : this is a child menu item which does not have children -->
-                                               <Trigger Property="Role" Value="SubmenuHeader">
-                                                       <Setter Property="DockPanel.Dock" Value="Top"/>
-                                                       <Setter Property="Padding" Value="0,2,0,2"/>
-                                                       <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
-                                               </Trigger>
-                                               
-                                               <!-- Role = SubMenuItem : this is a child menu item which has children-->
-                                               <Trigger Property="Role" Value="SubmenuItem">
-                                                       <Setter Property="DockPanel.Dock" Value="Top"/>
-                                                       <Setter Property="Padding" Value="0,2,0,2"/>
-                                                       <Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
-                                               </Trigger>
-                                               <Trigger Property="IsSuspendingPopupAnimation" Value="true">
-                                                       <Setter Property="PopupAnimation" Value="None" TargetName="SubMenuPopup"/>
-                                               </Trigger>
-                                               
-                                               <!-- If no Icon is present the we collapse the Icon Content -->
-                                               <Trigger Property="Icon" Value="{x:Null}">
-                                                       <Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
-                                               </Trigger>
-                                               
-                                               <!-- The GlyphPanel contains the CheckMark -->
-                                               <Trigger Property="IsChecked" Value="true">
-                                                       <Setter Property="Visibility" Value="Visible" TargetName="GlyphPanel"/>
-                                                       <Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
-                                               </Trigger>
-                                               
-                                               <Trigger Property="AllowsTransparency" SourceName="SubMenuPopup" Value="true">
-                                                       <Setter Property="Margin" Value="0,0,3,3" TargetName="SubMenu"/>
-                                                       <Setter Property="SnapsToDevicePixels" Value="true" TargetName="SubMenu"/>
-                                                       <Setter Property="BitmapEffect" Value="{DynamicResource PopupDropShadow}" TargetName="SubMenuBorder"/>
-                                               </Trigger>
-                                               
-                                               <!-- Using the system colors for the Menu Highlight and IsEnabled-->
-                                               <Trigger Property="IsHighlighted" Value="true">
-                                                       <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" TargetName="Border"/>
-                                                       <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
-                                               </Trigger>
-                                               <Trigger Property="IsEnabled" Value="false">
-                                                       <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!-- Simple Separator - This template is used for a Separator in a menu --> 
-       <Style x:Key="SimpleSeparator" TargetType="{x:Type Separator}">
-               <Setter Property="Height" Value="1"/>
-               <Setter Property="Margin" Value="0,2,0,2"/>
-               <Setter Property="Focusable" Value="false"/>
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type Separator}">
-                                       <Border BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1"/>
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-
-       <!-- Simple TabControl 
-       This template uses Simple TabItem for each Tab. The TabItems are placed in the TabPanel
-       Limitations : The Simple TabControl only allow the Tabs to be shown at the top of the Tab control. You can re-position the TabPanel to change this-->
-       
-       <Style x:Key="SimpleTabControl" TargetType="{x:Type TabControl}">
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type TabControl}">
-                                       <Grid KeyboardNavigation.TabNavigation="Local">
-                                               <Grid.RowDefinitions>
-                                                       <RowDefinition Height="Auto"/>
-                                                       <RowDefinition Height="*"/>
-                                               </Grid.RowDefinitions>
-                                               
-                                               <!-- TabPanel is a layout container which allows the TabItems to wrap and re-order when selected
-                                               The implementation knows to use this control because it is marked IsItemsHost = True -->
-                                               <TabPanel Grid.Row="0" Margin="0,0,4,-1" x:Name="HeaderPanel" Background="Transparent" IsItemsHost="True" Panel.ZIndex="1" KeyboardNavigation.TabIndex="1"/>
-                                               
-                                               <Border Grid.Row="1" x:Name="Border" Background="{DynamicResource WindowBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1" CornerRadius="2" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.TabIndex="2">
-                                                       
-                                                       <!-- The implementation switches the content. This control must be named PART_SelectedContentHost -->
-                                                       <ContentPresenter Margin="4" x:Name="PART_SelectedContentHost" ContentSource="SelectedContent"/>
-                                                       
-                                               </Border>
-                                       </Grid>
-                                       
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsEnabled" Value="False">
-                                                       <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
-                                               </Trigger>
-                                       </ControlTemplate.Triggers>
-                               
-                               </ControlTemplate>
-                       </Setter.Value>
-               </Setter>
-       </Style>
-       
-       <!--Simple TabItem -->
-       <Style x:Key="SimpleTabItem" d:IsControlPart="True" TargetType="{x:Type TabItem}">
-               <Setter Property="Template">
-                       <Setter.Value>
-                               <ControlTemplate TargetType="{x:Type TabItem}">
-                                       <Grid>
-                                               <Border Margin="0,0,-4,0" x:Name="Border" Background="{DynamicResource LightBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="2,12,0,0">
-                                                       <ContentPresenter HorizontalAlignment="Center" Margin="12,2,12,2" x:Name="ContentSite" VerticalAlignment="Center" RecognizesAccessKey="True" ContentSource="Header"/>
-                                               </Border>
-                                       </Grid>
-                                       <ControlTemplate.Triggers>
-                                               <Trigger Property="IsSelected" Value="True">
-                                                       <Setter Property="Panel.ZIndex" Value="100"/>
-                                                       <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderThickness" Value="1,1,1,0" TargetName="Border"/>
-                                               </Trigger>
-                                               <Trigger Property="IsEnabled" Value="False">
-                                                       <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
-                                                       <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border"/>
-                                                       <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
-