Description
<p>Trying to add a public method that plugin dev can use to loadskin in main thread.</p>
<p>public static readonly SynchronizationContext _mainThreadContext = SynchronizationContext.Current;</p>
<p>_mainThreadContext will be init on MP main thread, like this plugin can use it to be in sync for ex :</p>
<p>if (!_playbackStopped)<br />
{<br />
_mainThreadContext.Send(delegate<br />
{<br />
g_Player.ShowFullScreenWindow();<br />
}, null);<br />
}</p>
<p>Like this g_Player.ShowFullScreenWindow(); will be executed in sync with MP main thread.</p>
<p>Plugin dev need to ref to core.dll and in plugin when thing need to be sync with MP main thread, it should use like this : </p>
<pre class="brush: csharp;" name="code" style="background-color:#f7f7f7;border:1px solid #d7d7d7;padding:.5em 1em .5em 1em;">
GUIWindow._mainThreadContext.Send(delegate {
// code
// code
// etc;
}, null);</pre>
<p> </p>
<p> </p>
<p> </p>
<p>public static readonly SynchronizationContext _mainThreadContext = SynchronizationContext.Current;</p>
<p>_mainThreadContext will be init on MP main thread, like this plugin can use it to be in sync for ex :</p>
<p>if (!_playbackStopped)<br />
{<br />
_mainThreadContext.Send(delegate<br />
{<br />
g_Player.ShowFullScreenWindow();<br />
}, null);<br />
}</p>
<p>Like this g_Player.ShowFullScreenWindow(); will be executed in sync with MP main thread.</p>
<p>Plugin dev need to ref to core.dll and in plugin when thing need to be sync with MP main thread, it should use like this : </p>
<pre class="brush: csharp;" name="code" style="background-color:#f7f7f7;border:1px solid #d7d7d7;padding:.5em 1em .5em 1em;">
GUIWindow._mainThreadContext.Send(delegate {
// code
// code
// etc;
}, null);</pre>
<p> </p>
<p> </p>
<p> </p>