From 39c2e65632e3520d5daaf61facbcc0bf7cf3a99e Mon Sep 17 00:00:00 2001 From: "matteo@cominetti.org" Date: Fri, 30 Aug 2019 15:55:40 +0100 Subject: [PATCH 01/13] added start process binding --- SpeckleUiBase/SpeckleUiBindings.cs | 29 ++++++++++++++++++++++++-- SpeckleUiTester/App.xaml.cs | 20 +++++++++--------- SpeckleUiTester/SpeckleUiTester.csproj | 10 ++++----- 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/SpeckleUiBase/SpeckleUiBindings.cs b/SpeckleUiBase/SpeckleUiBindings.cs index 4cd9825..85c011f 100644 --- a/SpeckleUiBase/SpeckleUiBindings.cs +++ b/SpeckleUiBase/SpeckleUiBindings.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -73,11 +74,29 @@ public string GetAccounts() return JsonConvert.SerializeObject( SpeckleCore.LocalContext.GetAllAccounts() ); } + public void StartProcess(string args) + { + try + { + Process.Start(args); + } + catch (Exception e) + { + + } + + } + + + + #region abstract methods + public abstract string GetApplicationHostName(); public abstract string GetFileName(); public abstract string GetDocumentId(); public abstract string GetDocumentLocation(); + /// /// Returns the serialised clients present in the current open host file. /// @@ -89,6 +108,11 @@ public string GetAccounts() /// public abstract void AddSender( string args ); + /// + /// Updates a sender and persits the info to the host file + /// + public abstract void UpdateSender(string args); + /// /// Adds the current selection to the provided client. /// @@ -117,8 +141,6 @@ public string GetAccounts() /// public abstract void BakeReceiver( string args ); - public abstract void UpdateSender( string args ); - // TODO: See how we go about this public abstract void AddObjectsToSender( string args ); public abstract void RemoveObjectsFromSender( string args ); @@ -128,5 +150,8 @@ public string GetAccounts() /// /// public abstract void SelectClientObjects( string args ); + + #endregion + } } diff --git a/SpeckleUiTester/App.xaml.cs b/SpeckleUiTester/App.xaml.cs index 11019dc..9242ccd 100644 --- a/SpeckleUiTester/App.xaml.cs +++ b/SpeckleUiTester/App.xaml.cs @@ -19,10 +19,10 @@ public partial class App : Application private void Application_Startup( object sender, StartupEventArgs e ) { -#if DEBUG - UiWindow = new SpeckleUiWindow( new TestBindings(), @"http://10.211.55.2:8080/#/" ); -#else - UiWindow = new SpeckleUiWindow( new TestBindings() ); // On release, default to the latest ci-ed version from https://appui.speckle.systems +#if DEBUG + UiWindow = new SpeckleUiWindow( new TestBindings(), @"http://localhost:8080/#/"); +#else + UiWindow = new SpeckleUiWindow( new TestBindings() ); // On release, default to the latest ci-ed version from https://appui.speckle.systems #endif UiWindow.Show(); @@ -55,7 +55,12 @@ public override void AddReceiver( string _args ) public override void AddSender( string args ) { - throw new NotImplementedException(); + //throw new NotImplementedException(); + } + + public override void UpdateSender(string args) + { + //throw new NotImplementedException(); } public override void BakeReceiver( string args ) @@ -116,11 +121,6 @@ public override void RemoveSelectionFromSender( string args ) throw new NotImplementedException(); } - public override void UpdateSender( string args ) - { - throw new NotImplementedException(); - } - public override void SelectClientObjects( string args ) { throw new NotImplementedException(); diff --git a/SpeckleUiTester/SpeckleUiTester.csproj b/SpeckleUiTester/SpeckleUiTester.csproj index 886097c..2c424ab 100644 --- a/SpeckleUiTester/SpeckleUiTester.csproj +++ b/SpeckleUiTester/SpeckleUiTester.csproj @@ -143,11 +143,11 @@ - + + + From 96088d414a1d8ad61fbedbe5f867eb692e685536 Mon Sep 17 00:00:00 2001 From: "matteo.cominetti" Date: Tue, 3 Sep 2019 13:59:33 +0100 Subject: [PATCH 02/13] wip filters --- SpeckleUiBase/SelectionFilter.cs | 50 ++++++++++++++++++++++++++++++ SpeckleUiBase/SpeckleUiBase.csproj | 1 + SpeckleUiBase/SpeckleUiBindings.cs | 7 +++++ SpeckleUiTester/App.xaml.cs | 38 +++++++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 SpeckleUiBase/SelectionFilter.cs diff --git a/SpeckleUiBase/SelectionFilter.cs b/SpeckleUiBase/SelectionFilter.cs new file mode 100644 index 0000000..98859c7 --- /dev/null +++ b/SpeckleUiBase/SelectionFilter.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SpeckleUiBase +{ + public interface ISelectionFilter + { + string Name { get; set; } + string Icon { get; set; } + string Type { get; } + } + + public class ElementsSelectionFilter : ISelectionFilter + { + public string Name { get; set; } + public string Icon { get; set; } + public string Type { get { return typeof(ElementsSelectionFilter).ToString(); } } + + public int Count { get; set; } + } + + public class ListSelectionFilter : ISelectionFilter + { + public string Name { get; set; } + public string Icon { get; set; } + public string Type { get { return typeof(ListSelectionFilter).ToString(); } } + + public List Values { get; set; } + public List Selection = new List(); + } + + public class CustomSelectionFilter : ISelectionFilter + { + public string Name { get; set; } + public string Icon { get; set; } + public string Type { get { return typeof(CustomSelectionFilter).ToString(); } } + + public List Values { get; set; } + public List Selection = new List(); + } + + + + + + +} diff --git a/SpeckleUiBase/SpeckleUiBase.csproj b/SpeckleUiBase/SpeckleUiBase.csproj index 035dbd2..4c3cb34 100644 --- a/SpeckleUiBase/SpeckleUiBase.csproj +++ b/SpeckleUiBase/SpeckleUiBase.csproj @@ -111,6 +111,7 @@ + diff --git a/SpeckleUiBase/SpeckleUiBindings.cs b/SpeckleUiBase/SpeckleUiBindings.cs index 85c011f..53c6668 100644 --- a/SpeckleUiBase/SpeckleUiBindings.cs +++ b/SpeckleUiBase/SpeckleUiBindings.cs @@ -74,6 +74,11 @@ public string GetAccounts() return JsonConvert.SerializeObject( SpeckleCore.LocalContext.GetAllAccounts() ); } + public string GetFilters() + { + return JsonConvert.SerializeObject(GetSelectionFilters()); + } + public void StartProcess(string args) { try @@ -151,6 +156,8 @@ public void StartProcess(string args) /// public abstract void SelectClientObjects( string args ); + public abstract List GetSelectionFilters(); + #endregion } diff --git a/SpeckleUiTester/App.xaml.cs b/SpeckleUiTester/App.xaml.cs index 9242ccd..9bba3fd 100644 --- a/SpeckleUiTester/App.xaml.cs +++ b/SpeckleUiTester/App.xaml.cs @@ -125,6 +125,44 @@ public override void SelectClientObjects( string args ) { throw new NotImplementedException(); } + + public override List GetSelectionFilters() + { + return new List + { + new ElementsSelectionFilter + { + Name = "Selection", + Icon = "mouse", + Count = 99 + }, + new ListSelectionFilter + { + Name = "Category", + Icon = "category", + Values = new List + { + "Walls", + "Doors", + "Floors", + "Structural Elements", + "Dimitries", + "Lols" + } + }, + new CustomSelectionFilter + { + Name = "Property", + Icon = "filter_list", + Values = new List + { + "Family Name", + "Family Type", + "Custom", + } + } + }; + } } } From 7540fd29c7717644d83ae3e03662986cf84ad313 Mon Sep 17 00:00:00 2001 From: "matteo.cominetti" Date: Tue, 3 Sep 2019 14:10:28 +0100 Subject: [PATCH 03/13] fixed prerelease stuff --- SpeckleUiBase/Properties/AssemblyInfo.cs | 1 + SpeckleUiBase/SpeckleUiBase.csproj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SpeckleUiBase/Properties/AssemblyInfo.cs b/SpeckleUiBase/Properties/AssemblyInfo.cs index 9b44237..43ae7b3 100644 --- a/SpeckleUiBase/Properties/AssemblyInfo.cs +++ b/SpeckleUiBase/Properties/AssemblyInfo.cs @@ -34,3 +34,4 @@ // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyInformationalVersion("1.0.0.0")] diff --git a/SpeckleUiBase/SpeckleUiBase.csproj b/SpeckleUiBase/SpeckleUiBase.csproj index 4c3cb34..d880212 100644 --- a/SpeckleUiBase/SpeckleUiBase.csproj +++ b/SpeckleUiBase/SpeckleUiBase.csproj @@ -43,7 +43,7 @@ true bin\Debug\ DEBUG;TRACE - full + portable x64 prompt MinimumRecommendedRules.ruleset From 63782d16307ed17658f528a27d79ba23292be8dc Mon Sep 17 00:00:00 2001 From: "matteo.cominetti" Date: Tue, 3 Sep 2019 18:51:34 +0100 Subject: [PATCH 04/13] updated property filter --- SpeckleUiBase/SelectionFilter.cs | 8 ++- SpeckleUiTester/App.xaml.cs | 6 +- appveyor.yml | 104 +++++++++++++++---------------- 3 files changed, 60 insertions(+), 58 deletions(-) diff --git a/SpeckleUiBase/SelectionFilter.cs b/SpeckleUiBase/SelectionFilter.cs index 98859c7..1813635 100644 --- a/SpeckleUiBase/SelectionFilter.cs +++ b/SpeckleUiBase/SelectionFilter.cs @@ -32,14 +32,16 @@ public class ListSelectionFilter : ISelectionFilter public List Selection = new List(); } - public class CustomSelectionFilter : ISelectionFilter + public class PropertySelectionFilter : ISelectionFilter { public string Name { get; set; } public string Icon { get; set; } - public string Type { get { return typeof(CustomSelectionFilter).ToString(); } } + public string Type { get { return typeof(PropertySelectionFilter).ToString(); } } public List Values { get; set; } - public List Selection = new List(); + public string PropertyName { get; set; } + public string PropertyValue { get; set; } + public bool HasCustomProperty { get; set; } } diff --git a/SpeckleUiTester/App.xaml.cs b/SpeckleUiTester/App.xaml.cs index 9bba3fd..b8a69f9 100644 --- a/SpeckleUiTester/App.xaml.cs +++ b/SpeckleUiTester/App.xaml.cs @@ -150,15 +150,15 @@ public override List GetSelectionFilters() "Lols" } }, - new CustomSelectionFilter + new PropertySelectionFilter { Name = "Property", Icon = "filter_list", + HasCustomProperty = true, Values = new List { "Family Name", - "Family Type", - "Custom", + "Family Type" } } }; diff --git a/appveyor.yml b/appveyor.yml index 4689e29..6e55f75 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,55 +1,55 @@ -version: '{build}' -image: Visual Studio 2019 - -init: - - ps: | - If($Env:APPVEYOR_REPO_TAG -eq "true") - { - Write-Host "We now have a tagged release. Proper." - Write-Host "Tag is $Env:APPVEYOR_REPO_TAG_NAME" +version: '{build}' +image: Visual Studio 2019 + +init: + - ps: | + If($Env:APPVEYOR_REPO_TAG -eq "true") + { + Write-Host "We now have a tagged release. Proper." + Write-Host "Tag is $Env:APPVEYOR_REPO_TAG_NAME" $env:APPVEYOR_BUILD_VERSION=$env:APPVEYOR_REPO_TAG_NAME Update-AppveyorBuild -Version "$Env:APPVEYOR_REPO_TAG_NAME" - } - else - { - $releases = "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/releases" - $tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name - $spl = $tag.Split("-")[0] + } + else + { + $releases = "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/releases" + $tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name + $spl = $tag.Split("-")[0] Update-AppveyorBuild -Version "$spl.$Env:APPVEYOR_BUILD_VERSION-wip" - } - Write-Host "Hello. Build version for SpeckleUiBase is: $Env:APPVEYOR_BUILD_VERSION" - -before_build: -- cmd: >- - nuget restore -# version -assembly_info: - patch: true - file: AssemblyInfo.* - assembly_version: '{version}' - assembly_file_version: '{version}' - assembly_informational_version: '{version}' - -build: - publish_nuget: true - include_nuget_references: true - publish_nuget_symbols: true - use_snupkg_format: true - project: SpeckleUiBase\SpeckleUiBase.csproj - verbosity: minimal - -deploy: - - provider: NuGet - server: # remove to push to NuGet.org - api_key: - secure: n4EiHDLVSLjOzqT7OOOg3US3PWs6fNsOaGpyT/EFBKrTKl/1wMmmKt73MNuTngD+ - skip_symbols: false - symbol_server: # remove to push symbols to SymbolSource.org - on: - appveyor_repo_tag: true - -platform: - - x64 - -configuration: - - Release + } + Write-Host "Hello. Build version for SpeckleUiBase is: $Env:APPVEYOR_BUILD_VERSION" + +before_build: +- cmd: >- + nuget restore +# version +assembly_info: + patch: true + file: AssemblyInfo.* + assembly_version: '{version}' + assembly_file_version: '{version}' + assembly_informational_version: '{version}' + +build: + publish_nuget: true + include_nuget_references: true + publish_nuget_symbols: true + use_snupkg_format: true + project: SpeckleUiBase\SpeckleUiBase.csproj + verbosity: minimal + +deploy: + - provider: NuGet + server: # remove to push to NuGet.org + api_key: + secure: n4EiHDLVSLjOzqT7OOOg3US3PWs6fNsOaGpyT/EFBKrTKl/1wMmmKt73MNuTngD+ + skip_symbols: false + symbol_server: # remove to push symbols to SymbolSource.org + on: + appveyor_repo_tag: true + +platform: + - x64 + +configuration: + - Release From 81080c18424f4e8e7989c052b56b44fcbbbe3ce2 Mon Sep 17 00:00:00 2001 From: "matteo.cominetti" Date: Thu, 5 Sep 2019 18:12:21 +0100 Subject: [PATCH 05/13] added pushsender binding --- SpeckleUiBase/SpeckleUiBindings.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SpeckleUiBase/SpeckleUiBindings.cs b/SpeckleUiBase/SpeckleUiBindings.cs index 53c6668..3b7ddac 100644 --- a/SpeckleUiBase/SpeckleUiBindings.cs +++ b/SpeckleUiBase/SpeckleUiBindings.cs @@ -118,6 +118,11 @@ public void StartProcess(string args) /// public abstract void UpdateSender(string args); + /// + /// Pushes a sender's stream + /// + public abstract void PushSender(string args); + /// /// Adds the current selection to the provided client. /// From 9f1beb1e8eee4dae3ea6e55a758b3a85f5deb779 Mon Sep 17 00:00:00 2001 From: "matteo@cominetti.org" Date: Mon, 16 Sep 2019 17:30:23 +0100 Subject: [PATCH 06/13] added operator on prop filter --- SpeckleUiBase/SelectionFilter.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SpeckleUiBase/SelectionFilter.cs b/SpeckleUiBase/SelectionFilter.cs index 1813635..3581f81 100644 --- a/SpeckleUiBase/SelectionFilter.cs +++ b/SpeckleUiBase/SelectionFilter.cs @@ -39,8 +39,10 @@ public class PropertySelectionFilter : ISelectionFilter public string Type { get { return typeof(PropertySelectionFilter).ToString(); } } public List Values { get; set; } + public List Operators { get; set; } public string PropertyName { get; set; } public string PropertyValue { get; set; } + public string PropertyOperator { get; set; } public bool HasCustomProperty { get; set; } } From e032b3cb86ae04fda5adc6ad9d5c7f48364e3540 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Tue, 17 Sep 2019 10:43:53 +0300 Subject: [PATCH 07/13] adds netlify status badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d587279..5f5bc9e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Netlify Status](https://api.netlify.com/api/v1/badges/e4824a5c-a6df-4670-b242-4873d26901ba/deploy-status)](https://app.netlify.com/sites/distracted-jones-770c28/deploys) + # SpeckleUi Base speckle ui for embedding in .net apps. It consists of two parts, a .NET scaffold (this repo), and vuejs web app (can be found [here](https://github.com/speckleworks/SpeckleUiApp)). From a21c6a07747a9112605ac419b1268ad5d6b1d5ba Mon Sep 17 00:00:00 2001 From: "matteo@cominetti.org" Date: Wed, 18 Sep 2019 14:15:16 +0100 Subject: [PATCH 08/13] updated ElementsSelectionFilter to hold a list of ids --- SpeckleUiBase/SelectionFilter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpeckleUiBase/SelectionFilter.cs b/SpeckleUiBase/SelectionFilter.cs index 3581f81..47913b8 100644 --- a/SpeckleUiBase/SelectionFilter.cs +++ b/SpeckleUiBase/SelectionFilter.cs @@ -19,7 +19,7 @@ public class ElementsSelectionFilter : ISelectionFilter public string Icon { get; set; } public string Type { get { return typeof(ElementsSelectionFilter).ToString(); } } - public int Count { get; set; } + public List Selection = new List(); } public class ListSelectionFilter : ISelectionFilter From a75a745207eaae9e25f1a3e67df5fb02107b0a80 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Tue, 15 Oct 2019 14:52:37 +0100 Subject: [PATCH 09/13] UiBindings base abstract class now declares the Browser as an IWebBrowser to smooth compat between wpf (revit) and winforms (rhino) versions of cefsharp --- SpeckleUiBase/SpeckleUiBindings.cs | 2 +- SpeckleUiBase/SpeckleUiWindow.xaml.cs | 2 +- SpeckleUiTester/App.xaml.cs | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/SpeckleUiBase/SpeckleUiBindings.cs b/SpeckleUiBase/SpeckleUiBindings.cs index 3b7ddac..baa19d5 100644 --- a/SpeckleUiBase/SpeckleUiBindings.cs +++ b/SpeckleUiBase/SpeckleUiBindings.cs @@ -12,7 +12,7 @@ namespace SpeckleUiBase { public abstract class SpeckleUIBindings { - public ChromiumWebBrowser Browser { get; set; } + public IWebBrowser Browser { get; set; } public SpeckleUiWindow Window { get; set; } public SpeckleUIBindings() diff --git a/SpeckleUiBase/SpeckleUiWindow.xaml.cs b/SpeckleUiBase/SpeckleUiWindow.xaml.cs index e2f229d..c9c7696 100644 --- a/SpeckleUiBase/SpeckleUiWindow.xaml.cs +++ b/SpeckleUiBase/SpeckleUiWindow.xaml.cs @@ -28,7 +28,7 @@ public partial class SpeckleUiWindow : Window /// /// Your implementation of the SpeckleUiBindings class. /// Defaults to the master branch release of the web ui app. Change it to where you're running your local server when debugging! - public SpeckleUiWindow( SpeckleUIBindings baseBindings, string address = "https://appui.speckle.systems/#/" ) + public SpeckleUiWindow( SpeckleUIBindings baseBindings, string address = "https://matteo-dev.appui.speckle.systems/#/" ) { InitializeComponent(); diff --git a/SpeckleUiTester/App.xaml.cs b/SpeckleUiTester/App.xaml.cs index b8a69f9..dae76a2 100644 --- a/SpeckleUiTester/App.xaml.cs +++ b/SpeckleUiTester/App.xaml.cs @@ -134,7 +134,7 @@ public override List GetSelectionFilters() { Name = "Selection", Icon = "mouse", - Count = 99 + //Count = 99 }, new ListSelectionFilter { @@ -163,6 +163,11 @@ public override List GetSelectionFilters() } }; } + + public override void PushSender( string args ) + { + throw new NotImplementedException(); + } } } From 2089d8114e94618eda5dc744657bc489f87a72d8 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Tue, 15 Oct 2019 15:00:42 +0100 Subject: [PATCH 10/13] pdbs set to portable --- SpeckleUiBase/SpeckleUiBase.csproj | 3 ++- SpeckleUiTester/SpeckleUiTester.csproj | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SpeckleUiBase/SpeckleUiBase.csproj b/SpeckleUiBase/SpeckleUiBase.csproj index d880212..d339bd2 100644 --- a/SpeckleUiBase/SpeckleUiBase.csproj +++ b/SpeckleUiBase/SpeckleUiBase.csproj @@ -52,10 +52,11 @@ bin\Release\ TRACE true - pdbonly + portable x64 prompt MinimumRecommendedRules.ruleset + true diff --git a/SpeckleUiTester/SpeckleUiTester.csproj b/SpeckleUiTester/SpeckleUiTester.csproj index 2c424ab..c3f71de 100644 --- a/SpeckleUiTester/SpeckleUiTester.csproj +++ b/SpeckleUiTester/SpeckleUiTester.csproj @@ -52,11 +52,12 @@ bin\Release\ TRACE true - pdbonly + portable x64 prompt MinimumRecommendedRules.ruleset true + true @@ -147,7 +148,7 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. --> -