日期:2014-05-17  浏览次数:21384 次

找到 SilverLight 在 HTML 页面与服务器端对应的 XAP 文件,如何查看源代码以及如何用C#实现相同方法?
Hi,

请问找到 SilverLight 在 HTML 页面与服务器端对应的 XAP 文件,如何可以查看 player.Content.Switcher.loadSomething(nId); 这一个调用方法的内部代码? 用 C#.Net.DLL 的源代码查看器吗?

另外, 我想用 Visual Studio 2012 写一个 C# 的 Windows Form 的应用程序,来模拟下面 HTML 的 SilverLight 的 控件,以及在 C# 中执行一下 player.Content.Switcher.loadSomething(nId) , 请问应该如何做??

以下为 HTML 页面的 SilverLight 的代码编写:


<form id="form1" runat="server">
  <div id="silverlightControlHost">
    <object id="playerUI" data="data:application/x-silverlight-2,"
      type="application/x-silverlight-2" width="100%" height="100%" >
      <param name="source" value="/_sl/Example.PlayerTest.xap"/>
      <param name="onError" value="onSilverlightError" />
      <param name="background" value="white" />
      <param name="minRuntimeVersion" value="3.0.40624.0" />
      <param name="autoUpgrade" value="true" />
      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
        <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
      </a>
    </object>
  </div>
</form>

var sPlayerID = "playerUI";

function slLoadSomething(nId) {
    var player = document.getElementById(sPlayerID);
    if (player != null) {
        if (typeof nCallId != 'undefined') {
            player.Content.Switcher.loadSomething(nId);
        }
    }
}


以下为 /_sl/Example.PlayerTest.xap 用 RAR 解压后发现的文件描述:


<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="Test.PlayerTestSite" EntryPointType="Test.PlayerTestSite.App" RuntimeVersion="4.0.50826.0">
  <Deployment.Parts>
    <AssemblyPart x:Name="Test.PlayerTestSite" Source="Test.PlayerTestSite.dll" />
    <AssemblyPart x:Name="Test.ChannelTrackUI" Source="Test.ChannelTrackUI.dll" />
    <AssemblyPart x:Name="Test.CoreUI" Source="Test.CoreUI.dll" />
    <AssemblyPart x:Name="Test.PlayerController" Source="Test.PlayerController.dll" />
    <AssemblyPart x:Name="Test.PlayerUI" Source="Test.PlayerUI.dll" />
    <AssemblyPart x:Name="Test.RemarkViewUI" Source="Test.RemarkViewUI.dll" />
    <AssemblyPart x:Name="Test.SilverlightTrace" Source="Test.SilverlightTrace.dll