Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        public bool HandleEvent(SettingsEvent argSettingsEvent, Item argItem)
        {
            if (argItem.Id == "openSettings")
            {
                Process.Start(ManagementProgramPath);
                return(true);
            }

            return(false);
        }
Beispiel #5
0
 public void OnSettingsEvent(SettingsEvent message)
 {
     throw new NotImplementedException();
 }
Beispiel #6
0
 private void MethodToExecute()
 {
     SettingsEvent?.Invoke(this, EventArgs.Empty);
 }
Beispiel #7
0
 /// <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));
Beispiel #9
0
 private void btnSettings_Click(object sender, System.EventArgs e)
 {
     SettingsEvent?.Invoke();
 }
Beispiel #10
0
 /// <summary>
 /// Update HMI when settings changed.
 /// </summary>
 static public void OnSettingsChanged()
 {
     SettingsEvent?.Invoke(null, null);
 }
 public void OnSettingsEvent(SettingsEvent message)
 {
     //NotImplemented
 }