MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal TV-Server » Help on Development » Development


Development You want to code something for the TV-Server? Share it in here!

Reply
 
Thread Tools Display Modes
Old 2008-03-17, 10:34   #1 (permalink)
MP Donator
 
MoPhat's Avatar
 
Join Date: Jun 2007
Location: Berg
Age: 35
Posts: 722
Thanks: 7
Thanked 60 Times in 13 Posts

Country:

My System

Default Using Gentle.Config (DefaultConnectionString) and how to save and load settings?

Hi iam developing a new Plugin for he TV Server witch checks the next upcomings shedules and if the start time in the EPG has changed will change the schedule time too

Here in switzerland/germany channels is normal that the show is not coming on the same time everyday , in this case the recording lands in the manuall folder

So the plugin works well in a testform, i'm now on the final steps.

But:

- How to i'am using the Gentle.Config to receive the SQL Connection String?
- How do i'am load/save settings from the plugin?
Code:
is this correct so?

   public void SettingsLoad()
        {
            TvBusinessLayer layer = new TvBusinessLayer();
            txtPreTime.Text = layer.GetSetting("Schedules_Corrector_PreTime", "-20").Value;
            txtAfterTime.Text = layer.GetSetting("Schedules_Corrector_AfterTime", "20").Value;
            txtIntervall.Text = layer.GetSetting("Schedules_Corrector_Intervall", "60").Value;
        }

        public void SettingsSave()
        {
            TvBusinessLayer layer = new TvBusinessLayer();
            Setting setting = layer.GetSetting("Schedules_Corrector_PreTime", "-20");
            setting.Value = txtPreTime.Text;
            setting.Persist();

            setting = layer.GetSetting("Schedules_Corrector_AfterTime", "20");
            setting.Value = txtAfterTime.Text;
            setting.Persist();

            setting = layer.GetSetting("Schedules_Corrector_Intervall", "60");
            setting.Value = txtIntervall.Text;
            setting.Persist();
        }
- how do i'am commit a schedule change to the TVServer?

thank you for the help, for me (my wife) is this plugin essantially... maybe for you too?



MoPhat
MoPhat is offline   Reply With Quote
Old 2008-03-17, 11:38   #2 (permalink)
rtv
Portal Developer
 
rtv's Avatar
 
Join Date: Apr 2005
Location: Osnabruck
Posts: 2,766
Thanks: 130
Thanked 133 Times in 93 Posts

Country:

My System

Default

Quote:
Originally Posted by MoPhat View Post
- How to i'am using the Gentle.Config to receive the SQL Connection String?
Please try not to handle SQL connections in your plugin. You'd have to reference all gentle libs as well as the database providers, etc. In addition there are ongoing changes like relocating the gentle.config, etc. Your plugin would have to be maintained with all these changes as well then. Try to use the businesslayer for everything you need.

Quote:
Originally Posted by MoPhat View Post
- How do i'am load/save settings from the plugin?
is this correct so?
...
public void SettingsLoad()
...
Yep. This should work okay.

Quote:
Originally Posted by MoPhat View Post
- how do i'am commit a schedule change to the TVServer?
Broce and Bavarian will be the people who know best. Technically it's the same as above. Simply persist your changed Schedule object.
__________________
rtv is online now   Reply With Quote
Old 2008-03-17, 12:08   #3 (permalink)
MP Donator
 
MoPhat's Avatar
 
Join Date: Jun 2007
Location: Berg
Age: 35
Posts: 722
Thanks: 7
Thanked 60 Times in 13 Posts

Country:

My System

Default

thank you rtv how do im use the businesslayer to get the connection string, is there a connection class?


MoPhat
MoPhat is offline   Reply With Quote
Reply

Bookmarks

Tags
defaultconnectionstring, gentleconfig, save, settings

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gentle.config file not found BobbyG Get Support 1 2008-03-02 14:42
TVService keeps overwriting database connection string in gentle.config peely Get Support 1 2007-11-26 14:09
Unable to create/modify gentle.config phunqe Get Support 5 2007-11-03 18:43
Failing to read/write gentle.config after tve3 reinstall Maschine pre 1.0 RC1 1 2007-10-28 14:33
Same problems with save config in 0.1.0.4 fredflintstone General Development (no feature request here!) 1 2005-01-08 12:07


All times are GMT +1. The time now is 10:44.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden