protected IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { if (msg == WM_WINCOMPOSE.DISABLE) { if (Process.GetCurrentProcess().Id != (int)wParam) { DisableEvent?.Invoke(); } handled = true; } else if (msg == WM_WINCOMPOSE.EXIT) { if (Process.GetCurrentProcess().Id != (int)wParam) { ExitEvent?.Invoke(); } handled = true; } else if (msg == WM_WINCOMPOSE.SETTINGS) { SettingsEvent?.Invoke(); handled = true; } else if (msg == WM_WINCOMPOSE.SEQUENCES) { SequencesEvent?.Invoke(); handled = true; } return(IntPtr.Zero); }
public bool HandleEvent(SettingsEvent argSettingsEvent, Item argItem) { if (argItem.Id == "testBinPath") { if (!IsValidInstallation()) { throw new PluginException("This is NOT a valid Hugin installation path."); } else { var huginExePath = Path.Combine(_settings.HuginBinPath, "hugin.exe"); System.Diagnostics.Process.Start(huginExePath); } } if (argItem.Id == "downloadButton") { System.Diagnostics.Process.Start("http://hugin.sourceforge.net/download/"); return(false); } if (argItem.Id == "saveBinPath") { if (!IsValidInstallation()) { throw new PluginException("This is NOT a valid Hugin installation path."); } _settingsRepo.Save(_settings); return(true); } return(false); }
public bool HandleEvent(SettingsEvent argSettingsEvent, Item argItem) { var button = argItem as ButtonItem; if (button.Id == "loginButton") { Console.Out.WriteLine("authenticating user..."); Thread.Sleep(4000); // simulate loging in if (username == "user" && password == "pass") { showLabel = Label.ShowLoginOk; Console.Out.WriteLine("user authenticated"); return(true); } else { showLabel = Label.ShowLoginFailed; Console.Out.WriteLine("authentication failed"); return(true); } } else if (button.Id == "logoutButton") { Console.Out.WriteLine("logging out..."); showLabel = Label.ShowLogoutOk; username = ""; password = ""; return(true); } return(false); }
public bool HandleEvent(SettingsEvent argSettingsEvent, Item argItem) { if (argItem.Id == "openSettings") { Process.Start(ManagementProgramPath); return(true); } return(false); }
public void OnSettingsEvent(SettingsEvent message) { throw new NotImplementedException(); }
private void MethodToExecute() { SettingsEvent?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Updated settings was received. /// </summary> /// <param name="message"></param> public void OnSettingsEvent(SettingsEvent message) { _settings = message.Values; _logger?.LogInformation($"[OnSettings] Settings: {JsonSerializer.Serialize(_settings)}"); }
void ITouchPortalEventHandler.OnSettingsEvent(SettingsEvent message) => _logger.LogDebug("Method invoked '{0}'", nameof(ITouchPortalEventHandler.OnSettingsEvent));
private void btnSettings_Click(object sender, System.EventArgs e) { SettingsEvent?.Invoke(); }
/// <summary> /// Update HMI when settings changed. /// </summary> static public void OnSettingsChanged() { SettingsEvent?.Invoke(null, null); }
public void OnSettingsEvent(SettingsEvent message) { //NotImplemented }