From 52f03fcbfbcd85b524534af3fbd604e69a4040be Mon Sep 17 00:00:00 2001 From: ArunKumarSF4054 <124353880+ArunKumarSF4054@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:24:44 +0530 Subject: [PATCH 1/2] WPF-931555-Sample_prepared_for_remove_defaultcommands --- .../CustomCommand/App.config | 6 + .../CustomCommand/App.xaml | 14 +++ .../CustomCommand/App.xaml.cs | 17 +++ .../CustomCommand/CustomCommand_462.csproj | 108 ++++++++++++++++ .../CustomCommand/CustomCommand_462.sln | 25 ++++ .../CustomCommand/CustomCommand_60.csproj | 68 ++++++++++ .../CustomCommand/CustomCommand_60.sln | 25 ++++ .../CustomCommand/CustomCommand_80.csproj | 68 ++++++++++ .../CustomCommand/CustomCommand_80.sln | 25 ++++ .../CustomCommand/MainWindow.xaml | 76 ++++++++++++ .../CustomCommand/MainWindow.xaml.cs | 72 +++++++++++ .../CustomCommand/Properties/AssemblyInfo.cs | 55 ++++++++ .../Properties/Resources.Designer.cs | 63 ++++++++++ .../CustomCommand/Properties/Resources.resx | 117 ++++++++++++++++++ .../Properties/Settings.Designer.cs | 26 ++++ .../Properties/Settings.settings | 7 ++ .../Commands/RemoveDefaultCommands/README.md | 12 ++ 17 files changed, 784 insertions(+) create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/App.config create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml.cs create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.csproj create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.sln create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.csproj create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.sln create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.csproj create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.sln create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml.cs create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/AssemblyInfo.cs create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.Designer.cs create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.resx create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.Designer.cs create mode 100644 Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.settings create mode 100644 Samples/Commands/RemoveDefaultCommands/README.md diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.config b/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.config new file mode 100644 index 00000000..8d234373 --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml b/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml new file mode 100644 index 00000000..0d450b1d --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml.cs b/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml.cs new file mode 100644 index 00000000..d41ebe9c --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace CustomCommand +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.csproj b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.csproj new file mode 100644 index 00000000..67293289 --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.csproj @@ -0,0 +1,108 @@ + + + + + Debug + AnyCPU + {7103EB9C-112A-43D6-A024-20F8B0C4337E} + WinExe + Properties + CustomCommand + CustomCommand + v4.6.2 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.sln b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.sln new file mode 100644 index 00000000..187f596f --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34330.188 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomCommand_462", "CustomCommand_462.csproj", "{7103EB9C-112A-43D6-A024-20F8B0C4337E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7103EB9C-112A-43D6-A024-20F8B0C4337E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7103EB9C-112A-43D6-A024-20F8B0C4337E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7103EB9C-112A-43D6-A024-20F8B0C4337E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7103EB9C-112A-43D6-A024-20F8B0C4337E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {589C603B-BE20-4CC5-99D8-5C87EBFA9E84} + EndGlobalSection +EndGlobal diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.csproj b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.csproj new file mode 100644 index 00000000..adfec6b6 --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.csproj @@ -0,0 +1,68 @@ + + + WinExe + net6.0-windows + true + true + False + false + false + CustomCommand + CustomCommand + + + TRACE;NET50 + + + TRACE;NET50 + + + TRACE;NET50 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + \ No newline at end of file diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.sln b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.sln new file mode 100644 index 00000000..ff2b9a1b --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34330.188 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomCommand_60", "CustomCommand_60.csproj", "{3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CEE35F1A-6A6A-42BD-A708-48666A137492} + EndGlobalSection +EndGlobal diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.csproj b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.csproj new file mode 100644 index 00000000..22f9d8bf --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.csproj @@ -0,0 +1,68 @@ + + + WinExe + net8.0-windows + true + true + False + false + false + CustomCommand + CustomCommand + + + TRACE;NET50 + + + TRACE;NET50 + + + TRACE;NET50 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + \ No newline at end of file diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.sln b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.sln new file mode 100644 index 00000000..259debb0 --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34330.188 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomCommand_80", "CustomCommand_80.csproj", "{65523BE2-4EB4-4A78-B82D-3B012C51F358}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {65523BE2-4EB4-4A78-B82D-3B012C51F358}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65523BE2-4EB4-4A78-B82D-3B012C51F358}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65523BE2-4EB4-4A78-B82D-3B012C51F358}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65523BE2-4EB4-4A78-B82D-3B012C51F358}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FD0CF816-D0DE-4234-B892-FB072302CF8B} + EndGlobalSection +EndGlobal diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml b/Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml new file mode 100644 index 00000000..b3b57092 --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml.cs b/Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml.cs new file mode 100644 index 00000000..1edd8959 --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml.cs @@ -0,0 +1,72 @@ +using Microsoft.Win32; +using Syncfusion.UI.Xaml.Diagram; +using Syncfusion.UI.Xaml.Diagram.Controls; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace CustomCommand +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + diagram.Loaded += Diagram_Loaded; + + } + + private void Diagram_Loaded(object sender, RoutedEventArgs e) + { + if (diagram != null) + { + + string MoveRightCommand = "MoveRight"; + var RightcommandToBeRemoved = diagram.CommandManager.Commands.FirstOrDefault(command => command.Name != null && command.Name.Equals(MoveRightCommand)); + if (RightcommandToBeRemoved != null) + { + diagram.CommandManager.Commands.Remove(RightcommandToBeRemoved); + } + + + string MoveLeftCommand = "MoveLeft"; + var LeftcommandToBeRemoved = diagram.CommandManager.Commands.FirstOrDefault(command => command.Name != null && command.Name.Equals(MoveLeftCommand)); + if (LeftcommandToBeRemoved != null) + { + diagram.CommandManager.Commands.Remove(LeftcommandToBeRemoved); + } + + string MoveUpCommand = "MoveUp"; + var UpcommandToBeRemoved = diagram.CommandManager.Commands.FirstOrDefault(command => command.Name != null && command.Name.Equals(MoveUpCommand)); + if (UpcommandToBeRemoved != null) + { + diagram.CommandManager.Commands.Remove(UpcommandToBeRemoved); + } + + + string MoveDownCommand = "MoveDown"; + var DowncommandToBeRemoved = diagram.CommandManager.Commands.FirstOrDefault(command => command.Name != null && command.Name.Equals(MoveDownCommand)); + if (DowncommandToBeRemoved != null) + { + diagram.CommandManager.Commands.Remove(DowncommandToBeRemoved); + } + } + } + } +} diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/AssemblyInfo.cs b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..dc1c49fa --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CustomCommand")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CustomCommand")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.Designer.cs b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.Designer.cs new file mode 100644 index 00000000..2de020fc --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CustomCommand.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CustomCommand.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.resx b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.Designer.cs b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.Designer.cs new file mode 100644 index 00000000..c51a5be6 --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CustomCommand.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.settings b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.settings new file mode 100644 index 00000000..033d7a5e --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Samples/Commands/RemoveDefaultCommands/README.md b/Samples/Commands/RemoveDefaultCommands/README.md new file mode 100644 index 00000000..5caa9b6a --- /dev/null +++ b/Samples/Commands/RemoveDefaultCommands/README.md @@ -0,0 +1,12 @@ +# Custom command sample +This sample demonstrate how to remove the default commands from the diagram commands. + +__*Documentation*__: https://help.syncfusion.com/wpf/diagram/commands#custom-command +## Project pre-requisites +To run this application, you need to have the below two in your system + +* [Visual Studio 2019](https://www.visualstudio.com/wpf-vs) +* [Syncfusion.SfDiagram.WPF](https://www.nuget.org/packages/Syncfusion.SfDiagram.WPF/) nuget package. To install the package using NuGet Package Manager, refer this [link](https://docs.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio#nuget-package-manager). + +## Deploying and running the sample +* To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging. From 04dc65a9cf2ac4a1fe90d43abb05a53eb98684ce Mon Sep 17 00:00:00 2001 From: ArunKumarSF4054 <124353880+ArunKumarSF4054@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:46:44 +0530 Subject: [PATCH 2/2] WPF-931555_Nameschanged --- Samples/Commands/RemoveDefaultCommands/README.md | 2 +- .../App.config | 0 .../App.xaml | 0 .../App.xaml.cs | 0 .../MainWindow.xaml | 0 .../MainWindow.xaml.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../Properties/Resources.Designer.cs | 0 .../Properties/Resources.resx | 0 .../Properties/Settings.Designer.cs | 0 .../Properties/Settings.settings | 0 .../RemoveDefaultCommands_462.csproj} | 0 .../RemoveDefaultCommands_462.sln} | 6 +++--- .../RemoveDefaultCommands_60.csproj} | 0 .../RemoveDefaultCommands_60.sln} | 14 +++++++------- .../RemoveDefaultCommands_80.csproj} | 0 .../RemoveDefaultCommands_80.sln} | 14 +++++++------- 17 files changed, 18 insertions(+), 18 deletions(-) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/App.config (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/App.xaml (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/App.xaml.cs (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/MainWindow.xaml (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/MainWindow.xaml.cs (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/Properties/AssemblyInfo.cs (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/Properties/Resources.Designer.cs (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/Properties/Resources.resx (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/Properties/Settings.Designer.cs (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand => RemoveDefaultCommands}/Properties/Settings.settings (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand/CustomCommand_462.csproj => RemoveDefaultCommands/RemoveDefaultCommands_462.csproj} (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand/CustomCommand_462.sln => RemoveDefaultCommands/RemoveDefaultCommands_462.sln} (77%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand/CustomCommand_60.csproj => RemoveDefaultCommands/RemoveDefaultCommands_60.csproj} (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand/CustomCommand_60.sln => RemoveDefaultCommands/RemoveDefaultCommands_60.sln} (55%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand/CustomCommand_80.csproj => RemoveDefaultCommands/RemoveDefaultCommands_80.csproj} (100%) rename Samples/Commands/RemoveDefaultCommands/{CustomCommand/CustomCommand_80.sln => RemoveDefaultCommands/RemoveDefaultCommands_80.sln} (55%) diff --git a/Samples/Commands/RemoveDefaultCommands/README.md b/Samples/Commands/RemoveDefaultCommands/README.md index 5caa9b6a..409bd177 100644 --- a/Samples/Commands/RemoveDefaultCommands/README.md +++ b/Samples/Commands/RemoveDefaultCommands/README.md @@ -1,4 +1,4 @@ -# Custom command sample +# RemoveDefaultCommands sample This sample demonstrate how to remove the default commands from the diagram commands. __*Documentation*__: https://help.syncfusion.com/wpf/diagram/commands#custom-command diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.config b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/App.config similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/App.config rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/App.config diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/App.xaml similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/App.xaml diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml.cs b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/App.xaml.cs similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/App.xaml.cs rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/App.xaml.cs diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/MainWindow.xaml similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/MainWindow.xaml diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml.cs b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/MainWindow.xaml.cs similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/MainWindow.xaml.cs rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/MainWindow.xaml.cs diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/AssemblyInfo.cs b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/AssemblyInfo.cs rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/AssemblyInfo.cs diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.Designer.cs b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/Resources.Designer.cs similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.Designer.cs rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/Resources.Designer.cs diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.resx b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/Resources.resx similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Resources.resx rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/Resources.resx diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.Designer.cs b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/Settings.Designer.cs similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.Designer.cs rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/Settings.Designer.cs diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.settings b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/Settings.settings similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/Properties/Settings.settings rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/Properties/Settings.settings diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.csproj b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_462.csproj similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.csproj rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_462.csproj diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.sln b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_462.sln similarity index 77% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.sln rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_462.sln index 187f596f..4d5438b5 100644 --- a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_462.sln +++ b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_462.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.8.34330.188 +VisualStudioVersion = 17.12.35209.166 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomCommand_462", "CustomCommand_462.csproj", "{7103EB9C-112A-43D6-A024-20F8B0C4337E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoveDefaultCommands_462", "RemoveDefaultCommands_462.csproj", "{7103EB9C-112A-43D6-A024-20F8B0C4337E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -20,6 +20,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {589C603B-BE20-4CC5-99D8-5C87EBFA9E84} + SolutionGuid = {5C81E7FF-27F8-42C3-B7F6-F34EBF38F58E} EndGlobalSection EndGlobal diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.csproj b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_60.csproj similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.csproj rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_60.csproj diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.sln b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_60.sln similarity index 55% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.sln rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_60.sln index ff2b9a1b..a2b28458 100644 --- a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_60.sln +++ b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_60.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.8.34330.188 +VisualStudioVersion = 17.12.35209.166 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomCommand_60", "CustomCommand_60.csproj", "{3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoveDefaultCommands_60", "RemoveDefaultCommands_60.csproj", "{0D6C41B2-3BA5-4F81-97BE-9400960FEF3C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,15 +11,15 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C996F7E-97F8-4009-A51C-DE6FDA80EF4A}.Release|Any CPU.Build.0 = Release|Any CPU + {0D6C41B2-3BA5-4F81-97BE-9400960FEF3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0D6C41B2-3BA5-4F81-97BE-9400960FEF3C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D6C41B2-3BA5-4F81-97BE-9400960FEF3C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0D6C41B2-3BA5-4F81-97BE-9400960FEF3C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {CEE35F1A-6A6A-42BD-A708-48666A137492} + SolutionGuid = {AEDAB2EE-D199-45FA-8083-305B3EB2FF4A} EndGlobalSection EndGlobal diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.csproj b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_80.csproj similarity index 100% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.csproj rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_80.csproj diff --git a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.sln b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_80.sln similarity index 55% rename from Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.sln rename to Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_80.sln index 259debb0..76915908 100644 --- a/Samples/Commands/RemoveDefaultCommands/CustomCommand/CustomCommand_80.sln +++ b/Samples/Commands/RemoveDefaultCommands/RemoveDefaultCommands/RemoveDefaultCommands_80.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.8.34330.188 +VisualStudioVersion = 17.12.35209.166 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomCommand_80", "CustomCommand_80.csproj", "{65523BE2-4EB4-4A78-B82D-3B012C51F358}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoveDefaultCommands_80", "RemoveDefaultCommands_80.csproj", "{03525C01-CB9D-4E46-A5C7-F07A0AEBA26A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,15 +11,15 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {65523BE2-4EB4-4A78-B82D-3B012C51F358}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65523BE2-4EB4-4A78-B82D-3B012C51F358}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65523BE2-4EB4-4A78-B82D-3B012C51F358}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65523BE2-4EB4-4A78-B82D-3B012C51F358}.Release|Any CPU.Build.0 = Release|Any CPU + {03525C01-CB9D-4E46-A5C7-F07A0AEBA26A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {03525C01-CB9D-4E46-A5C7-F07A0AEBA26A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {03525C01-CB9D-4E46-A5C7-F07A0AEBA26A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {03525C01-CB9D-4E46-A5C7-F07A0AEBA26A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {FD0CF816-D0DE-4234-B892-FB072302CF8B} + SolutionGuid = {497240F2-8D67-4EAA-A160-95B4879DF9DF} EndGlobalSection EndGlobal