NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 64 65 66 67 68 … 93 Next »
StringDictionary

 
  • 0 Vote(s) - 0 Average
StringDictionary
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,599
Threads: 388
Joined: Dec 2004
#1
2005-12-03, 08:46 PM
The System.Collections.Specialized.StringDictionary looked to be ideal for what I needed but it seems to convert all Keys to lower case. The values retain case-sensitivity but I specifically need both to do this.

I use (example)
Code:
MyDict.Add("aBCd", "eFGh");
...

// then use the String Dictionary enumerator and a DictionaryEntry

MyEntry = (DictionaryEntry) MyEnum.Current;
But in this case, MyEntry.Keys and MyEntry.Value will return "abcd" and "eFGh". Sorry - new at C# collections - is this expected behaviour? Can I use an alternative collection type?

Cheers,
Brian
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#2
2005-12-03, 10:36 PM
According to: http://msdn.microsoft.com/library/defaul...stopic.asp

Quote:The key is handled in a case-insensitive manner; it is translated to lower case before it is used with the string dictionary.

I would a Hashtable and just use string objects with it.

More info on the MSDN: http://msdn.microsoft.com/library/defaul...stopic.asp
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,599
Threads: 388
Joined: Dec 2004
#3
2005-12-03, 11:58 PM
Thanks. I'm using C# in a Nutshell as a reference and I couldn't find anything about case handling - it's possibly in there somewhere. Seems bizarre behaviour to me. A string should be a string, 'case and all' unless explicitly manipulated otherwise - oh well.

Cheers,
Brian
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#4
2005-12-04, 09:07 AM
Normaly a string is handled "case and all" but the specialised dictionary overides this - sure there is a reason but one eludes me now lol

Out of interest are you just exploring C# or writing a plugin? Im begining to learn C# through writing plugins. It's good fun Smile

This is what I'm working on http://gbpvr.com/pmwiki/pmwiki.php/Plugi...maListings
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,599
Threads: 388
Joined: Dec 2004
#5
2005-12-04, 05:32 PM
McBainUK Wrote:sure there is a reason but one eludes me now lol
Big Grin

Quote:Out of interest are you just exploring C# or writing a plugin? Im begining to learn C# through writing plugins. It's good fun Smile
A bit of both - I'm a net sysadmin at the moment but used to do a lot of coding (mostly C with a bit of C++) - I'd like to get back to doing development work so thought I'd take a look at .NET and C#. Playing with plugins is a fun way of learning it.

I did a very basic Sudoku plugin which I posted in Community Announcements for people to try. I've got a more advanced version but it keeps crashing my MVP so I'm not going to release that until I fix the problem.

I saw your Cinema Listings plugin - I may download for the wife - she and her friends are occasional cinema-goers.

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode