From d655680fded604c3aa848a8a66a0e1f541d6c0bb Mon Sep 17 00:00:00 2001 From: PeterZhong Date: Sun, 27 Apr 2025 12:06:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Config.daml | 31 ++++++++------ LinkToolAddin.csproj | 8 ---- Module1.cs => LinkToolModule.cs | 6 +-- ui/{Button1.cs => VersionButton.cs} | 2 +- .../DialogDockpane.xaml} | 6 +-- .../DialogDockpane.xaml.cs} | 8 ++-- .../DialogDockpaneViewModel.cs} | 12 +++--- ui/preference/ProWindow1.xaml | 22 ++++++++++ ui/preference/ProWindow1.xaml.cs | 28 +++++++++++++ ui/preference/ShowProWindow1.cs | 42 +++++++++++++++++++ 11 files changed, 128 insertions(+), 38 deletions(-) rename Module1.cs => LinkToolModule.cs (83%) rename ui/{Button1.cs => VersionButton.cs} (95%) rename ui/{Dockpane1.xaml => dockpane/DialogDockpane.xaml} (88%) rename ui/{Dockpane1.xaml.cs => dockpane/DialogDockpane.xaml.cs} (72%) rename ui/{Dockpane1ViewModel.cs => dockpane/DialogDockpaneViewModel.cs} (81%) create mode 100644 ui/preference/ProWindow1.xaml create mode 100644 ui/preference/ProWindow1.xaml.cs create mode 100644 ui/preference/ShowProWindow1.cs diff --git a/.gitignore b/.gitignore index d9b1680..1b22170 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ ./vs/ ./bin/ ./obj/ +./Properties/launchSettings.json *.sln.iml *.DotSettings *.dotCover diff --git a/Config.daml b/Config.daml index e08f198..9147f6f 100644 --- a/Config.daml +++ b/Config.daml @@ -11,34 +11,39 @@ Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration --> - + - + + - - - - + + - - + + diff --git a/LinkToolAddin.csproj b/LinkToolAddin.csproj index e08d647..818ba95 100644 --- a/LinkToolAddin.csproj +++ b/LinkToolAddin.csproj @@ -101,14 +101,6 @@ - - - - - MSBuild:Compile - Wpf - Designer - diff --git a/Module1.cs b/LinkToolModule.cs similarity index 83% rename from Module1.cs rename to LinkToolModule.cs index a3bb786..1d4476d 100644 --- a/Module1.cs +++ b/LinkToolModule.cs @@ -21,14 +21,14 @@ using System.Windows.Input; namespace LinkToolAddin { - internal class Module1 : Module + internal class LinkToolModule : Module { - private static Module1 _this = null; + private static LinkToolModule _this = null; /// /// Retrieve the singleton instance to this module here /// - public static Module1 Current => _this ??= (Module1)FrameworkApplication.FindModule("LinkToolAddin_Module"); + public static LinkToolModule Current => _this ??= (LinkToolModule)FrameworkApplication.FindModule("LinkToolAddin_Module"); #region Overrides /// diff --git a/ui/Button1.cs b/ui/VersionButton.cs similarity index 95% rename from ui/Button1.cs rename to ui/VersionButton.cs index c50b51a..62e157d 100644 --- a/ui/Button1.cs +++ b/ui/VersionButton.cs @@ -20,7 +20,7 @@ using System.Threading.Tasks; namespace LinkToolAddin { - internal class Button1 : Button + internal class VersionButton : Button { private string version = "0.1.0"; protected override void OnClick() diff --git a/ui/Dockpane1.xaml b/ui/dockpane/DialogDockpane.xaml similarity index 88% rename from ui/Dockpane1.xaml rename to ui/dockpane/DialogDockpane.xaml index d007c5e..3b569d7 100644 --- a/ui/Dockpane1.xaml +++ b/ui/dockpane/DialogDockpane.xaml @@ -1,14 +1,14 @@ - + d:DataContext="{Binding Path=ui.DialogDockpaneViewModel}"> diff --git a/ui/Dockpane1.xaml.cs b/ui/dockpane/DialogDockpane.xaml.cs similarity index 72% rename from ui/Dockpane1.xaml.cs rename to ui/dockpane/DialogDockpane.xaml.cs index 6663993..4a594fd 100644 --- a/ui/Dockpane1.xaml.cs +++ b/ui/dockpane/DialogDockpane.xaml.cs @@ -14,14 +14,14 @@ using System.Windows.Navigation; using System.Windows.Shapes; -namespace LinkToolAddin +namespace LinkToolAddin.ui.dockpane { /// - /// Interaction logic for Dockpane1View.xaml + /// Interaction logic for DialogDockpaneView.xaml /// - public partial class Dockpane1View : UserControl + public partial class DialogDockpaneView : UserControl { - public Dockpane1View() + public DialogDockpaneView() { InitializeComponent(); } diff --git a/ui/Dockpane1ViewModel.cs b/ui/dockpane/DialogDockpaneViewModel.cs similarity index 81% rename from ui/Dockpane1ViewModel.cs rename to ui/dockpane/DialogDockpaneViewModel.cs index 8b77c2e..5871201 100644 --- a/ui/Dockpane1ViewModel.cs +++ b/ui/dockpane/DialogDockpaneViewModel.cs @@ -18,13 +18,13 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace LinkToolAddin +namespace LinkToolAddin.ui.dockpane { - internal class Dockpane1ViewModel : DockPane + internal class DialogDockpaneViewModel : DockPane { - private const string _dockPaneID = "LinkToolAddin_Dockpane1"; + private const string _dockPaneID = "DialogDockpane"; - protected Dockpane1ViewModel() { } + protected DialogDockpaneViewModel() { } /// /// Show the DockPane. @@ -52,11 +52,11 @@ namespace LinkToolAddin /// /// Button implementation to show the DockPane. /// - internal class Dockpane1_ShowButton : Button + internal class DialogDockpane_ShowButton : Button { protected override void OnClick() { - Dockpane1ViewModel.Show(); + DialogDockpaneViewModel.Show(); } } } diff --git a/ui/preference/ProWindow1.xaml b/ui/preference/ProWindow1.xaml new file mode 100644 index 0000000..5a8f725 --- /dev/null +++ b/ui/preference/ProWindow1.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/ui/preference/ProWindow1.xaml.cs b/ui/preference/ProWindow1.xaml.cs new file mode 100644 index 0000000..2383c71 --- /dev/null +++ b/ui/preference/ProWindow1.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +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 LinkToolAddin.ui.preference +{ + /// + /// Interaction logic for ProWindow1.xaml + /// + public partial class ProWindow1 : ArcGIS.Desktop.Framework.Controls.ProWindow + { + public ProWindow1() + { + InitializeComponent(); + } + } +} diff --git a/ui/preference/ShowProWindow1.cs b/ui/preference/ShowProWindow1.cs new file mode 100644 index 0000000..bbfce67 --- /dev/null +++ b/ui/preference/ShowProWindow1.cs @@ -0,0 +1,42 @@ +using ArcGIS.Core.CIM; +using ArcGIS.Core.Data; +using ArcGIS.Core.Geometry; +using ArcGIS.Desktop.Catalog; +using ArcGIS.Desktop.Core; +using ArcGIS.Desktop.Editing; +using ArcGIS.Desktop.Extensions; +using ArcGIS.Desktop.Framework; +using ArcGIS.Desktop.Framework.Contracts; +using ArcGIS.Desktop.Framework.Dialogs; +using ArcGIS.Desktop.Framework.Threading.Tasks; +using ArcGIS.Desktop.KnowledgeGraph; +using ArcGIS.Desktop.Layouts; +using ArcGIS.Desktop.Mapping; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace LinkToolAddin.ui.preference +{ + internal class ShowProWindow1 : Button + { + + private ProWindow1 _prowindow1 = null; + + protected override void OnClick() + { + //already open? + if (_prowindow1 != null) + return; + _prowindow1 = new ProWindow1(); + _prowindow1.Owner = FrameworkApplication.Current.MainWindow; + _prowindow1.Closed += (o, e) => { _prowindow1 = null; }; + _prowindow1.Show(); + //uncomment for modal + //_prowindow1.ShowDialog(); + } + + } +}