-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usgs toolbox dotspatial migration updates
-enable timeseries statistics in dotspatial -template for statusmonitor -additional demo ui components
- Loading branch information
Showing
15 changed files
with
427 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
using System; | ||
using System.Windows.Forms; | ||
using DotSpatial.Controls; | ||
using DotSpatial.Controls.Docking; | ||
using DotSpatial.Controls.Header; | ||
|
||
namespace HydrologicToolbox.USGS | ||
{ | ||
public class USGSPlugin : Extension | ||
{ | ||
private const string UniqueKeyPluginStoredValueDate = "UniqueKey-PluginStoredValueDate"; | ||
private const string AboutPanelKey = "kUSGS"; | ||
private DateTime _storedValue; | ||
|
||
public override void Activate() | ||
{ | ||
// add some menu items... | ||
AddMenuItems(App.HeaderControl); | ||
|
||
// code for saving plugin settings... | ||
App.SerializationManager.Serializing += ManagerSerializing; | ||
App.SerializationManager.Deserializing += ManagerDeserializing; | ||
|
||
//AddDockingPane(); | ||
|
||
base.Activate(); | ||
} | ||
|
||
public override void Deactivate() | ||
{ | ||
// Do not forget to unsubscribe event handlers | ||
App.SerializationManager.Serializing -= ManagerSerializing; | ||
App.SerializationManager.Deserializing -= ManagerDeserializing; | ||
|
||
// Remove all GUI components which were added by plugin | ||
App.DockManager.Remove(AboutPanelKey); | ||
App.HeaderControl.RemoveAll(); | ||
|
||
base.Deactivate(); | ||
} | ||
|
||
private void AddMenuItems(IHeaderControl header) | ||
{ | ||
const string SampleMenuKey = "kSample1"; | ||
|
||
// Root menu | ||
header.Add(new RootItem(SampleMenuKey, "USGS")); | ||
|
||
// Add some child menus | ||
header.Add(new SimpleActionItem(SampleMenuKey, "Baseflow", null) { Enabled = true }); | ||
header.Add(new SimpleActionItem(SampleMenuKey, "RECESS", OnMenuClickEventHandler)); | ||
header.Add(new SimpleActionItem(SampleMenuKey, "RORA", OnMenuClickEventHandler)); | ||
|
||
// Add sub menus | ||
header.Add(new MenuContainerItem(SampleMenuKey, "submenu1", "SWSTAT")); | ||
header.Add(new SimpleActionItem(SampleMenuKey, "submenu1", "Integrated Design Flow", OnMenuClickEventHandler)); | ||
header.Add(new SimpleActionItem(SampleMenuKey, "submenu1", "Frequency", OnMenuClickEventHandler)); | ||
} | ||
|
||
private void OnMenuClickEventHandler(object sender, EventArgs e) | ||
{ | ||
var act = ((SimpleActionItem) sender).Caption; | ||
//MessageBox.Show("Clicked " + act); | ||
switch (act) | ||
{ | ||
case "Alpha": | ||
case "Bravo": | ||
var frmAbout = new frmTest(); | ||
frmAbout.ShowDialog(); | ||
break; | ||
} | ||
} | ||
|
||
private void AddDockingPane() | ||
{ | ||
/* | ||
var form = new frmTest(); | ||
form.okButton.Click += (o, args) => App.DockManager.HidePanel(AboutPanelKey); | ||
var aboutPanel = new DockablePanel(AboutPanelKey, "About", form.tableLayoutPanel, DockStyle.Right); | ||
App.DockManager.Add(aboutPanel); | ||
*/ | ||
} | ||
|
||
private void ManagerDeserializing(object sender, SerializingEventArgs e) | ||
{ | ||
var manager = (SerializationManager)sender; | ||
_storedValue = manager.GetCustomSetting(UniqueKeyPluginStoredValueDate, DateTime.Now); | ||
} | ||
|
||
private void ManagerSerializing(object sender, SerializingEventArgs e) | ||
{ | ||
var manager = (SerializationManager)sender; | ||
manager.SetCustomSetting(UniqueKeyPluginStoredValueDate, _storedValue); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace HydrologicToolbox.USGS | ||
{ | ||
public partial class frmTest : Form | ||
{ | ||
public frmTest() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
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,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace BASINSDS | ||
{ | ||
public class clsPluginProperties | ||
{ | ||
public const string g_CacheDir = @"C:\BASINSDS\Cache\"; | ||
public const string g_PathChar = @"\"; | ||
public const string g_AppNameShort = @"Hydro Toolbox"; | ||
//Logger.Icon = g_MapWin.ApplicationInfo.FormIcon | ||
} | ||
} |
Oops, something went wrong.