Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into LiveChartImplemen…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
dnenov committed Jan 11, 2023
2 parents ce4a592 + f8e1f27 commit 0ee85de
Show file tree
Hide file tree
Showing 87 changed files with 1,598 additions and 382 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/dynamoNet6.0_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Build Dynamo using latest VS and DotNET
name: Dynamo-net6.0-Build
on: [push,pull_request]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout Dynamo Repo
uses: actions/checkout@v2
with:
path: Dynamo
repository: DynamoDS/Dynamo
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Install dependencies for windows runtime
run: dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.net6.sln --runtime=win10-x64
- name: Build Dynamo with MSBuild for Windows
run: |
echo "***Continue with the build, Good luck developer!***"
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\"
.\MSBuild.exe $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.net6.sln /p:Configuration=Release /p:Platform=NET60_Windows
# look for Dynamo
- name: Navigate to Dynamo Windows Folder
run: |
cd "$Env:GITHUB_WORKSPACE\Dynamo\bin\NET60_Windows\Release"
echo "***Locating DynamoCLI for Windows!***"
test ".\DynamoCLI.exe" && echo "DynamoCLI exists!"
- name: Install dependencies for linux runtime
run: dotnet restore $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.net6.sln --runtime=linux-x64
- name: Build Dynamo with MSBuild for Linux
run: |
echo "***Continue with the build, Good luck developer!***"
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\"
.\MSBuild.exe $Env:GITHUB_WORKSPACE\Dynamo\src\DynamoCore.net6.sln /p:Configuration=Release /p:Platform=NET60_Linux
- name: Navigate to Dynamo Linux Folder
run: |
cd "$Env:GITHUB_WORKSPACE\Dynamo\bin\NET60_Linux\Release"
echo "***Locating DynamoCLI for Linux!***"
test ".\DynamoCLI.exe" && echo "DynamoCLI exists!"
33 changes: 31 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DYNAMO v.2.18.0 © 2022 Autodesk, Inc. All rights reserved.
@DYNAMO v.2.18.0 © 2022 Autodesk, Inc. All rights reserved.
Dynamo License

Those portions created by Ian are provided with the following copyright:
Expand Down Expand Up @@ -563,4 +563,33 @@ https://unlicense.org/

Xceed Extended WPF Toolkit
Microsoft Public License
https://github.com/xceedsoftware/wpftoolkit/blob/0ed4ed84152d6a3e2a627f2ef05f82627fdaf3fc/license.md
https://github.com/xceedsoftware/wpftoolkit/blob/0ed4ed84152d6a3e2a627f2ef05f82627fdaf3fc/license.md

Microsoft.Web.WebView2 v.1.0.1264.42
Copyright (C) Microsoft Corporation. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* The name of Microsoft Corporation, or the names of its contributors
may not be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file removed doc/distrib/Samples/Data/DynamoSample_2021.rvt
Binary file not shown.
Binary file added doc/distrib/Samples/Data/DynamoSample_2024.rvt
Binary file not shown.
43 changes: 38 additions & 5 deletions src/Config/CS_SDK.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project>
<PropertyGroup>
<Platforms>AnyCPU;x64;NET60_Windows;NET60_Linux;</Platforms>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<PlatformTarget >x64</PlatformTarget>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">16.0</VisualStudioVersion>
<TargetFramework>net48</TargetFramework>
<FileAlignment>512</FileAlignment>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<OutputPath Condition=" '$(OutputPath)' == '' ">$(SolutionDir)..\bin\AnyCPU\$(Configuration)</OutputPath>
<BaseIntermediateOutputPath>int\</BaseIntermediateOutputPath>
<OutputPath Condition=" '$(OutputPath)' == '' ">$(SolutionDir)..\bin\$(Platform)\$(Configuration)</OutputPath>
<NunitPath Condition=" '$(NunitPath)' == '' ">$(SolutionDir)..\extern\NUnit</NunitPath>
<SharpDXDirectXVersion>DirectX11</SharpDXDirectXVersion>
<ErrorReport>prompt</ErrorReport>
Expand All @@ -19,8 +20,6 @@
<TestProjectDefaults Condition="$(MSBuildProjectDirectory.Contains('test'))">true</TestProjectDefaults>
<TestProjectDefaults Condition=" '$(TestProjectDefaults)' == '' ">false</TestProjectDefaults>
<NoWarn>MSB3539</NoWarn><!--The value of the property "BaseIntermediateOutputPath" was modified after it was used by MSBuild-->
<!--This is used to set the framework version for icon resource dll generation (lookup of system.drawing.dll)-->
<ResourceGeneration_FrameworkVersion>v4.8</ResourceGeneration_FrameworkVersion>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
Expand All @@ -34,18 +33,37 @@
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(Platform.Contains('NET60'))" >
<TargetFramework>net6.0</TargetFramework>
<!--Needed to copy nuget package assemblies to output folder. Anet6 issue-->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<GenerateDependencyFile>false</GenerateDependencyFile>
</PropertyGroup>
<PropertyGroup Condition="$(Platform.Contains('Windows'))" >
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="$(Platform.Contains('Linux'))" >
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
<BaseIntermediateOutputPath>int\$(TargetFramework)\</BaseIntermediateOutputPath>
<IntermediateOutputPath>obj\$(TargetFramework)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Remove="obj\**" />
<EmbeddedResource Remove="obj\**" />
<None Remove="obj\**" />
<None Remove="*.resources" />
<Compile Remove="int\**" />
<EmbeddedResource Remove="int\**" />
<None Remove="int\**" />
</ItemGroup>
<ItemGroup>
<Compile Condition="'$(ProjectName)'!='AssemblyInfoGenerator'" Include="$(SolutionDir)AssemblySharedInfoGenerator\AssemblySharedInfo.cs">
<Link>Properties\AssemblySharedInfo.cs</Link>
</Compile>
</ItemGroup>
<ItemDefinitionGroup>
<ItemDefinitionGroup Condition=" '$(TargetFramework)' == 'net48' ">
<ProjectReference>
<Private>false</Private>
</ProjectReference>
Expand Down Expand Up @@ -91,4 +109,19 @@
<Copy SourceFiles="@(PDBContent)" DestinationFolder="$(OutDir)$(PackagesOutputSubdirectory)" Condition="Exists('%(FullPath)')" />
<Copy SourceFiles="@(DLLContent)" DestinationFolder="$(OutDir)$(PackagesOutputSubdirectory)$(Local_CopyToSubdirectory)" Condition="Exists('%(FullPath)')" />
</Target>
<Target Name="ResolveSateliteResDeps" AfterTargets="Build" Condition=" '$(OS)' != 'Unix' ">
<!-- Get System.Drawing.dll -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
<!--This is used to set the framework version for icon resource dll generation (lookup of system.drawing.dll)-->
<ResourceGeneration_FrameworkVersion>v4.8</ResourceGeneration_FrameworkVersion>
</PropertyGroup>
<GetReferenceAssemblyPaths Condition=" '$(TargetFramework)' == 'net48' " TargetFrameworkMoniker=".NETFramework, Version=$(ResourceGeneration_FrameworkVersion)">
<Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="FrameworkAssembliesPath" />
</GetReferenceAssemblyPaths>
<PropertyGroup>
<SystemDrawingDllPath Condition=" '$(TargetFramework)' == 'net48' ">$(FrameworkAssembliesPath)System.Drawing.dll</SystemDrawingDllPath>
<!--Requires a reference to "System.Drawing.Common" Version="7.0.0" -->
<SystemDrawingDllPath Condition=" '$(TargetFramework)' == 'net60' ">$(PkgSystem_Drawing_Common)\lib\net6.0\System.Drawing.Common.dll</SystemDrawingDllPath>
</PropertyGroup>
</Target>
</Project>
18 changes: 11 additions & 7 deletions src/DocumentationBrowserViewExtension/Docs/MarkdownStyling.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,11 @@
border: 0;
margin: -2px;
text-decoration: none;
width: 24px;
height: 24px;
width: 20px;
height: 20px;
background-position: center;
opacity: 1;
display: block;
}

.button:hover {
Expand Down Expand Up @@ -403,7 +404,7 @@
overflow: hidden;
display: flex;
justify-content: center;
width: auto;
width: auto;
}

.resizable--img {
Expand All @@ -414,16 +415,19 @@
.container .btn--container {
position: absolute;
border-radius: 10%;
top: 12px;
top: 6px;
right: 6px;
box-shadow: rgba(15, 15, 15, 0.1) 2px 2px 2px 2px, rgba(15, 15, 15, 0.1) -2px -2px 2px 2px;
right: 45px;
}
.container .btn--insert--container {
position: absolute;
border-radius: 10%;
top: 12px;
top: 66px;
box-shadow: rgba(15, 15, 15, 0.1) 2px 2px 2px 2px, rgba(15, 15, 15, 0.1) -2px -2px 2px 2px;
right: 12px;
right: 6px;
}
.breadcrumb:hover{
text-decoration: underline;
}
</style>
</head>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using System.Web;
using System.Windows;
using System.Windows.Controls;
Expand All @@ -22,6 +23,8 @@ public partial class DocumentationBrowserView : UserControl, IDisposable
private readonly DocumentationBrowserViewModel viewModel;
private const string VIRTUAL_FOLDER_MAPPING = "appassets";
static readonly string HTML_IMAGE_PATH_PREFIX = @"http://";
private bool hasBeenInitialized;
private ScriptingObject comScriptingObject;

internal string WebBrowserUserDataFolder { get; set; }
internal string FallbackDirectoryName { get; set; }
Expand Down Expand Up @@ -113,49 +116,62 @@ protected virtual void Dispose(bool disposing)
this.documentationBrowser.Dispose();
}
this.documentationBrowser.DpiChanged -= DocumentationBrowser_DpiChanged;
if(this.documentationBrowser.CoreWebView2 != null)
this.documentationBrowser.CoreWebView2.WebMessageReceived -= CoreWebView2OnWebMessageReceived;
try
{
if (this.documentationBrowser.CoreWebView2 != null)
this.documentationBrowser.CoreWebView2.WebMessageReceived -= CoreWebView2OnWebMessageReceived;

}
catch (Exception)
{
return;
}
}

async void InitializeAsync()
{
if (!string.IsNullOrEmpty(WebBrowserUserDataFolder))
// Only initialize once
if (!hasBeenInitialized)
{
//This indicates in which location will be created the WebView2 cache folder
documentationBrowser.CreationProperties = new CoreWebView2CreationProperties()
if (!string.IsNullOrEmpty(WebBrowserUserDataFolder))
{
UserDataFolder = WebBrowserUserDataFolder
};
//This indicates in which location will be created the WebView2 cache folder
documentationBrowser.CreationProperties = new CoreWebView2CreationProperties()
{
UserDataFolder = WebBrowserUserDataFolder
};
}

//Initialize the CoreWebView2 component otherwise we can't navigate to a web page
await documentationBrowser.EnsureCoreWebView2Async();

//Due that the Web Browser(WebView2 - Chromium) security CORS is blocking the load of resources like images then we need to create a virtual folder in which the image are located.
this.documentationBrowser.CoreWebView2.SetVirtualHostNameToFolderMapping(VIRTUAL_FOLDER_MAPPING, FallbackDirectoryName, CoreWebView2HostResourceAccessKind.DenyCors);
this.documentationBrowser.CoreWebView2.WebMessageReceived += CoreWebView2OnWebMessageReceived;
comScriptingObject = new ScriptingObject(this.viewModel);
//register the interop object into the browser.
this.documentationBrowser.CoreWebView2.AddHostObjectToScript("bridge", comScriptingObject);

this.documentationBrowser.CoreWebView2.Settings.IsZoomControlEnabled = true;
this.documentationBrowser.CoreWebView2.Settings.AreDevToolsEnabled = true;

hasBeenInitialized = true;
}

//Initialize the CoreWebView2 component otherwise we can't navigate to a web page
await documentationBrowser.EnsureCoreWebView2Async();

//Due that the Web Browser(WebView2 - Chromium) security CORS is blocking the load of resources like images then we need to create a virtual folder in which the image are located.
this.documentationBrowser.CoreWebView2.SetVirtualHostNameToFolderMapping(VIRTUAL_FOLDER_MAPPING, FallbackDirectoryName, CoreWebView2HostResourceAccessKind.DenyCors);

string htmlContent = this.viewModel.GetContent();

Dispatcher.BeginInvoke(new Action(() =>
{
this.documentationBrowser.NavigateToString(htmlContent);
}));

this.documentationBrowser.CoreWebView2.WebMessageReceived += CoreWebView2OnWebMessageReceived;
this.documentationBrowser.CoreWebView2.Settings.IsZoomControlEnabled = true;
this.documentationBrowser.CoreWebView2.Settings.AreDevToolsEnabled = true;
}

private void CoreWebView2OnWebMessageReceived(object sender, CoreWebView2WebMessageReceivedEventArgs e)
{
var message = e.TryGetWebMessageAsString();
if (string.Equals(message, "insert"))
{
// Insert the graph inside the current worskspace
this.viewModel.InsertGraph();
}
comScriptingObject.Notify(message);
}

/// <summary>
/// Dispose function for DocumentationBrowser
/// </summary>
Expand Down
Loading

0 comments on commit 0ee85de

Please sign in to comment.