public static string constructRSSHeadline(string headline, string link) { ObjectCreator oc = new ObjectCreator("ScriptObject", "", typeof(RSSHeadline)); oc["_headline"] = headline; oc["_link"] = link; RSSHeadline ret = oc.Create(); return(ret); }
public void writeToFile(string file) { iGlobal["$rssHeadlineCollection::count"] = this.getCount(); for (uint i = 0; i < this.getCount(); i++) { RSSHeadline hdl = this.getObject(i); sGlobal["$rssHeadlineCollection::headline[" + i + "]"] = hdl.getHeadline(); sGlobal["$rssHeadlineCollection::link[" + i + "]"] = hdl.getLink(); } Util.export("$rssHeadlineCollection::*", file, false); }
public void loadFromFile(string file) { this._simGroup.clear(); iGlobal["$rssHeadlineCollection::count"] = 0; file = Util.getPrefsPath(file); if (Util.isFile(file) || Util.isFile(file + ".dso")) { Util.exec(file, false, false); } for (int i = 0; i < iGlobal["$rssHeadlineCollection::count"]; i++) { //echo( "[LD: " @ %i @ "] Headline: " @ $rssHeadlineCollection::headline[%i] ); //echo( "[LD: " @ %i @ "] Link: " @ $rssHeadlineCollection::link[%i] ); RSSHeadline hdl = constructRSSHeadline(sGlobal["$rssHeadlineCollection::headline[" + i + "]"], sGlobal["$rssHeadlineCollection::link[" + i + "]"]); // This does negate the cache check, but that is ok -pw this.addHeadline(hdl, true); } }
public bool addHeadline(RSSHeadline headline, bool skipReorder) { for (uint i = 0; i < this.getCount(); i++) { RSSHeadline obj = this.getObject(i); if (obj.sameAs(headline)) { //echo( "cache hit headline: " @ %headline.toString() ); return(false); } } this._simGroup.add(headline); if (!skipReorder) { this._simGroup.bringToFront(headline); } //echo( "adding headline: " @ %headline.toString() ); return(true); }
public bool sameAs(RSSHeadline headline) { return(Util.strcmp(this.toString(), headline.toString()) == 0); }
public bool sameAs(RSSHeadline headline) { return (Util.strcmp(this.toString(), headline.toString()) == 0); }
public bool addHeadline(RSSHeadline headline, bool skipReorder) { for (uint i = 0; i < this.getCount(); i++) { RSSHeadline obj = this.getObject(i); if (obj.sameAs(headline)) { //echo( "cache hit headline: " @ %headline.toString() ); return false; } } this._simGroup.add(headline); if (!skipReorder) this._simGroup.bringToFront(headline); //echo( "adding headline: " @ %headline.toString() ); return true; }