There is a newer post on this plugin here in my blog!
I found some articles on the resource handling, so I made the retriving of the data which was mentioned in
Wordpress/Blogsome plugin for Omea Reader post more simple . I can use context.SelectedPlainText; instead of JetBrains.Omea.OpenAPI.Core.WebBrowser.SelectedText; to retrieve the selected text of the resource. The other thing, that I can user context.SelectedResources[0].GetStringProp("Subject"); to retrieve the Title of the page. I thing I made it too complicated at first glance.

In exuse of this complicated implementation I need to mention that the articles are almost "hidden". I read one a day before yesterday but I didn’t manage to find it next day at the omea site. It seems if the authors wants to hide the important informations about plugin development.

Fortunatelly I’ve found it in the history. This is the new Execute() method implementation:
/// <summary>
/// Initializes the popup and displayes it
/// </summary>
/// <param name="context">Actioncontext</param>
public void Execute( IActionContext context )
{
IResourceList list = context.SelectedResources;
if
(list.Count == 1)
{
//Retrieves the subject of the resource.
string popupTitle = HttpUtility.UrlEncode(list[0].GetStringProp("Subject"));
string selectedText = "";
if(context.SelectedPlainText != null)
{
//Retrieves the selected text on the currently displayed resource
selectedText = HttpUtility.UrlEncode( context.SelectedPlainText.Trim() );
}
//Retrieves the URL of the displayed resource
string currentUrl = HttpUtility.UrlEncode( list[0].GetStringProp("Link"));
//Lets show the popup window
Process.Start( String.Format("http://skorozsi.blogsome.com/wp-admin/bookmarklet.php?text={0}&popupurl={1}&popuptitle={2}",selectedText, currentUrl, popupTitle)); }
}
This is the new Update() method implementation:
/// <summary>
/// Enable the action only if there is a selected resource.
/// </summary>
public void Update( IActionContext context, ref ActionPresentation presentation )
{
presentation.Visible = context.SelectedResources.Count == 1;
}
Colorized by:
CarlosAg.CodeColorizer