Search results

  1. brentnewbury

    Indexed Properties

    Just tried it then realise the reason why I didnt use this method; I dont want anything outside the Article class to be able to add/remove pages. The reason for this is that the Article constructor takes one parameter; the Article ID. From there the constructor initialises the class and sets up...
  2. brentnewbury

    Indexed Properties

    Damn! I finally get what you mean. Like a prat I just didnt think about proper collection classes! (I have been awake for 28 hours :yawn: :) Thank you for the advise.
  3. brentnewbury

    Indexed Properties

    I have a Article Class that has a list of Pages. To me, myArticle[0]; seems to completed ignore the relationship between an Article and its Pages. myArtical.Page[0]; seems to model the relationship quite well between an Article and its Pages.. Im finding it difficult to articulate what I have...
  4. brentnewbury

    Indexed Properties

    Eureaka! The best solution Ive come up with so far is: public IList<Item> Items { get { return this._collection.AsReadOnly(); } } Ive attached a working solution (see bellow). The idea behind this is to stop any abuse due to exposing the underlying collection, like so:public List<Item> Items {...
  5. brentnewbury

    Indexed Properties

    The problem with public List<Item> Items {} is that you expose the entire underlying collection. Declaring the collection as readonly seems to have problems of its own. I dont understand why Microsoft just doesnt expand System.Runtime.CompilerServices.IndexerName("...") for use with all...
  6. brentnewbury

    Indexed Properties

    Well bloody hell! Ive just been searching for bloody hours trying to find stuff about named indexers (e.g. System.Runtime.CompilerServices.CSharp.IndexName("..."), System.Runtime.CompilerServices.IndexerName("..."), etc). Im bloody annoyed with myself! But why dont Microsoft just have named...
  7. brentnewbury

    Indexed Properties

    Hiya all, Im not a newbie to .NET by any means, but Ive obviously missed something big here. For some reason I cant seem to get indexed properties to work! Well, not in the way I want (and think to be most logical), I can get them to work like:public int this[int index] { get { ... }...
  8. brentnewbury

    Console.ReadLine()

    Hiya onez7285, It seems as though you are trying to debug your complicated loops. If I am correct may I suggest using Break Points instead of Console.ReadLines()s and setting Break conditions on the Break Points. Happy Coding :D Brent Newbury
  9. brentnewbury

    Memory Issue

    Hiya unbreakable, Here is a small section out of the Developing Windows-Based Applications using Visual Basic.NET and Visual C# (Microsoft Press)
  10. brentnewbury

    Need help windows application

    If you are using Visual Studio; you may havew to add them *** references to your project. Happy Coding :D Brent Newbury
  11. brentnewbury

    Memory Issue

    Hiya unbreakable, I dont know of any way to log or report memory consumption, but you can use Tracing and and a few other tools to help you diagnose performance bottlenecks. When I get home, Ill try to remember to paraphrase a chapter out of Developing Windows-Based Application (with Visual...
  12. brentnewbury

    Advise newbie with C# questions

    Hiya newbie101, I have no experience using barcode scanners but then general idea would be to have a thread running that will "listen" for barcodes being scanned. Once a barcode is detected it would be processed and then the "listening" thread would start to "listen" again. I hope this makes...
  13. brentnewbury

    NAT and TCP Sockets

    Thank you Mykre, That sounds like a good idea. I think I may have a look at that. Brent Newbury
  14. brentnewbury

    NAT and TCP Sockets

    Hiya Mykre, I agree with what you said about port forwarding however, Windows/MSN Messenger do not need any port forwarding to be setup (well, they arent on my Windows Server 2003 home server). I was wondering how this was accomplished. Thank you for your time, Brent Newbury
  15. brentnewbury

    NAT and TCP Sockets

    Hiya all, Im trying to create a sample Peer 2 Peer chat application. However, Im having trouble with Network Address Translation (NAT). Programs like MSN/Windows Messenger use NAT (I know they arent coded in C# :)). However, when Im sending or listening for information Im using TCP Listeners...
Back
Top