Exemplo n.º 1
0
        private void lblFavoriteGlyph_Click(object sender, EventArgs e)
        {
            Label label = sender as Label;

            if (label != null)
            {
                int favoriteIndex = label.Name[label.Name.Length - 1] - '0';
                if (UserSettings.Instance.Favorites[favoriteIndex] != 0)
                {
                    HideApplication();
                    UnicodeCharSender.Send(hTargetWindow, UserSettings.Instance.Favorites[favoriteIndex]);
                }
            }
        }
Exemplo n.º 2
0
        private void frmCharacterLookup_ResultSubmitted(object sender, CharacterSearchResultEventArgs e)
        {
            switch (e.Result.Action)
            {
            case CharacterSearchAction.Cancel:
                break;

            case CharacterSearchAction.InsertCharacter:
                if (!e.Result.KeepApplicationActive)
                {
                    HideApplication();
                }

                try
                {
                    UnicodeCharSender.Send(hTargetWindow, e.Result.CharacterCode);
                }
                catch (Exception ex)
                {
                    ShowErrorMessage(LocalizationHelper.GetResource(this, "msgSendCharFailed"), ex);
                }

                if (e.Result.KeepApplicationActive)
                {
                    NativeMethods.SetForegroundWindow(Handle);
                }
                break;

            case CharacterSearchAction.CopyCharacterToClipboard:
                Clipboard.SetText(((char)e.Result.CharacterCode).ToString());
                HideApplication();
                break;

            case CharacterSearchAction.AddCharacterToFavorites:
                int?selectedIndex = AddToFavoritesForm.Execute(e.Result.CharacterCode, this);
                if (selectedIndex.HasValue)
                {
                    UserSettings.Instance.Favorites[selectedIndex.Value] = e.Result.CharacterCode;
                    UserSettings.Instance.Save(false);
                    LoadFavorites();
                }
                break;
            }
        }
Exemplo n.º 3
0
 private void commandGateway_SendCharacterCommandReceived(object sender, SendCharacterCommandEventArgs e)
 {
     UnicodeCharSender.Send(hTargetWindow, e.CharacterCode);
 }