diff --git a/LICENSE.txt b/LICENSE.txt index 82003e803d8..4931f6ffa80 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -619,6 +619,16 @@ https://github.com/JoshClose/CsvHelper/blob/master/LICENSE.txt Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +Prism.Core v8.1.97 +The MIT License (MIT) +https://github.com/PrismLibrary/Prism/blob/master/LICENSE.txt + +Copyright (c) Prism Library + +All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + MimeMapping v2.0.0 MIT License https://licenses.nuget.org/MIT diff --git a/extern/legacy_remove_me/bin/Microsoft.Practices.Prism.dll b/extern/legacy_remove_me/bin/Microsoft.Practices.Prism.dll new file mode 100644 index 00000000000..e69de29bb2d diff --git a/extern/prism/Microsoft.Practices.Prism.dll b/extern/prism/Microsoft.Practices.Prism.dll deleted file mode 100644 index 4222fd81c3c..00000000000 Binary files a/extern/prism/Microsoft.Practices.Prism.dll and /dev/null differ diff --git a/src/DocumentationBrowserViewExtension/DocumentationBrowserViewExtension.csproj b/src/DocumentationBrowserViewExtension/DocumentationBrowserViewExtension.csproj index 1e205e176df..dc6bc7c5385 100644 --- a/src/DocumentationBrowserViewExtension/DocumentationBrowserViewExtension.csproj +++ b/src/DocumentationBrowserViewExtension/DocumentationBrowserViewExtension.csproj @@ -13,9 +13,6 @@ MSB3539;CS1591;NUnit2005;NUnit2007;CS0618;CS0612;CS0672 - - ..\..\extern\prism\Microsoft.Practices.Prism.dll - diff --git a/src/Dynamo.All.sln b/src/Dynamo.All.sln index 558e25825b5..d0734f81a73 100644 --- a/src/Dynamo.All.sln +++ b/src/Dynamo.All.sln @@ -152,8 +152,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoCoreWpf", "DynamoCore EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoServicesTests", "..\test\Libraries\NodeServicesTest\DynamoServicesTests.csproj", "{3E4278F7-60EC-491C-8094-B525C36A51A7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XmlDocumentationsUtility", "Tools\XmlDocumentationsUtility\XmlDocumentationsUtility.csproj", "{4CAB9005-0001-4B03-BBA0-57070ED105F1}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoConversions", "Libraries\DynamoConversions\DynamoConversions.csproj", "{C5ADC05B-34E8-47BF-8E78-9C7BF96418C2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoShapeManager", "Tools\DynamoShapeManager\DynamoShapeManager.csproj", "{263FA9C1-F81E-4A8E-95E0-8CDAE20F177B}" @@ -592,14 +590,6 @@ Global {3E4278F7-60EC-491C-8094-B525C36A51A7}.Release|Any CPU.Build.0 = Release|Any CPU {3E4278F7-60EC-491C-8094-B525C36A51A7}.Release|x64.ActiveCfg = Release|x64 {3E4278F7-60EC-491C-8094-B525C36A51A7}.Release|x64.Build.0 = Release|x64 - {4CAB9005-0001-4B03-BBA0-57070ED105F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CAB9005-0001-4B03-BBA0-57070ED105F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CAB9005-0001-4B03-BBA0-57070ED105F1}.Debug|x64.ActiveCfg = Debug|Any CPU - {4CAB9005-0001-4B03-BBA0-57070ED105F1}.Debug|x64.Build.0 = Debug|Any CPU - {4CAB9005-0001-4B03-BBA0-57070ED105F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4CAB9005-0001-4B03-BBA0-57070ED105F1}.Release|Any CPU.Build.0 = Release|Any CPU - {4CAB9005-0001-4B03-BBA0-57070ED105F1}.Release|x64.ActiveCfg = Release|Any CPU - {4CAB9005-0001-4B03-BBA0-57070ED105F1}.Release|x64.Build.0 = Release|Any CPU {C5ADC05B-34E8-47BF-8E78-9C7BF96418C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C5ADC05B-34E8-47BF-8E78-9C7BF96418C2}.Debug|Any CPU.Build.0 = Debug|Any CPU {C5ADC05B-34E8-47BF-8E78-9C7BF96418C2}.Debug|x64.ActiveCfg = Debug|x64 @@ -947,7 +937,6 @@ Global {ED1EA294-1BA1-45D6-A669-ECD2E24E21A9} = {24A1EF6B-5A24-4536-B8BD-C879ABA26389} {89563CD0-509B-40A5-8728-9D3EC6FE8410} = {0E492D35-2310-4849-9694-A2A53C09F21B} {3E4278F7-60EC-491C-8094-B525C36A51A7} = {0E492D35-2310-4849-9694-A2A53C09F21B} - {4CAB9005-0001-4B03-BBA0-57070ED105F1} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1} {C5ADC05B-34E8-47BF-8E78-9C7BF96418C2} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13} {263FA9C1-F81E-4A8E-95E0-8CDAE20F177B} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1} {98692887-B389-4F73-A71A-9FC516738DAB} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1} diff --git a/src/DynamoCore/Configuration/LuceneConfig.cs b/src/DynamoCore/Configuration/LuceneConfig.cs index 45aaec84a96..c74491078f7 100644 --- a/src/DynamoCore/Configuration/LuceneConfig.cs +++ b/src/DynamoCore/Configuration/LuceneConfig.cs @@ -92,7 +92,7 @@ internal class LuceneConfig /// /// This represent the fields that will be indexed when initializing Lucene Search /// - public enum IndexFieldsEnum + public enum NodeFieldsEnum { /// /// Name - The name of the node @@ -127,26 +127,32 @@ public enum IndexFieldsEnum /// /// Hosts - Package hosts /// - Hosts + Hosts, + + /// + /// Node Input Parameters as string (there are nodes with same name and category but different parameters) + /// + Parameters } /// /// Nodes Fields to be indexed by Lucene Search /// - public static string[] NodeIndexFields = { nameof(IndexFieldsEnum.Name), - nameof(IndexFieldsEnum.FullCategoryName), - nameof(IndexFieldsEnum.Description), - nameof(IndexFieldsEnum.SearchKeywords), - nameof(IndexFieldsEnum.DocName), - nameof(IndexFieldsEnum.Documentation)}; + public static string[] NodeIndexFields = { nameof(NodeFieldsEnum.Name), + nameof(NodeFieldsEnum.FullCategoryName), + nameof(NodeFieldsEnum.Description), + nameof(NodeFieldsEnum.SearchKeywords), + nameof(NodeFieldsEnum.DocName), + nameof(NodeFieldsEnum.Documentation), + nameof(NodeFieldsEnum.Parameters)}; /// /// Package Fields to be indexed by Lucene Search /// - public static string[] PackageIndexFields = { nameof(IndexFieldsEnum.Name), - nameof(IndexFieldsEnum.Description), - nameof(IndexFieldsEnum.SearchKeywords), - nameof(IndexFieldsEnum.Hosts)}; + public static string[] PackageIndexFields = { nameof(NodeFieldsEnum.Name), + nameof(NodeFieldsEnum.Description), + nameof(NodeFieldsEnum.SearchKeywords), + nameof(NodeFieldsEnum.Hosts)}; } } diff --git a/src/DynamoCore/Graph/Workspaces/NodesToCodeExtensions.cs b/src/DynamoCore/Graph/Workspaces/NodesToCodeExtensions.cs index 46cac8fb7f3..c764c1c4ad8 100644 --- a/src/DynamoCore/Graph/Workspaces/NodesToCodeExtensions.cs +++ b/src/DynamoCore/Graph/Workspaces/NodesToCodeExtensions.cs @@ -1,4 +1,3 @@ -using Dynamo.Core; using Dynamo.Engine; using Dynamo.Engine.NodeToCode; using Dynamo.Graph.Connectors; diff --git a/src/DynamoCore/Models/DynamoModel.cs b/src/DynamoCore/Models/DynamoModel.cs index 8753bb117aa..d6dd202672d 100644 --- a/src/DynamoCore/Models/DynamoModel.cs +++ b/src/DynamoCore/Models/DynamoModel.cs @@ -3253,10 +3253,11 @@ private void AddNodeTypeToSearchIndex(NodeSearchElement node, Document doc) if (IsTestMode) return; if (LuceneSearchUtility.addedFields == null) return; - LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.FullCategoryName), node.FullCategoryName); - LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.Name), node.Name); - LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.Description), node.Description); - if (node.SearchKeywords.Count > 0) LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.SearchKeywords), node.SearchKeywords.Aggregate((x, y) => x + " " + y), true, true); + LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.FullCategoryName), node.FullCategoryName); + LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.Name), node.Name); + LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.Description), node.Description); + if (node.SearchKeywords.Count > 0) LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.SearchKeywords), node.SearchKeywords.Aggregate((x, y) => x + " " + y), true, true); + LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.Parameters), node.Parameters?? string.Empty); LuceneSearchUtility.writer?.AddDocument(doc); } diff --git a/src/DynamoCore/Utilities/LuceneSearchUtility.cs b/src/DynamoCore/Utilities/LuceneSearchUtility.cs index aac721035c2..d40097b681b 100644 --- a/src/DynamoCore/Utilities/LuceneSearchUtility.cs +++ b/src/DynamoCore/Utilities/LuceneSearchUtility.cs @@ -79,12 +79,13 @@ internal Document InitializeIndexDocumentForNodes() { if (DynamoModel.IsTestMode) return null; - var name = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Name), string.Empty, Field.Store.YES); - var fullCategory = new TextField(nameof(LuceneConfig.IndexFieldsEnum.FullCategoryName), string.Empty, Field.Store.YES); - var description = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Description), string.Empty, Field.Store.YES); - var keywords = new TextField(nameof(LuceneConfig.IndexFieldsEnum.SearchKeywords), string.Empty, Field.Store.YES); - var docName = new StringField(nameof(LuceneConfig.IndexFieldsEnum.DocName), string.Empty, Field.Store.YES); - var fullDoc = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Documentation), string.Empty, Field.Store.YES); + var name = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Name), string.Empty, Field.Store.YES); + var fullCategory = new TextField(nameof(LuceneConfig.NodeFieldsEnum.FullCategoryName), string.Empty, Field.Store.YES); + var description = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Description), string.Empty, Field.Store.YES); + var keywords = new TextField(nameof(LuceneConfig.NodeFieldsEnum.SearchKeywords), string.Empty, Field.Store.YES); + var docName = new StringField(nameof(LuceneConfig.NodeFieldsEnum.DocName), string.Empty, Field.Store.YES); + var fullDoc = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Documentation), string.Empty, Field.Store.YES); + var parameters = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Parameters), string.Empty, Field.Store.YES); var d = new Document() { @@ -93,7 +94,8 @@ internal Document InitializeIndexDocumentForNodes() description, keywords, fullDoc, - docName + docName, + parameters }; return d; } @@ -106,10 +108,10 @@ internal Document InitializeIndexDocumentForPackages() { if (DynamoModel.IsTestMode) return null; - var name = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Name), string.Empty, Field.Store.YES); - var description = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Description), string.Empty, Field.Store.YES); - var keywords = new TextField(nameof(LuceneConfig.IndexFieldsEnum.SearchKeywords), string.Empty, Field.Store.YES); - var hosts = new TextField(nameof(LuceneConfig.IndexFieldsEnum.Hosts), string.Empty, Field.Store.YES); + var name = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Name), string.Empty, Field.Store.YES); + var description = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Description), string.Empty, Field.Store.YES); + var keywords = new TextField(nameof(LuceneConfig.NodeFieldsEnum.SearchKeywords), string.Empty, Field.Store.YES); + var hosts = new TextField(nameof(LuceneConfig.NodeFieldsEnum.Hosts), string.Empty, Field.Store.YES); var d = new Document() { @@ -196,7 +198,7 @@ internal string CreateSearchQuery(string[] fields, string SearchTerm) } var wildcardQuery = new WildcardQuery(new Term(f, searchTerm)); - if (f.Equals(nameof(LuceneConfig.IndexFieldsEnum.Name))) + if (f.Equals(nameof(LuceneConfig.NodeFieldsEnum.Name))) { wildcardQuery.Boost = LuceneConfig.SearchNameWeight; } @@ -207,7 +209,7 @@ internal string CreateSearchQuery(string[] fields, string SearchTerm) booleanQuery.Add(wildcardQuery, Occur.SHOULD); wildcardQuery = new WildcardQuery(new Term(f, "*" + searchTerm + "*")); - if (f.Equals(nameof(LuceneConfig.IndexFieldsEnum.Name))) + if (f.Equals(nameof(LuceneConfig.NodeFieldsEnum.Name))) { wildcardQuery.Boost = LuceneConfig.WildcardsSearchNameWeight; } @@ -228,7 +230,7 @@ internal string CreateSearchQuery(string[] fields, string SearchTerm) } wildcardQuery = new WildcardQuery(new Term(f, "*" + s + "*")); - if (f.Equals(nameof(LuceneConfig.IndexFieldsEnum.Name))) + if (f.Equals(nameof(LuceneConfig.NodeFieldsEnum.Name))) { wildcardQuery.Boost = 5; } diff --git a/src/DynamoCoreWpf/Controls/RunSettingsControl.xaml b/src/DynamoCoreWpf/Controls/RunSettingsControl.xaml index 2702e64f76c..f439294764d 100644 --- a/src/DynamoCoreWpf/Controls/RunSettingsControl.xaml +++ b/src/DynamoCoreWpf/Controls/RunSettingsControl.xaml @@ -33,68 +33,6 @@ - - diff --git a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs index a1d61e050f9..48b81009ea4 100644 --- a/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs +++ b/src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs @@ -6,7 +6,7 @@ using Dynamo.UI.Commands; using Dynamo.ViewModels; using Dynamo.Wpf.ViewModels.Core; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; using Greg.AuthProviders; using System.Linq; using System.Windows; diff --git a/src/DynamoCoreWpf/Controls/StartPage.xaml.cs b/src/DynamoCoreWpf/Controls/StartPage.xaml.cs index 5fb4ade671a..53eeddeae02 100644 --- a/src/DynamoCoreWpf/Controls/StartPage.xaml.cs +++ b/src/DynamoCoreWpf/Controls/StartPage.xaml.cs @@ -14,7 +14,7 @@ using Dynamo.Utilities; using Dynamo.ViewModels; using Dynamo.Wpf.Properties; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; namespace Dynamo.UI.Controls { @@ -368,25 +368,32 @@ private void RefreshFileList(ObservableCollection files, files.Clear(); foreach (var filePath in filePaths) { - var extension = Path.GetExtension(filePath).ToUpper(); - // If not extension specified and code reach here, this means this is still a valid file - // only without file type. Otherwise, simply take extension substring skipping the 'dot'. - var subScript = extension.IndexOf(".") == 0 ? extension.Substring(1) : ""; - var caption = Path.GetFileNameWithoutExtension(filePath); + try + { + var extension = Path.GetExtension(filePath).ToUpper(); + // If not extension specified and code reach here, this means this is still a valid file + // only without file type. Otherwise, simply take extension substring skipping the 'dot'. + var subScript = extension.IndexOf(".") == 0 ? extension.Substring(1) : ""; + var caption = Path.GetFileNameWithoutExtension(filePath); - files.Add(new StartPageListItem(caption) + files.Add(new StartPageListItem(caption) + { + ContextData = filePath, + ToolTip = filePath, + SubScript = subScript, + ClickAction = StartPageListItem.Action.FilePath + }); + } + catch (ArgumentException ex) { - ContextData = filePath, - ToolTip = filePath, - SubScript = subScript, - ClickAction = StartPageListItem.Action.FilePath - }); + DynamoViewModel.Model.Logger.Log("File path is not valid: " + ex.StackTrace); + } } } private void HandleRegularCommand(StartPageListItem item) { - var dvm = this.DynamoViewModel; + var dvm = this.DynamoViewModel; switch (item.ContextData) { diff --git a/src/DynamoCoreWpf/DynamoCoreWpf.csproj b/src/DynamoCoreWpf/DynamoCoreWpf.csproj index 3533f1f0a60..2b70abf6a2e 100644 --- a/src/DynamoCoreWpf/DynamoCoreWpf.csproj +++ b/src/DynamoCoreWpf/DynamoCoreWpf.csproj @@ -158,9 +158,7 @@ False ..\..\extern\Microsoft.Xaml.Behaviors\$(TargetFramework)\Dynamo.Microsoft.Xaml.Behaviors.dll - - ..\..\extern\prism\Microsoft.Practices.Prism.dll - + true diff --git a/src/DynamoCoreWpf/UI/Prompts/PortPropertiesEditPrompt.xaml.cs b/src/DynamoCoreWpf/UI/Prompts/PortPropertiesEditPrompt.xaml.cs index ee5920a083b..50c036ee459 100644 --- a/src/DynamoCoreWpf/UI/Prompts/PortPropertiesEditPrompt.xaml.cs +++ b/src/DynamoCoreWpf/UI/Prompts/PortPropertiesEditPrompt.xaml.cs @@ -8,7 +8,6 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using Dynamo.Core; using Dynamo.Graph.Nodes; namespace UI.Prompts diff --git a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoColorsAndBrushes.xaml b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoColorsAndBrushes.xaml index a04e3ff413b..f7f3bdd2cbe 100644 --- a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoColorsAndBrushes.xaml +++ b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoColorsAndBrushes.xaml @@ -198,6 +198,9 @@ + + + diff --git a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml index 3087f9c25af..b2daa1c9ba1 100644 --- a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml +++ b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml @@ -5785,4 +5785,66 @@ + + diff --git a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModelDelegateCommands.cs b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModelDelegateCommands.cs index dc17a854814..a206e7ea804 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModelDelegateCommands.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModelDelegateCommands.cs @@ -1,7 +1,7 @@ using System; using Dynamo.Graph.Nodes.CustomNodes; using Dynamo.Wpf.ViewModels; -using Microsoft.Practices.Prism.Commands; +using Prism.Commands; using DelegateCommand = Dynamo.UI.Commands.DelegateCommand; namespace Dynamo.ViewModels diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/InstalledPackagesViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/InstalledPackagesViewModel.cs index a432e50de88..c673dafea01 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/InstalledPackagesViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/InstalledPackagesViewModel.cs @@ -1,11 +1,11 @@ -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using Dynamo.PackageManager; using Dynamo.Utilities; using Dynamo.Wpf.Properties; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; namespace Dynamo.ViewModels { diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageItemViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageItemViewModel.cs index 599df987002..ab961bce864 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageItemViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageItemViewModel.cs @@ -1,11 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Windows; using System.Windows.Input; - -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; namespace Dynamo.PackageManager.UI { diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerClientViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerClientViewModel.cs index 5cf2efbc46a..8d3b8dd936d 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerClientViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerClientViewModel.cs @@ -23,7 +23,7 @@ using Dynamo.Wpf.Utilities; using Greg.AuthProviders; using Greg.Responses; -using Microsoft.Practices.Prism.Commands; +using Prism.Commands; namespace Dynamo.ViewModels { diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchElementViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchElementViewModel.cs index 3e53f201ad2..1858ed914b3 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchElementViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchElementViewModel.cs @@ -6,7 +6,7 @@ using Dynamo.ViewModels; using Dynamo.Wpf.ViewModels; using Greg.Responses; -using Microsoft.Practices.Prism.Commands; +using Prism.Commands; namespace Dynamo.PackageManager.ViewModels { diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs index ed9bb69bb31..c832a924eda 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs @@ -21,8 +21,8 @@ using Lucene.Net.Documents; using Lucene.Net.QueryParsers.Classic; using Lucene.Net.Search; -using Microsoft.Practices.Prism.Commands; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; +using Prism.Commands; namespace Dynamo.PackageManager { @@ -455,17 +455,17 @@ private void AddPackageToSearchIndex(PackageManagerSearchElement package, Docume if (DynamoModel.IsTestMode) return; if (LuceneSearchUtility.addedFields == null) return; - LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.Name), package.Name); - LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.Description), package.Description); + LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.Name), package.Name); + LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.Description), package.Description); if (package.Keywords.Count() > 0) { - LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.SearchKeywords), package.Keywords); + LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.SearchKeywords), package.Keywords); } if (package.Hosts != null && string.IsNullOrEmpty(package.Hosts.ToString())) { - LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.IndexFieldsEnum.Hosts), package.Hosts.ToString(), true, true); + LuceneSearchUtility.SetDocumentFieldValue(doc, nameof(LuceneConfig.NodeFieldsEnum.Hosts), package.Hosts.ToString(), true, true); } LuceneSearchUtility.writer?.AddDocument(doc); @@ -1132,7 +1132,7 @@ internal IEnumerable Search(string searchT Document resultDoc = LuceneSearchUtility.Searcher.Doc(topDocs.ScoreDocs[i].Doc); // Get the view model of the package element and add it to the results. - string name = resultDoc.Get(nameof(LuceneConfig.IndexFieldsEnum.Name)); + string name = resultDoc.Get(nameof(LuceneConfig.NodeFieldsEnum.Name)); var foundPackage = GetViewModelForPackageSearchElement(name); if (foundPackage != null) diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerViewModel.cs index 42f83807fea..c720cae8e2e 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerViewModel.cs @@ -1,5 +1,5 @@ using Dynamo.ViewModels; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; using System.Collections.ObjectModel; namespace Dynamo.PackageManager diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageViewModel.cs index 085db05e7af..e70ced0d087 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PackageViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PackageViewModel.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; @@ -13,8 +13,8 @@ using Dynamo.PackageManager; using Dynamo.Wpf.Properties; using Dynamo.Wpf.Utilities; -using Microsoft.Practices.Prism.Commands; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; +using Prism.Commands; namespace Dynamo.ViewModels { diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs index e292dbe70d9..461a976e90b 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs @@ -20,10 +20,10 @@ using Dynamo.Wpf.Utilities; using DynamoUtilities; using Greg.Requests; -using Microsoft.Practices.Prism.Commands; +using Prism.Commands; using PythonNodeModels; using Double = System.Double; -using NotificationObject = Microsoft.Practices.Prism.ViewModel.NotificationObject; +using NotificationObject = Dynamo.Core.NotificationObject; using String = System.String; namespace Dynamo.PackageManager diff --git a/src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs b/src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs index b3eca7a3751..15a53337704 100644 --- a/src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs @@ -7,7 +7,7 @@ using Dynamo.Wpf.Properties; using Dynamo.UI.Commands; using Dynamo.Utilities; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; using Dynamo.Configuration; using CoreNodeModels; diff --git a/src/DynamoCoreWpf/ViewModels/Search/BrowserItemViewModel.cs b/src/DynamoCoreWpf/ViewModels/Search/BrowserItemViewModel.cs index fe6cd747f12..a08451cd44e 100644 --- a/src/DynamoCoreWpf/ViewModels/Search/BrowserItemViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Search/BrowserItemViewModel.cs @@ -11,8 +11,8 @@ using Dynamo.Search.SearchElements; using Dynamo.ViewModels; using Dynamo.Wpf.Extensions; -using Microsoft.Practices.Prism.Commands; -using Microsoft.Practices.Prism.ViewModel; +using Prism.Commands; +using Dynamo.Core; namespace Dynamo.Wpf.ViewModels { diff --git a/src/DynamoCoreWpf/ViewModels/Search/NodeSearchElementViewModel.cs b/src/DynamoCoreWpf/ViewModels/Search/NodeSearchElementViewModel.cs index 0116b0a61ae..fe1efb75051 100644 --- a/src/DynamoCoreWpf/ViewModels/Search/NodeSearchElementViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Search/NodeSearchElementViewModel.cs @@ -13,7 +13,7 @@ using Dynamo.Selection; using Dynamo.ViewModels; using FontAwesome.WPF; -using Microsoft.Practices.Prism.Commands; +using Prism.Commands; namespace Dynamo.Wpf.ViewModels { diff --git a/src/DynamoCoreWpf/ViewModels/Search/SearchCategory.cs b/src/DynamoCoreWpf/ViewModels/Search/SearchCategory.cs index 1db07af6bb1..1e89ce68654 100644 --- a/src/DynamoCoreWpf/ViewModels/Search/SearchCategory.cs +++ b/src/DynamoCoreWpf/ViewModels/Search/SearchCategory.cs @@ -2,7 +2,7 @@ using Dynamo.UI.Commands; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; namespace Dynamo.Wpf.ViewModels { diff --git a/src/DynamoCoreWpf/ViewModels/Search/SearchViewModel.cs b/src/DynamoCoreWpf/ViewModels/Search/SearchViewModel.cs index d933c156c15..9f5aaaea7ce 100644 --- a/src/DynamoCoreWpf/ViewModels/Search/SearchViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Search/SearchViewModel.cs @@ -962,9 +962,10 @@ internal IEnumerable Search(string search, bool useL // read back a Lucene doc from results Document resultDoc = LuceneSearchUtility.Searcher.Doc(topDocs.ScoreDocs[i].Doc); - string name = resultDoc.Get(nameof(LuceneConfig.IndexFieldsEnum.Name)); - string docName = resultDoc.Get(nameof(LuceneConfig.IndexFieldsEnum.DocName)); - string cat = resultDoc.Get(nameof(LuceneConfig.IndexFieldsEnum.FullCategoryName)); + string name = resultDoc.Get(nameof(LuceneConfig.NodeFieldsEnum.Name)); + string docName = resultDoc.Get(nameof(LuceneConfig.NodeFieldsEnum.DocName)); + string cat = resultDoc.Get(nameof(LuceneConfig.NodeFieldsEnum.FullCategoryName)); + string parameters = resultDoc.Get(nameof(LuceneConfig.NodeFieldsEnum.Parameters)); if (!string.IsNullOrEmpty(docName)) { @@ -972,7 +973,7 @@ internal IEnumerable Search(string search, bool useL } else { - var foundNode = FindViewModelForNodeNameAndCategory(name, cat); + var foundNode = FindViewModelForNodeNameAndCategory(name, cat, parameters); if (foundNode != null) { candidates.Add(foundNode); @@ -992,13 +993,20 @@ internal IEnumerable Search(string search, bool useL /// /// Name of the node /// Full Category of the node + /// Node input parameters /// - private NodeSearchElementViewModel FindViewModelForNodeNameAndCategory(string nodeName, string nodeCategory) + private NodeSearchElementViewModel FindViewModelForNodeNameAndCategory(string nodeName, string nodeCategory, string parameters) { var result = Model.SearchEntries.Where(e => { if (e.Name.Equals(nodeName) && e.FullCategoryName.Equals(nodeCategory)) { - return true; + //When the node info was indexed if Parameters was null we added an empty space (null cannot be indexed) + //Then in this case when searching if e.Parameters is null we need to check against empty space + if (e.Parameters == null) + return string.IsNullOrEmpty(parameters); + //Parameters contain a value so we need to compare against the value indexed + else + return e.Parameters.Equals(parameters); } return false; }); diff --git a/src/DynamoCoreWpf/ViewModels/ViewModelBase.cs b/src/DynamoCoreWpf/ViewModels/ViewModelBase.cs index d3496615be7..ccc5e411052 100644 --- a/src/DynamoCoreWpf/ViewModels/ViewModelBase.cs +++ b/src/DynamoCoreWpf/ViewModels/ViewModelBase.cs @@ -1,6 +1,6 @@ -using System; +using System; using Dynamo.Configuration; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; using Newtonsoft.Json; namespace Dynamo.ViewModels diff --git a/src/DynamoCoreWpf/Views/CodeBlocks/CodeBlockMethodInsightWindow.cs b/src/DynamoCoreWpf/Views/CodeBlocks/CodeBlockMethodInsightWindow.cs index d73f9864f2a..93c6c6588a4 100644 --- a/src/DynamoCoreWpf/Views/CodeBlocks/CodeBlockMethodInsightWindow.cs +++ b/src/DynamoCoreWpf/Views/CodeBlocks/CodeBlockMethodInsightWindow.cs @@ -6,7 +6,7 @@ using Dynamo.Engine.CodeCompletion; using ICSharpCode.AvalonEdit.CodeCompletion; using ICSharpCode.AvalonEdit.Editing; -using Microsoft.Practices.Prism.ViewModel; +using Dynamo.Core; namespace Dynamo.UI { diff --git a/src/DynamoSandbox/DynamoSandbox.csproj b/src/DynamoSandbox/DynamoSandbox.csproj index 828a0839793..044ff9c5a6e 100644 --- a/src/DynamoSandbox/DynamoSandbox.csproj +++ b/src/DynamoSandbox/DynamoSandbox.csproj @@ -21,11 +21,6 @@ logo_square_32x32.ico - - - ..\..\extern\prism\Microsoft.Practices.Prism.dll - - diff --git a/src/DynamoWPFCLI/DynamoWPFCLI.csproj b/src/DynamoWPFCLI/DynamoWPFCLI.csproj index 0694518a5a7..68cb02bfa30 100644 --- a/src/DynamoWPFCLI/DynamoWPFCLI.csproj +++ b/src/DynamoWPFCLI/DynamoWPFCLI.csproj @@ -13,6 +13,7 @@ DynamoWPFCLI + ..\..\extern\prism\Microsoft.Practices.Prism.dll diff --git a/src/DynamoWPFCLI/Program.cs b/src/DynamoWPFCLI/Program.cs index f6be0ffad4b..be1c1cc9cee 100644 --- a/src/DynamoWPFCLI/Program.cs +++ b/src/DynamoWPFCLI/Program.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Runtime.Versioning; using System.Threading; using Dynamo.Applications; using Dynamo.Models; @@ -13,6 +14,9 @@ internal class Program { private static EventWaitHandle suspendEvent = new AutoResetEvent(false); +#if NET6_0_OR_GREATER + [SupportedOSPlatform("Windows")] +#endif [STAThread] internal static void Main(string[] args) { diff --git a/src/GraphMetadataViewExtension/GraphMetadataViewExtension.csproj b/src/GraphMetadataViewExtension/GraphMetadataViewExtension.csproj index 7e7fa19109c..f7899d502ef 100644 --- a/src/GraphMetadataViewExtension/GraphMetadataViewExtension.csproj +++ b/src/GraphMetadataViewExtension/GraphMetadataViewExtension.csproj @@ -1,4 +1,4 @@ - + @@ -10,9 +10,6 @@ GraphMetadataViewExtension - - ..\..\extern\prism\Microsoft.Practices.Prism.dll - diff --git a/src/GraphNodeManagerViewExtension/GraphNodeManagerViewExtension.csproj b/src/GraphNodeManagerViewExtension/GraphNodeManagerViewExtension.csproj index fcc33c1911e..c39a3510ad6 100644 --- a/src/GraphNodeManagerViewExtension/GraphNodeManagerViewExtension.csproj +++ b/src/GraphNodeManagerViewExtension/GraphNodeManagerViewExtension.csproj @@ -1,4 +1,4 @@ - + @@ -11,10 +11,7 @@ - - ..\..\extern\prism\Microsoft.Practices.Prism.dll - False - + diff --git a/src/GraphNodeManagerViewExtension/GraphNodeManagerViewModel.cs b/src/GraphNodeManagerViewExtension/GraphNodeManagerViewModel.cs index 4794a30a9c0..d0467c99329 100644 --- a/src/GraphNodeManagerViewExtension/GraphNodeManagerViewModel.cs +++ b/src/GraphNodeManagerViewExtension/GraphNodeManagerViewModel.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -15,7 +15,7 @@ using Dynamo.PackageManager; using Dynamo.Utilities; using Dynamo.ViewModels; -using Microsoft.Practices.Prism.Commands; +using Prism.Commands; using DelegateCommand = Dynamo.UI.Commands.DelegateCommand; using GridNodeViewModel = Dynamo.GraphNodeManager.ViewModels.GridNodeViewModel; using Newtonsoft.Json; diff --git a/src/Libraries/CoreNodeModelsWpf/CoreNodeModelsWpf.csproj b/src/Libraries/CoreNodeModelsWpf/CoreNodeModelsWpf.csproj index 6569b545655..39745b031a5 100644 --- a/src/Libraries/CoreNodeModelsWpf/CoreNodeModelsWpf.csproj +++ b/src/Libraries/CoreNodeModelsWpf/CoreNodeModelsWpf.csproj @@ -21,10 +21,7 @@ - - ..\..\..\extern\prism\Microsoft.Practices.Prism.dll - False - + diff --git a/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/SelectionBase.cs b/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/SelectionBase.cs index f8f1a6535ef..6cb7eb3c134 100644 --- a/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/SelectionBase.cs +++ b/src/Libraries/CoreNodeModelsWpf/NodeViewCustomizations/SelectionBase.cs @@ -2,7 +2,7 @@ using CoreNodeModels; using Dynamo.Controls; using Dynamo.Wpf; -using Microsoft.Practices.Prism.Commands; +using Prism.Commands; namespace CoreNodeModelsWpf.Nodes { @@ -37,4 +37,4 @@ public void Dispose() { } } -} \ No newline at end of file +} diff --git a/src/Libraries/PythonNodeModelsWpf/PythonNodeModelsWpf.csproj b/src/Libraries/PythonNodeModelsWpf/PythonNodeModelsWpf.csproj index 92dd2241a95..ff06aebec35 100644 --- a/src/Libraries/PythonNodeModelsWpf/PythonNodeModelsWpf.csproj +++ b/src/Libraries/PythonNodeModelsWpf/PythonNodeModelsWpf.csproj @@ -46,6 +46,14 @@ ..\..\..\extern\prism\Microsoft.Practices.Prism.dll False + + False + + + False + + + diff --git a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml index db416d2d463..27e9ddeb359 100644 --- a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml +++ b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml @@ -59,68 +59,6 @@ - + + - + + - + - - - - + + + + + + + - diff --git a/src/PythonMigrationViewExtension/Controls/BaseDiffViewer.xaml.cs b/src/PythonMigrationViewExtension/Controls/BaseDiffViewer.xaml.cs index d0d342f6f69..d5b03b3b34e 100644 --- a/src/PythonMigrationViewExtension/Controls/BaseDiffViewer.xaml.cs +++ b/src/PythonMigrationViewExtension/Controls/BaseDiffViewer.xaml.cs @@ -1,7 +1,8 @@ -using Dynamo.Logging; -using Dynamo.PythonMigration.MigrationAssistant; using System; using System.Windows; +using System.Windows.Input; +using Dynamo.Logging; +using Dynamo.PythonMigration.MigrationAssistant; namespace Dynamo.PythonMigration.Controls { @@ -17,7 +18,7 @@ public partial class BaseDiffViewer : Window private int scriptEditorWindowDefaultWidth = 600; private int differAdditionalWidthPerPanel = 20; - internal BaseDiffViewer(PythonMigrationAssistantViewModel viewModel) + internal BaseDiffViewer(PythonMigrationAssistantViewModel viewModel) : base() { ViewModel = viewModel; DataContext = viewModel; @@ -71,5 +72,59 @@ private void OnRejectButtonClicked(object sender, RoutedEventArgs e) "Reject", Convert.ToInt32(ViewModel.CurrentViewModel.HasChanges)); } + + // Handles Close button 'X' + private void CloseButton_OnClick(object sender, RoutedEventArgs e) + { + Close(); + } + + private void MinimizeButton_OnClick(object sender, RoutedEventArgs e) + { + WindowState = WindowState.Minimized; + } + + private void MaximizeButton_OnClick(object sender, RoutedEventArgs e) + { + if ((sender as System.Windows.Controls.Button).Name.Equals("MaximizeButton")) + { + WindowState = WindowState.Maximized; + ToggleButtons(true); + } + else + { + WindowState = WindowState.Normal; + ToggleButtons(false); + } + } + + /// + /// Toggles between the Maximize and Normalize buttons on the window + /// + /// + private void ToggleButtons(bool toggle) + { + if (toggle) + { + MaximizeButton.Visibility = Visibility.Collapsed; + NormalizeButton.Visibility = Visibility.Visible; + } + else + { + MaximizeButton.Visibility = Visibility.Visible; + NormalizeButton.Visibility = Visibility.Collapsed; + } + } + + /// + /// Lets the user drag this window around with their left mouse button. + /// + /// + /// + private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e) + { + if (e.ChangedButton != MouseButton.Left) return; + DragMove(); + } } } diff --git a/src/PythonMigrationViewExtension/Properties/Resources.Designer.cs b/src/PythonMigrationViewExtension/Properties/Resources.Designer.cs index b65dc9d56dd..0ac520bff75 100644 --- a/src/PythonMigrationViewExtension/Properties/Resources.Designer.cs +++ b/src/PythonMigrationViewExtension/Properties/Resources.Designer.cs @@ -60,6 +60,15 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Accept. + /// + public static string AcceptButton { + get { + return ResourceManager.GetString("AcceptButton", resourceCulture); + } + } + /// /// Looks up a localized string similar to Accept the current code changes.. /// @@ -314,6 +323,15 @@ public static string PythonMigrationBackupFileCreatedMessage { } } + /// + /// Looks up a localized string similar to Cancel. + /// + public static string RejectButton { + get { + return ResourceManager.GetString("RejectButton", resourceCulture); + } + } + /// /// Looks up a localized string similar to Reject the current code changes.. /// @@ -323,6 +341,15 @@ public static string RejectButtonTooltip { } } + /// + /// Looks up a localized string similar to Switch View. + /// + public static string SwitchViewButton { + get { + return ResourceManager.GetString("SwitchViewButton", resourceCulture); + } + } + /// /// Looks up a localized string similar to Double-click on the custom node to open its workspace. /// diff --git a/src/PythonMigrationViewExtension/Properties/Resources.en-US.resx b/src/PythonMigrationViewExtension/Properties/Resources.en-US.resx index ab6721f4dfa..5f60a2bd171 100644 --- a/src/PythonMigrationViewExtension/Properties/Resources.en-US.resx +++ b/src/PythonMigrationViewExtension/Properties/Resources.en-US.resx @@ -1,4 +1,4 @@ - + - - - - - - - + + + + + + + + + + + + + + + + + + + False + + {51bb6014-43f7-4f31-b8d3-e3c37ebedaf4} diff --git a/test/ViewExtensionLibraryTests/ViewExtensionLibraryTests.csproj b/test/ViewExtensionLibraryTests/ViewExtensionLibraryTests.csproj index e13ffbc12a4..1c6806ddcb3 100644 --- a/test/ViewExtensionLibraryTests/ViewExtensionLibraryTests.csproj +++ b/test/ViewExtensionLibraryTests/ViewExtensionLibraryTests.csproj @@ -10,15 +10,11 @@ ViewExtensionLibraryTests - - - + + + - - - ..\..\extern\prism\Microsoft.Practices.Prism.dll - False - +