1

If anyone can think of a better way please let me know:

I have a windows form that displays different links to three sites: Yahoo Finance, Bloomberg and Merrill Lynch. Yahoo and Bloomberg both use a separate class that utilized HttpWebRequest to return the headlines as links, but because ML is so secure, I had to create a separate class that uses WebBrowser to stay logged in.

I'm going to use this class to retrieve a list of hyperlinks, but I'm not sure if I should do either of the following:

  1. Create two methods: One for the inner text of the links, and the other for the link addresses
  2. Design a link struct that can hold both values or
  3. Something I haven't thought of.
2
  • 1
    Both the first and the second would be all fine. If, for the first, you'll need to iterate the DOM twice, I'd go for the second option. There is some opinion and taste here as well Commented Feb 7, 2015 at 3:10
  • 1
    I'm leaning towards the second, obviously for code-clarity purposes. Thanks for the input! Commented Feb 7, 2015 at 3:12

1 Answer 1

2

Both the first and the second would be all fine. If, for the first, you'll need to iterate the DOM twice, I'd go for the second option. There is some opinion and taste here as well.

The third option would be to use the built-in tuple.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.