Esempio n. 1
0
 private void boilerPlateSelected(Data.Boilerplate item)
 {
     var msg = new SendBoilerplateMessage(item.Text);
     Messenger.Default.Send<SendBoilerplateMessage>(msg);
 }
        private object ReceiveMessage(SendBoilerplateMessage action)
        {
            try
            {
                Debug.Print(@"///////////////////////// BEGIN SEND /////////////////////////");
                Debug.Print(action.Text);
                wbFeed.Focus();
                dynamic document = wbFeed.Document;
                if (document != null)
                {
                    try
                    {
                        // HACK: I don't need these properties, but evaluating them
                        //       before accessing other properties I need seems to
                        //       avoid issues with dynamic properties thru COM.
                        //       Go figure...
                        string chset = document.charset;
                        dynamic el = document.ActiveElement;
                        // /HACK
                    }
                    catch(Exception ex)
                    {
                        Debug.Print(ex.StackTrace);
                        string chset = document.charset;
                    }

                    System.Threading.Thread.Sleep(10);

                    try
                    {
                        sendTextViaInnerText(document, action.Text);
                    }
                    catch(Exception)
                    {
                        try
                        {
                            sendTextViaClipboard(document, action.Text);
                        }
                        catch(Exception)
                        {
                            throw;
                        }

                    }

                }
                else
                {
                    Debug.Print(@"-------- SORRY, NO DOCUMENT --------------");
                }

                Debug.Print(@"\\\\\\\\\\\\\\\\\\\\\\\\\ END SEND \\\\\\\\\\\\\\\\\\\\\\\\\");

            }
            catch (Exception e)
            {
                // Ignore
                Debug.Print(e.StackTrace);
                Debug.Print(@"------------------------- EXCEPTION SEND -------------------------");

            }
            return null;
        }
Esempio n. 3
0
        private void boilerPlateSelected(Data.Boilerplate item)
        {
            var msg = new SendBoilerplateMessage(item.Text);

            Messenger.Default.Send <SendBoilerplateMessage>(msg);
        }