-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Update Connect WPF Sample? #3724
base: main
Are you sure you want to change the base?
Changes from all commits
d192b56
9e41d23
292c575
fdc059e
bd67bf0
b92442f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<Project> | ||
<!-- Only here so that the default Directory.Build.props will not be used. --> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.DotNet.Interactive.Commands; | ||
using System.Threading.Tasks; | ||
using System; | ||
|
||
namespace WpfConnect; | ||
|
||
public class DispatcherCommand : KernelCommand | ||
{ | ||
public DispatcherCommand( | ||
string enabled, | ||
string targetKernelName = null) : base(targetKernelName) | ||
{ | ||
if (string.IsNullOrWhiteSpace(enabled)) | ||
{ | ||
throw new ArgumentException("Value cannot be null or whitespace.", nameof(enabled)); | ||
} | ||
|
||
Enabled = enabled; | ||
} | ||
|
||
public string Enabled { get; } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,9 @@ | |
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.DotNet.Interactive.CSharp" Version="1.0.0-beta.23403.1" /> | ||
<ProjectReference Include="..\..\src\Microsoft.DotNet.Interactive.CSharp\Microsoft.DotNet.Interactive.CSharp.csproj" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be package references and not project references. |
||
<ProjectReference Include="..\..\src\Microsoft.DotNet.Interactive.NamedPipeConnector\Microsoft.DotNet.Interactive.NamedPipeConnector.csproj" /> | ||
<ProjectReference Include="..\..\src\Microsoft.DotNet.Interactive.PackageManagement\Microsoft.DotNet.Interactive.PackageManagement.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,9 @@ | |
} | ||
], | ||
"source": [ | ||
"#i \"nuget:I:\\oss\\dotnetinteractive\\artifacts\\packages\\Debug\\Shipping\"\n", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Referencing a hard-coded path won't work for most people, and we don't want to expect people to build the solution in any case. |
||
"#r \"nuget:Microsoft.DotNet.Interactive.Documents,*-*\"\n", | ||
"#r \"nuget:Microsoft.DotNet.Interactive.NamedPipeConnector,*-*\"\n", | ||
"#!connect named-pipe --kernel-name wpf --pipe-name InteractiveWpf" | ||
] | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!csharp | ||
|
||
Microsoft.DotNet.Interactive.NamedPipeConnector.ConnectNamedPipeCommand.AddToRootKernel(); | ||
await Microsoft.DotNet.Interactive.NamedPipeConnector.ConnectNamedPipeDirective.AddToRootKernel(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been keeping samples out of the solution. Ideally the samples build against NuGet packages, since most people using them won't be building this code.