-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#77: Include ProviderTemplate tool with the Maestro install. Add a pr…
…eference UI to set this path and include a tools menu entry for it.
- Loading branch information
1 parent
583cbce
commit c7c1868
Showing
10 changed files
with
243 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#region Disclaimer / License | ||
|
||
// Copyright (C) 2019, Jackie Ng | ||
// https://github.com/jumpinjackie/mapguide-maestro | ||
// | ||
// This library is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 2.1 of the License, or (at your option) any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public | ||
// License along with this library; if not, write to the Free Software | ||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
// | ||
|
||
#endregion Disclaimer / License | ||
|
||
using ICSharpCode.Core; | ||
using Maestro.Base.UI.Preferences; | ||
using Maestro.Shared.UI; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Maestro.Base.Commands | ||
{ | ||
internal class ProviderTemplateToolCommand : AbstractMenuCommand | ||
{ | ||
public override void Run() | ||
{ | ||
RunTool(); | ||
} | ||
|
||
internal static void RunTool() | ||
{ | ||
string exe = PropertyService.Get(ConfigProperties.ProviderToolPath, string.Empty); //NOXLATE | ||
|
||
if (!File.Exists(exe)) | ||
{ | ||
using (var dlg = DialogFactory.OpenFile()) | ||
{ | ||
dlg.Title = string.Format(Strings.LocateExecutable, "ProviderTemplate.exe"); //NOXLATE | ||
dlg.Filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickExe, "exe"); //NOXLATE | ||
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) | ||
{ | ||
exe = dlg.FileName; | ||
PropertyService.Set(ConfigProperties.ProviderToolPath, exe); | ||
} | ||
} | ||
} | ||
|
||
var procInfo = new ProcessStartInfo(exe); | ||
procInfo.WorkingDirectory = Path.GetDirectoryName(exe); | ||
var proc = Process.Start(procInfo); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Maestro.Base/UI/Preferences/GeneralPreferencesCtrl.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.