public IEAttach OpenAttach() { try { IEMessage message = OpenMessage(); if (message == null) { return(null); } using ( message ) { if (_num == -1) { _num = GetAttachNum(message, _attachmentIndex); ResourceProxy resAttach = new ResourceProxy(_resAttach); resAttach.SetPropAsync(PROP.PR_ATTACH_NUM, _num); resAttach.SetPropAsync(PROP.AttachMethod, _attachMethod); } return(message.OpenAttach(_num)); } } catch { return(null); } }
public void SetSyncComplete() { IResource resource = GetSyncVersionResource(); ResourceProxy proxy = new ResourceProxy(resource); proxy.SetPropAsync(PROP.SyncComplete, true); }
public void RemoteSetMozillaBookmarkId(int idres, string rdfid) { IResource res = Core.ResourceStore.TryLoadResource(idres); if (res != null) { ResourceProxy proxy = new ResourceProxy(res); proxy.SetPropAsync(_propBookmarkId, rdfid); } }
protected override void Execute() { if (_status == RSSWorkStatus.NotStarted) { ResourceProxy proxy = new ResourceProxy(_feed); // the immediate priority is required to make sure that the resource job to set // (updating) status is executed before the parse job, which also has // immediate priority proxy.AsyncPriority = JobPriority.Immediate; proxy.SetPropAsync(Props.UpdateStatus, "(updating)"); _status = RSSWorkStatus.InProgress; } RSSLoadDelegate(); }
private void setGroupUnit_Finished(AsciiProtocolUnit unit) { AsciiSendLineGetLineUnit setGroupUnit = (AsciiSendLineGetLineUnit)unit; _responseLine = setGroupUnit.ResponseLine; string error = null; if (_responseLine == null) { if (_connection.LastSocketException != null) { error = _connection.LastSocketException.Message; } else { error = "Newsgroup could not be processed"; } } else if (!_responseLine.StartsWith("211")) { if (_responseLine.Length > 4) { error = _responseLine.Substring(4); } else { error = "Newsgroup could not be processed"; } } ResourceProxy proxy = new ResourceProxy(_group.Resource); if (error != null) { proxy.SetPropAsync(Core.Props.LastError, error); } else { proxy.DeletePropAsync(Core.Props.LastError); } FireFinished(); }
public override void DisplayResource(IResource article, WordPtr[] wordsToHighlight) { if (_downloadLabel == null) { _downloadLabel = new JetLinkLabel(); _downloadLabel.Text = "Click here or press F5 to download the article"; _downloadLabel.BackColor = Color.Transparent; _downloadLabel.ClickableLink = true; _downloadLabel.Click += _downloadLabel_Click; Controls.Add(_downloadLabel); } _downloadLabel.Visible = false; _ieBrowser.Visible = true; bool redisplayed = _articleIsRedisplayed; _articleIsRedisplayed = false; DisposeArticleListener(); // Set the subject, highlight if needed ShowSubject(article.GetPropText(Core.Props.Subject), wordsToHighlight); try { // The content being indexed (plaintext) is not the same that is // displayed (autogenerated HTML), so the offsets are updated by // this method to correspond to the new formatting. string sFormattedArticle = ArticleBody2Html(article, ref wordsToHighlight); ShowHtml(sFormattedArticle, _ctxRestricted, wordsToHighlight); } catch (Exception e) { Utils.DisplayException(e, "Error"); return; } /** * set last selected article for article's owner */ IResource owner = _rbrowser.OwnerResource; if (owner != null && (owner.Type == NntpPlugin._newsGroup || owner.Type == NntpPlugin._newsFolder || owner.Type == NntpPlugin._newsServer)) { ResourceProxy proxy = new ResourceProxy(owner); proxy.AsyncPriority = JobPriority.AboveNormal; proxy.SetPropAsync(NntpPlugin._propLastSelectedArticle, article.Id); } _articleListener = article.ToResourceListLive(); _articleListener.ResourceChanged += _articleListener_ResourceChanged; bool hasNoBody = article.HasProp(NntpPlugin._propHasNoBody); if (!hasNoBody) { Core.UIManager.GetStatusWriter(this, StatusPane.Network).ClearStatus(); } else { if (!Utils.IsNetworkConnectedLight()) { ShowHtml("<pre>" + NntpPlugin._networkUnavailable + ".</pre>", WebSecurityContext.Internet, null); return; } IResourceList groups = article.GetLinksOfType(NntpPlugin._newsGroup, NntpPlugin._propTo); if (groups.Count > 0) { foreach (IResource groupRes in groups.ValidResources) { IResource server = new NewsgroupResource(groupRes).Server; if (server != null) { ServerResource serverRes = new ServerResource(server); if (redisplayed || serverRes.DownloadBodiesOnDeliver || serverRes.DownloadBodyOnSelection) { Core.UIManager.GetStatusWriter(this, StatusPane.Network).ShowStatus("Downloading article..."); NntpConnection articlesConnection = NntpConnectionPool.GetConnection(server, "foreground"); NntpDownloadArticleUnit downloadUnit = new NntpDownloadArticleUnit(article, groupRes, JobPriority.Immediate, true); downloadUnit.OnProgress += downloadUnit_OnProgress; ShowHtml("<pre>Downloading article: 0%</pre>", WebSecurityContext.Internet, null); articlesConnection.StartUnit(Int32.MaxValue - 1, downloadUnit); return; } } } if (!redisplayed) { Point location = _ieBrowser.Location; _downloadLabel.Location = new Point(location.X + 8, location.Y + 8); _downloadLabel.Visible = true; _ieBrowser.Visible = false; } } } }
private void OnAfterExpand(object sender, System.Windows.Forms.TreeViewEventArgs e) { ResourceProxy folder = new ResourceProxy((IResource)e.Node.Tag); folder.SetPropAsync(PROP.OpenSelectFolder, 1); }