| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + [submodule "CefSharp.Wpf.HwndHost"] | ||
| 2 | + path = CefSharp.Wpf.HwndHost | ||
| 3 | + url = https://github.com/cefsharp/CefSharp.Wpf.HwndHost.git | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,9 @@ | |||
| 6 | 6 | using CefSharp.Example; | |
| 7 | 7 | using CefSharp.Example.Handlers; | |
| 8 | 8 | using CefSharp.Wpf.Example.Handlers; | |
| 9 | - | ||
| 9 | + #if CEFSHARP_WPF_HWNDHOST | ||
| 10 | + using CefSharp.Wpf.HwndHost; | ||
| 11 | + #endif | ||
| 10 | 12 | namespace CefSharp.Wpf.Example | |
| 11 | 13 | { | |
| 12 | 14 | public partial class App : Application | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,10 +35,12 @@ | |||
| 35 | 35 | <SelfContained Condition="'$(Configuration)' == 'Debug'">false</SelfContained> | |
| 36 | 36 | </PropertyGroup> | |
| 37 | 37 | ||
| 38 | + <PropertyGroup Condition="'False'"> | ||
| 39 | + <DefineConstants>$(DefineConstants);CEFSHARP_WPF_HWNDHOST</DefineConstants> | ||
| 40 | + </PropertyGroup> | ||
| 38 | 41 | <ItemGroup> | |
| 39 | 42 | <ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.csproj" /> | |
| 40 | 43 | <ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" /> | |
| 41 | - <ProjectReference Include="..\CefSharp.Wpf\CefSharp.Wpf.netcore.csproj" /> | ||
| 42 | 44 | <ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" /> | |
| 43 | 45 | <PackageReference Include="chromiumembeddedframework.runtime" Version="129.0.11" /> | |
| 44 | 46 | <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0"> | |
@@ -49,6 +51,18 @@ | |||
| 49 | 51 | <PackageReference Include="MaterialDesignThemes" Version="4.8.0" /> | |
| 50 | 52 | </ItemGroup> | |
| 51 | 53 | ||
| 54 | + <Choose> | ||
| 55 | + <When Condition="$(DefineConstants.Contains(CEFSHARP_WPF_HWNDHOST))"> | ||
| 56 | + <ItemGroup> | ||
| 57 | + <ProjectReference Include="..\CefSharp.Wpf.HwndHost\CefSharp.Wpf.HwndHost\CefSharp.Wpf.HwndHost.csproj" /> | ||
| 58 | + </ItemGroup> | ||
| 59 | + </When> | ||
| 60 | + <Otherwise> | ||
| 61 | + <ItemGroup> | ||
| 62 | + <ProjectReference Include="..\CefSharp.Wpf\CefSharp.Wpf.netcore.csproj" /> | ||
| 63 | + </ItemGroup> | ||
| 64 | + </Otherwise> | ||
| 65 | + </Choose> | ||
| 52 | 66 | <ItemGroup> | |
| 53 | 67 | <None Include="crash_reporter.cfg"> | |
| 54 | 68 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,7 @@ | |||
| 3 | 3 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | |
| 4 | 4 | ||
| 5 | 5 | using System.Windows; | |
| 6 | + using CefSharp.Wpf.Example.Controls; | ||
| 6 | 7 | ||
| 7 | 8 | namespace CefSharp.Wpf.Example | |
| 8 | 9 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -97,7 +97,7 @@ public Task<InteropBitmap> TakeScreenshot(Size screenshotSize, int? frameRate = | |||
| 97 | 97 | ||
| 98 | 98 | return screenshotTaskCompletionSource.Task; | |
| 99 | 99 | } | |
| 100 | - | ||
| 100 | + #if ! CEFSHARP_WPF_HWNDHOST | ||
| 101 | 101 | protected override CefSharp.Structs.Rect GetViewRect() | |
| 102 | 102 | { | |
| 103 | 103 | if (isTakingScreenshot) | |
@@ -161,7 +161,7 @@ protected override void OnPaint(bool isPopup, Structs.Rect dirtyRect, IntPtr buf | |||
| 161 | 161 | base.OnPaint(isPopup, dirtyRect, buffer, width, height); | |
| 162 | 162 | } | |
| 163 | 163 | } | |
| 164 | - | ||
| 164 | + #endif | ||
| 165 | 165 | private void TakeScreenshot() | |
| 166 | 166 | { | |
| 167 | 167 | var uiThreadTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,9 @@ | |||
| 4 | 4 | using System.Windows.Automation.Peers; | |
| 5 | 5 | using System.Windows.Controls; | |
| 6 | 6 | using System.Windows.Controls.Primitives; | |
| 7 | + #if ! CEFSHARP_WPF_HWNDHOST | ||
| 7 | 8 | using TabControlAutomationPeer = CefSharp.Wpf.Experimental.Accessibility.TabControlAutomationPeer; | |
| 9 | + #endif | ||
| 8 | 10 | ||
| 9 | 11 | namespace CefSharp.Wpf.Example.Controls | |
| 10 | 12 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + using System; | ||
| 2 | + using System.Collections.Generic; | ||
| 3 | + using System.Linq; | ||
| 4 | + using System.Text; | ||
| 5 | + using System.Threading.Tasks; | ||
| 6 | + #if CEFSHARP_WPF_HWNDHOST | ||
| 7 | + using CefSharp.Wpf.HwndHost; | ||
| 8 | + #endif | ||
| 9 | + namespace CefSharp.Wpf.Example.Controls | ||
| 10 | + { | ||
| 11 | + public class ChromiumWebBrowser : | ||
| 12 | + #if CEFSHARP_WPF_HWNDHOST | ||
| 13 | + CefSharp.Wpf.HwndHost.ChromiumWebBrowser | ||
| 14 | + #else | ||
| 15 | + CefSharp.Wpf.ChromiumWebBrowser | ||
| 16 | + #endif | ||
| 17 | + { | ||
| 18 | + public ChromiumWebBrowser(string initialAddress) : base(initialAddress){ } | ||
| 19 | + public ChromiumWebBrowser() { } | ||
| 20 | + } | ||
| 21 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,7 @@ | |||
| 2 | 2 | // | |
| 3 | 3 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | |
| 4 | 4 | ||
| 5 | + using CefSharp.Wpf.Example.Controls; | ||
| 5 | 6 | using CefSharp.Wpf.Example.Views; | |
| 6 | 7 | using System; | |
| 7 | 8 | using System.Windows; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,7 @@ | |||
| 3 | 3 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | |
| 4 | 4 | ||
| 5 | 5 | using System.Windows; | |
| 6 | + using CefSharp.Wpf.Example.Controls; | ||
| 6 | 7 | ||
| 7 | 8 | namespace CefSharp.Wpf.Example.Handlers | |
| 8 | 9 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,7 @@ | |||
| 3 | 3 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | |
| 4 | 4 | ||
| 5 | 5 | using System; | |
| 6 | + #if ! CEFSHARP_WPF_HWNDHOST | ||
| 6 | 7 | using CefSharp.Wpf.Handler; | |
| 7 | 8 | ||
| 8 | 9 | namespace CefSharp.Wpf.Example.Handlers | |
@@ -46,3 +47,5 @@ protected override void ExecuteCommand(IBrowser browser, ContextMenuExecuteModel | |||
| 46 | 47 | } | |
| 47 | 48 | } | |
| 48 | 49 | } | |
| 50 | + | ||
| 51 | + #endif | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments