Skip to content

Instantly share code, notes, and snippets.

View amaitland's full-sized avatar

Alex Maitland amaitland

  • Australia
View GitHub Profile
@amaitland
amaitland / Directory.Build.targets
Created June 20, 2022 06:32
NETSDK1145 - Update KnownAppHostPack AppHostPackVersion
<Project>
<!--
Update AppHostPackVersion for .net core 3.1
https://docs.microsoft.com/en-gb/dotnet/core/tools/sdk-errors/netsdk1145
https://developercommunity.visualstudio.com/t/netsdk1145-the-apphost-pack-is-not-installed-error/1513220
-->
<ItemGroup>
<KnownAppHostPack Update="@(KnownAppHostPack)">
<AppHostPackVersion Condition="'%(TargetFramework)' == 'netcoreapp3.1'">3.1.26</AppHostPackVersion>
</KnownAppHostPack>
@amaitland
amaitland / FolderProfile.pubxml
Created April 27, 2021 01:12
MinimalExample WPF Publish Net Core 3.1 Release x64
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<PublishDir>bin.netcore\Release\netcoreapp3.1\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
@amaitland
amaitland / SchemeHandlerFacotry.cs
Created June 18, 2020 04:53
AccessControlAllowOriginHeader
var resourceStream = executingAssembly.GetManifestResourceStream(resourcePath);
var memoryStream = new MemoryStream();
resourceStream.CopyTo(memoryStream);
resourceStream.Close();
memoryStream.Position = 0;
//Add the Access-Control-Allow-Origin header
var resourceHandler = ResourceHandler.FromStream(memoryStream);
resourceHandler.Headers.Add("Access-Control-Allow-Origin", "*");
using System.Reflection;
using System.Windows;
namespace CefSharp.MinimalExample.Wpf
{
public partial class MainWindow : Window
{
private bool _firstTime = true;
public MainWindow()
@amaitland
amaitland / Directory.Build.props
Created February 1, 2020 02:12
Global VS Build Properties(Directory.Build.props)
<!--
https://github.com/dotnet/sdk/issues/1518#issuecomment-324638682
-->
<Project>
<PropertyGroup>
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
</PropertyGroup>
</Project>
@amaitland
amaitland / app.manifest.xml
Created October 5, 2019 11:26 — forked from emoacht/app.manifest.xml
Application manifest for Per Monitor V2
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- Per Monitor V1 [OS >= Windows 8.1]
Values: False, True, Per-monitor, True/PM -->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
true/PM</dpiAware>
<!-- Per Monitor V1 [OS >= Windows 10 Anniversary Update (1607, 10.0.14393, Redstone 1)]
Values: Unaware, System, PerMonitor -->
<!-- Per Monitor V2 [OS >= Windows 10 Creators Update (1703, 10.0.15063, Redstone 2)]
Value: PerMonitorV2 -->
@amaitland
amaitland / CustomChromiumWebBrowser.cs
Last active August 26, 2019 01:46
WPF ChromiumWebBrowser Load before attaching to visual tree
using CefSharp.Wpf;
using System;
namespace CefSharp.MinimalExample.Wpf
{
/// <summary>
/// ChromiumWebBrowser that loads before being attached to the visual tree
/// </summary>
/// <example>
/// <code>
@amaitland
amaitland / CustomFolderSchemeHandlerFactory.cs
Last active July 30, 2019 10:39
Scheme Handler Examples
using System;
using System.IO;
using System.Net;
namespace CefSharp.MinimalExample.WinForms
{
//This class would only be used if you choose Option #2
public class CustomFolderSchemeHandlerFactory : ISchemeHandlerFactory
{
private readonly string rootFolder;
// Copyright © 2019 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using CefSharp.Enums;
@amaitland
amaitland / FundingProposal.md
Last active January 3, 2018 07:40
Funding Proposal for CefSharp release

Funding Proposal for CefSharp 63.0.0 release

Update

I've created a Patreon page at https://www.patreon.com/amaitland

All details are outlined there, work is underway!

--