Ejemplo n.º 1
0
        /**
         * This method is called by IEBrowserDisplayPane to display the specified resource
         * in the browser.
         */

        private void DisplayConversation(IResource resource, AbstractWebBrowser browser, WordPtr[] wordsToHighlight)
        {
            // Ask ConversationManager to format the conversation as HTML and
            // feed it into IEBrowser.
            string htmlString = _convManager.ToHtmlString(resource, _propNick);

            browser.ShowHtml(htmlString, WebSecurityContext.Restricted, DocumentSection.RestrictResults(wordsToHighlight, DocumentSection.BodySection));
        }
Ejemplo n.º 2
0
        public MessageDisplayPane()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            _ieBrowser = Core.WebBrowser;
            _ieBrowser.ContextProvider   = Core.ResourceBrowser;
            _editRtfBody.ContextProvider = Core.ResourceBrowser;
            _editSubject.ContextProvider = new SubjectContextProvider(_editSubject);
        }
Ejemplo n.º 3
0
 private static void DisplayHTML(IResource resource, AbstractWebBrowser browser, WordPtr[] wordsToHighlight)
 {
     try
     {
         StreamReader reader = Core.FileResourceManager.GetStreamReader(resource);
         if (reader != null)
         {
             string sourceUrl = "";
             string htmlText  = Utils.StreamReaderReadToEnd(reader);
             reader.BaseStream.Close();
             IResource source = FileResourceManager.GetSource(resource);
             if (source != null)
             {
                 string url = string.Empty;
                 if (Core.ResourceStore.PropTypes.Exist("URL"))
                 {
                     url = source.GetPropText("URL");
                 }
                 if (url.Length > 0)
                 {
                     sourceUrl = url;
                     htmlText  = HtmlTools.FixRelativeLinks(htmlText, url);
                 }
                 else
                 {
                     string directory = source.GetPropText("Directory");
                     if (directory.Length > 0)
                     {
                         if ((!directory.EndsWith("/")) && (!directory.EndsWith("\\")))
                         {
                             directory += "/";
                         }
                         htmlText = HtmlTools.FixRelativeLinks(htmlText, directory);
                     }
                 }
             }
             try
             {
                 WebSecurityContext context = WebSecurityContext.Restricted;
                 context.WorkOffline = false;
                 browser.ShowHtml(htmlText, context,
                                  DocumentSection.RestrictResults(wordsToHighlight, DocumentSection.BodySection));
                 browser.CurrentUrl = sourceUrl;
             }
             catch (Exception e)
             {
                 Trace.WriteLine(e.ToString(), "Html.Plugin");
             }
         }
     }
     catch (ObjectDisposedException) {}
 }
Ejemplo n.º 4
0
 /**
  * displays conversation as auto-generated html text
  */
 private void DisplayConversation(IResource resource, AbstractWebBrowser browser, WordPtr[] wordsToHighlight)
 {
     try
     {
         browser.ShowHtml(_conversationManager.ToHtmlString(resource, _propNickName), WebSecurityContext.Restricted, DocumentSection.RestrictResults(wordsToHighlight, DocumentSection.BodySection));
     }
     catch (Exception e)
     {
         Trace.WriteLine(e.ToString(), "ICQ.Plugin");
         return;
     }
     _displayedResource = resource.ToResourceListLive();
     _displayedResource.ResourceChanged += ConversationChangedHandler;
 }
Ejemplo n.º 5
0
        private void InitializeBrowserComponent()
        {
            this._browser = Core.WebBrowser.NewInstance();
            this.SuspendLayout();
            _panelContent.SuspendLayout();
            //
            // _browser
            //
            this._browser.Name     = "_browser";
            this._browser.Dock     = DockStyle.Fill;
            this._browser.TabIndex = 12;

            _panelContent.Controls.Add(this._browser);
            _panelContent.ResumeLayout(false);
            this.ResumeLayout(false);

            _browser.ContextProvider = this;
        }