NextPVR Forums
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 13 14 15 16 17 … 93 Next »
Data binding

 
  • 0 Vote(s) - 0 Average
Data binding
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#1
2011-07-19, 07:30 PM
I'm reluctant to post a more general cry for C# help, rather than something NPVR specific, but does anyone have any simple examples of using data binding to reduce the amount of code required when buildings forms (for the Settings dialog)?

The stuff I've done so far has always been (old skool java style):
Code:
class MySettings
{
  static string someTextValue= <read from xml file>
}

And then the form is built with:
Code:
SomeTextBox.Text = MySettings.someTextValue;
And when it's time to save everything:
Code:
MySettings.someTextValue= SomeTextBox.Text;

Data binding sounds like it might be a simpler way to do this? But I'm not sure if it can work without complex datagrid this or bindingsource that, rather than my micky mouse collection of statically declared variables (that makes it easy to get at them elsewhere in the actual plugin).

Iain
psycik
Offline

Posting Freak

Posts: 5,206
Threads: 422
Joined: Sep 2005
#2
2011-07-19, 10:01 PM
What about using a propertygrid ( to get really simple about it) with one class that contains all your settings items?

Basically then it's propertyGrid.selectedObject (selectedItem?) = settingsObject.

All your gui work is handled in there,

Then serialise, write your object to xml (either the config.xml - does that still happen?) or your own XML file.

You can then play with the settings object to add propertygrid helpers - file browsers, enums, etc.

The property grid helpers you could add for other users to use as a defined class.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#3
2011-07-20, 08:57 AM
psycik Wrote:What about using a propertygrid ( to get really simple about it) with one class that contains all your settings items?

It's an idea, and would probably make things a little easier for me, but it looks like it wouldn't really make for the nicest user-experience unfortunately.

Iain
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  How to extract M3U8 and get matching XMLTV guide data from NPVR almightyj 0 2,129 2018-10-23, 07:24 AM
Last Post: almightyj
  Getting more than 24 hours of Guide Data scJohn 4 2,903 2018-05-16, 04:20 AM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,277 2014-11-14, 02:05 AM
Last Post: Benoire
  Merge xmltv data with xslt Graham 4 2,747 2014-01-02, 12:45 PM
Last Post: Graham
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 4,547 2013-03-24, 08:03 PM
Last Post: imilne
  Get NextPVR data directory from outside a plugin McBainUK 3 1,598 2012-02-11, 05:42 PM
Last Post: mvallevand
  Extracting data from XML files ACTCMS 4 1,708 2012-01-24, 12:16 AM
Last Post: sub
  C# code to get data directory? McBainUK 2 2,321 2011-09-19, 07:57 PM
Last Post: McBainUK
  XMLTV data mvallevand 6 1,862 2011-04-16, 03:08 AM
Last Post: sub
  Another meta data question zehd 8 2,452 2009-03-28, 05:30 AM
Last Post: JavaWiz

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

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

Linear Mode
Threaded Mode