home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
Featured Plugins
MP2Extended
Plugin: MP2Extended
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="FreakyJ" data-source="post: 1156944" data-attributes="member: 106003"><p>Thank you for jumping in <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p>In fact I know that, but I the Dictionary is created by our HTTPServer, so for your suggestion I would need to modify the HTTPServer.</p><p></p><p>With Hack is was talking about these two methods:</p><p>1) using LINQ</p><p>[code]var item = MyDictionary.Where(x => x.Key.ToLower() == MyIndex.ToLower()).FirstOrDefault();</p><p> if (item != null)</p><p> {</p><p> TheValue = item.Value;</p><p> }[/code]</p><p>2) Copy the case sensitive dictionary to a new case insenitive dictionary</p><p>[code]MyDictionary = new Dictionary<string, int>(</p><p> MyDictionary, StringComparer.OrdinalIgnoreCase);[/code]</p><p></p><p>Don't know what is better... Probably 1) implemented as a helper function?</p><p></p><p>current code looks like this:</p><p>[code]</p><p>public dynamic Process(IHttpRequest request)</p><p> {</p><p> HttpParam httpParam = request.Param;</p><p> string channelId = httpParam["channelId"].Value;</p><p>[/code]</p></blockquote><p></p>
[QUOTE="FreakyJ, post: 1156944, member: 106003"] Thank you for jumping in :) In fact I know that, but I the Dictionary is created by our HTTPServer, so for your suggestion I would need to modify the HTTPServer. With Hack is was talking about these two methods: 1) using LINQ [code]var item = MyDictionary.Where(x => x.Key.ToLower() == MyIndex.ToLower()).FirstOrDefault(); if (item != null) { TheValue = item.Value; }[/code] 2) Copy the case sensitive dictionary to a new case insenitive dictionary [code]MyDictionary = new Dictionary<string, int>( MyDictionary, StringComparer.OrdinalIgnoreCase);[/code] Don't know what is better... Probably 1) implemented as a helper function? current code looks like this: [code] public dynamic Process(IHttpRequest request) { HttpParam httpParam = request.Param; string channelId = httpParam["channelId"].Value; [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Featured Plugins
MP2Extended
Plugin: MP2Extended
Contact us
RSS
Top
Bottom