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
Plugin: Shutdown Manager (or call it whatever you want ;) ) - A blog to develop a MP2 plugin
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="chefkoch" data-source="post: 942563" data-attributes="member: 10438"><p>Now that we defined the DialogStates <em><strong><span style="font-size: 11px"><span style="font-family: 'courier new'"><span style="color: #dd1144"><span style="color: #ff00ff">dialogShutdown</span></span></span></span></strong></em> and <em><strong><span style="font-size: 11px"><span style="font-family: 'courier new'"><span style="color: #dd1144"><span style="color: #ff00ff">dialogShutdownTimer</span></span></span></span></strong></em> the appropriate files in ShutdownManager/Skin/default/screens needs to be added.</p><p> </p><p>The first dialog model is created as <a href="https://github.com/MediaPortal/MediaPortal-2/blob/b4e97164a9426ff67ed8e898eab153f92f82478d/MediaPortal/Incubator/ShutdownManager/Models/ShutdownDialogModel.cs" target="_blank">ShutdownManager/Models/ShutdownDialogModel.cs</a>. For testing purposes the executed shutdown action is only written to log files instead of i.e. shutting down the PC for real.</p><p></p><p> </p><p>Almost every public method of each available model in MP2 can be referenced and executed as a command by almost every screen. In <a href="https://github.com/MediaPortal/MediaPortal-2/blob/b4e97164a9426ff67ed8e898eab153f92f82478d/MediaPortal/Incubator/ShutdownManager/Skin/default/screens/dialogShutdown.xaml" target="_blank">ShutdownManager/Skin/default/screens/dialogShutdown.xaml</a> only the <span style="color: #ff9900"><span style="font-size: 11px"><em><strong>ShutdownDialogModel </strong></em></span></span> is referenced through it's Id</p><p></p><p>The model can be referenced inside this screen file now by the <span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008080">Key </span></span></span>"<span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #ffcc00">Model</span></span></span>". So a <span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #008080">Key</span></span></span> is kind of a placeholder.</p><p> </p><p>The dialog is inherited from <span style="color: #dd1144">screens\master_dialog_bare.xaml</span> through:</p><p></p><p> </p><p>Additional to Close button which is already available because of <span style="color: #dd1144">master_dialog_bare.xaml</span>, each shutdown action is added as a button to the dialog. For grouping a <span style="color: #000080"><span style="font-size: 12px"><span style="font-family: 'Consolas'">StackPanel</span></span></span>is used. The datacontext for the StackPanel is set to <span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #ffcc00">Model </span></span></span>which is <strong><em><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="color: #0000ff">25F16911-ED0D-4439-9858-5E69C970C037</span></span></span></em></strong> in the end.</p><p> </p><p></p><p> </p><p>[ATTACH=full]116714[/ATTACH]</p><p> </p><p>Clicking on these buttons writes the action to the log:</p><p>[ATTACH]116715[/ATTACH]</p></blockquote><p></p>
[QUOTE="chefkoch, post: 942563, member: 10438"] Now that we defined the DialogStates [I][B][SIZE=11px][FONT=courier new][COLOR=#dd1144][COLOR=#ff00ff]dialogShutdown[/COLOR][/COLOR][/FONT][/SIZE][/B][/I] and [I][B][SIZE=11px][FONT=courier new][COLOR=#dd1144][COLOR=#ff00ff]dialogShutdownTimer[/COLOR][/COLOR][/FONT][/SIZE][/B][/I] the appropriate files in ShutdownManager/Skin/default/screens needs to be added. The first dialog model is created as [URL='https://github.com/MediaPortal/MediaPortal-2/blob/b4e97164a9426ff67ed8e898eab153f92f82478d/MediaPortal/Incubator/ShutdownManager/Models/ShutdownDialogModel.cs']ShutdownManager/Models/ShutdownDialogModel.cs[/URL]. For testing purposes the executed shutdown action is only written to log files instead of i.e. shutting down the PC for real. Almost every public method of each available model in MP2 can be referenced and executed as a command by almost every screen. In [URL='https://github.com/MediaPortal/MediaPortal-2/blob/b4e97164a9426ff67ed8e898eab153f92f82478d/MediaPortal/Incubator/ShutdownManager/Skin/default/screens/dialogShutdown.xaml']ShutdownManager/Skin/default/screens/dialogShutdown.xaml[/URL] only the [COLOR=#ff9900][SIZE=11px][I][B]ShutdownDialogModel [/B][/I][/SIZE][/COLOR] is referenced through it's Id The model can be referenced inside this screen file now by the [SIZE=12px][FONT=Consolas][COLOR=#008080]Key [/COLOR][/FONT][/SIZE]"[SIZE=12px][FONT=Consolas][COLOR=#ffcc00]Model[/COLOR][/FONT][/SIZE]". So a [SIZE=12px][FONT=Consolas][COLOR=#008080]Key[/COLOR][/FONT][/SIZE] is kind of a placeholder. The dialog is inherited from [COLOR=#dd1144]screens\master_dialog_bare.xaml[/COLOR] through: Additional to Close button which is already available because of [COLOR=#dd1144]master_dialog_bare.xaml[/COLOR], each shutdown action is added as a button to the dialog. For grouping a [COLOR=#000080][SIZE=12px][FONT=Consolas]StackPanel[/FONT][/SIZE][/COLOR]is used. The datacontext for the StackPanel is set to [SIZE=12px][FONT=Consolas][COLOR=#ffcc00]Model [/COLOR][/FONT][/SIZE]which is [B][I][SIZE=12px][FONT=Consolas][COLOR=#0000ff]25F16911-ED0D-4439-9858-5E69C970C037[/COLOR][/FONT][/SIZE][/I][/B] in the end. [ATTACH=full]116714[/ATTACH] Clicking on these buttons writes the action to the log: [ATTACH]116715[/ATTACH] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Plugin: Shutdown Manager (or call it whatever you want ;) ) - A blog to develop a MP2 plugin
Contact us
RSS
Top
Bottom