1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

RSS Ticker

Discussion in 'HTML, Graphics & Programming' started by robmiller, 14 May 2006.

  1. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    Spent yesterday afternoon writing this since I still hadn't played with some of the features in .NET 2.0:

    [​IMG]

    [​IMG]

    Automatically downloads headlines from Google News every 5 minutes and displays them in a ticker format that's rewindable, pausable and fast-forwardable. You can customise the RSS feed it displays and the time limit between "ticks" by editing the .config file, but I'm going to write a little options dialogue for it too.

    Download

    (Requires version 2.0 of the .NET framework, which you can get here if you don't have it already)

    Tell me what you think!
     
    Last edited: 17 May 2006
  2. Inquisitor

    Capodecina

    Joined: 12 Apr 2004

    Posts: 11,788

    Location: Birmingham

    Quite a nice little app there, very neat :)

    One thing I noticed, though, is that you can maximise it if you double click on the title bar, or by right clicking on it on the taskbar.

    Also, HTML special characters aren't converted, so you end up with things like & #39;West Wing& #39; finale... (put spaces in there to prevent the forum from converting them)

    edit: It doesn't seem to like Slashdot's RSS feed. Which RSS versions does it support?
     
    Last edited: 14 May 2006
  3. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    Oh dearie me I shall hop on those right away!

    Does .NET have anything in-built to convert HTML entities? I would've thought it would given its wealth of XML functions but I'll have a look.
     
  4. Inquisitor

    Capodecina

    Joined: 12 Apr 2004

    Posts: 11,788

    Location: Birmingham

    Not entirely sure, but it would be pretty easy to do yourself. Just strip the &# and ; away, then convert the remaining number into a character. Of course, if you come accross things like & then it gets more tricky :p
     
  5. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    Exactly and I can't guarantee that they'll always be numeric :(
     
  6. Inquisitor

    Capodecina

    Joined: 12 Apr 2004

    Posts: 11,788

    Location: Birmingham

    Other than downloading some kind of third party library or writing your own conversion table, then I can't see how you'd do it :confused:

    Edit: found another bug; clicking on any of the buttons on the tool strip toggles the Always On Top button :p

    Edit 2: and another :o
    If it can't load the feed, then clicking on the bar where the feed entry would normall be results in an unhandled exception! Should have a bottom level exception catching mecanism there :)
     
    Last edited: 14 May 2006
  7. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    My C# is awful :(

    Fixed all those and updated link :)
     
    Last edited: 14 May 2006
  8. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    AFAIK it should support any. Perhaps it's Slashdot's use of the rdf namespace; I'll look into it.
     
  9. Peve

    Wise Guy

    Joined: 7 Sep 2003

    Posts: 1,897

    Location: Bo'ness

    I like it nice and simple the only problem I have is that is seems to eat up a lot of memory nearly 20mb on my system :(
     
  10. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    You're not using the memory otherwise and it'll give it back to the system if it asks for it, so no worries.
     
  11. Inquisitor

    Capodecina

    Joined: 12 Apr 2004

    Posts: 11,788

    Location: Birmingham

    Just had a quick look a the code... you appear to be toggling the TopMost property of the form whenever any toolstrip button is clicked... did you mean to do that? :confused:

    edit: nevermind, was looking at old source code :p
     
    Last edited: 15 May 2006
  12. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    Yah that was the accident that caused it :k
     
  13. Inquisitor

    Capodecina

    Joined: 12 Apr 2004

    Posts: 11,788

    Location: Birmingham

    A quick note: as a general rule, all IDisposable objects should be Dispose()d of when you've finished using them, which is best done with a using block:
    Code:
    using (WebClient client = new WebClient())
    {
        // stuff here
    }
    
    Otherwise, you could potentially end up with a memory leak as IDisposable objects tend to be memory hogs.

    Also, encapsulate your fields! ;)
     
  14. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    kk :cool:

    Yah I'm rubbish at organising stuff in terms of layout within a class :o

    More tips please, I don't get to flex my C# muscles enough so I miss quite a bit of the best-practices stuff!
     
  15. Inquisitor

    Capodecina

    Joined: 12 Apr 2004

    Posts: 11,788

    Location: Birmingham

    A little suggestion for the control you're using there...
    If you want to get rid of the dotted border around the current item, then you can just set the selection mode to none, and use the TopIndex property of the listbox to set the top most visible item, and hence scroll up and down. That's just being picky though :p
     
  16. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    Not picky, useful :D
     
  17. Inquisitor

    Capodecina

    Joined: 12 Apr 2004

    Posts: 11,788

    Location: Birmingham

    Slightly OT here, but what visual style is that?
     
  18. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    Watercolor :)
     
  19. Inquisitor

    Capodecina

    Joined: 12 Apr 2004

    Posts: 11,788

    Location: Birmingham

    Thanks :)

    Just dug this PDF up, which was posted here a while ago. Has some good guidelines for C# coding style, which helps keep things consistent.

    Linkage
     
  20. Conrad11

    Soldato

    Joined: 12 Jun 2005

    Posts: 5,362

    Slightly OT:

    If anyone is thinking, good idea, i would like to try something like that and fancy doing something differnt.

    For people that have rubbish PC's we need to close all our antivirus and other serivces before going into a game. If there was a program out there where you could choose the process' you wanted to shutdown when u wanted to load and game and save that to a config file. Then you could have like a drop down box to choose which game you wanted. and then you click run game....it would close all the programs and open the game and then minimizes to taskbar.

    And then when you have finished gaming you could click on the icon in the taskbar and click a button and it would open all those programs up again.

    A sort of Game Loader....

    anywho....I think it would be a good idea