當前位置: 首頁>>代碼示例>>C#>>正文


C# Dv.CallContext類代碼示例

本文整理匯總了C#中UPnP.Infrastructure.Dv.CallContext的典型用法代碼示例。如果您正苦於以下問題:C# CallContext類的具體用法?C# CallContext怎麽用?C# CallContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CallContext類屬於UPnP.Infrastructure.Dv命名空間,在下文中一共展示了CallContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnLoad

 private UPnPError OnLoad(DvAction action, IList<object> inParams, out IList<object> outParams, CallContext context)
 {
   string settingsTypeName = (string) inParams[0];
   object result = Load(settingsTypeName);
   string serialized = SettingsSerializer.Serialize(result);
   outParams = new List<object> { serialized };
   return null;
 }
開發者ID:jgauffin,項目名稱:MediaPortal-2,代碼行數:8,代碼來源:ServerSettingsImpl.cs

示例2: OnSave

 private UPnPError OnSave(DvAction action, IList<object> inParams, out IList<object> outParams, CallContext context)
 {
   string settingsTypeName = (string) inParams[0];
   string settings = (string) inParams[1];
   Save(settingsTypeName, settings);
   outParams = new List<object> { };
   return null;
 }
開發者ID:jgauffin,項目名稱:MediaPortal-2,代碼行數:8,代碼來源:ServerSettingsImpl.cs

示例3: OnGetFanArt

    private UPnPError OnGetFanArt(DvAction action, IList<object> inParams, out IList<object> outParams, CallContext context)
    {
      outParams = new List<object>();
      IFanArtService fanArtService = ServiceRegistration.Get<IFanArtService>();
      if (fanArtService == null)
        return new UPnPError(500, "FanArt service not available");

      FanArtConstants.FanArtMediaType fanArtMediaType = (FanArtConstants.FanArtMediaType) Enum.Parse(typeof(FanArtConstants.FanArtMediaType), inParams[0].ToString());
      FanArtConstants.FanArtType fanArtType = (FanArtConstants.FanArtType) Enum.Parse(typeof(FanArtConstants.FanArtType), inParams[1].ToString());
      string name = inParams[2].ToString();
      int maxWidth = (int) inParams[3];
      int maxHeight = (int) inParams[4];
      bool singleRandom = (bool) inParams[5];

      IList<FanArtImage> fanArtImages = fanArtService.GetFanArt(fanArtMediaType, fanArtType, name, maxWidth, maxHeight, singleRandom) ?? new List<FanArtImage>();
      outParams = new List<object> { fanArtImages };
      return null;
    }
開發者ID:joconno4,項目名稱:MediaPortal-2,代碼行數:18,代碼來源:FanArtServiceImpl.cs

示例4: OnClearAllUserData

    // Cleanup user data

    static UPnPError OnClearAllUserData(DvAction action, IList<object> inParams, out IList<object> outParams,
        CallContext context)
    {
      Guid profileId = MarshallingHelper.DeserializeGuid((string) inParams[0]);
      bool success = ServiceRegistration.Get<IUserProfileDataManagement>().ClearAllUserData(profileId);
      outParams = new List<object> {success};
      return null;
    }
開發者ID:davinx,項目名稱:MediaPortal-2,代碼行數:10,代碼來源:UPnPUserProfileDataManagementServiceImpl.cs

示例5: OnGetUserMediaItemData

    // User media item data

    static UPnPError OnGetUserMediaItemData(DvAction action, IList<object> inParams, out IList<object> outParams,
        CallContext context)
    {
      Guid profileId = MarshallingHelper.DeserializeGuid((string) inParams[0]);
      Guid mediaItemId = MarshallingHelper.DeserializeGuid((string) inParams[1]);
      string key = (string) inParams[2];
      string data;
      bool success;
      if (!(success = ServiceRegistration.Get<IUserProfileDataManagement>().GetUserMediaItemData(profileId, mediaItemId, key, out data)))
        data = null;
      outParams = new List<object> {data, success};
      return null;
    }
開發者ID:davinx,項目名稱:MediaPortal-2,代碼行數:15,代碼來源:UPnPUserProfileDataManagementServiceImpl.cs

示例6: OnGetProfileByName

 static UPnPError OnGetProfileByName(DvAction action, IList<object> inParams, out IList<object> outParams,
     CallContext context)
 {
   string profileName = (string) inParams[0];
   UserProfile profile;
   if (!ServiceRegistration.Get<IUserProfileDataManagement>().GetProfileByName(profileName, out profile))
     profile = null;
   outParams = new List<object> {profile};
   return null;
 }
開發者ID:davinx,項目名稱:MediaPortal-2,代碼行數:10,代碼來源:UPnPUserProfileDataManagementServiceImpl.cs

示例7: OnGetProfiles

    // User profiles management

    static UPnPError OnGetProfiles(DvAction action, IList<object> inParams, out IList<object> outParams,
        CallContext context)
    {
      ICollection<UserProfile> profiles = ServiceRegistration.Get<IUserProfileDataManagement>().GetProfiles();
      outParams = new List<object> {profiles};
      return null;
    }
開發者ID:davinx,項目名稱:MediaPortal-2,代碼行數:9,代碼來源:UPnPUserProfileDataManagementServiceImpl.cs

示例8: OnGetHomeServerSystemId

 static UPnPError OnGetHomeServerSystemId(DvAction action, IList<object> inParams, out IList<object> outParams,
     CallContext context)
 {
   outParams = new List<object> {ServiceRegistration.Get<IServerConnectionManager>().HomeServerSystemId};
   return null;
 }
開發者ID:joconno4,項目名稱:MediaPortal-2,代碼行數:6,代碼來源:UPnPClientControllerServiceImpl.cs

示例9: OnTextSearch

 static UPnPError OnTextSearch(DvAction action, IList<object> inParams, out IList<object> outParams,
     CallContext context)
 {
   string searchText = (string) inParams[0];
   IEnumerable<Guid> necessaryMIATypes = MarshallingHelper.ParseCsvGuidCollection((string) inParams[1]);
   IEnumerable<Guid> optionalMIATypes = MarshallingHelper.ParseCsvGuidCollection((string) inParams[2]);
   IFilter filter = (IFilter) inParams[3];
   string searchModeStr = (string) inParams[4];
   string onlineStateStr = (string) inParams[5];
   string capitalizationMode = (string) inParams[6];
   bool excludeCLOBs;
   bool all = false;
   bool caseSensitive = true;
   UPnPError error = ParseSearchMode("SearchMode", searchModeStr, out excludeCLOBs) ?? 
     ParseOnlineState("OnlineState", onlineStateStr, out all) ??
     ParseCapitalizationMode("CapitalizationMode", capitalizationMode, out caseSensitive);
   if (error != null)
   {
     outParams = null;
     return error;
   }
   IMediaLibrary mediaLibrary = ServiceRegistration.Get<IMediaLibrary>();
   MediaItemQuery query = mediaLibrary.BuildSimpleTextSearchQuery(searchText, necessaryMIATypes, optionalMIATypes,
       filter, !excludeCLOBs, caseSensitive);
   IList<MediaItem> mediaItems = mediaLibrary.Search(query, !all);
   outParams = new List<object> {mediaItems};
   return null;
 }
開發者ID:chekiI,項目名稱:MediaPortal-2,代碼行數:28,代碼來源:UPnPContentDirectoryServiceImpl.cs

示例10: OnReImportShare

 static UPnPError OnReImportShare(DvAction action, IList<object> inParams, out IList<object> outParams,
     CallContext context)
 {
   Guid shareId = MarshallingHelper.DeserializeGuid((string) inParams[0]);
   Share share = ServiceRegistration.Get<IMediaLibrary>().GetShare(shareId);
   ServiceRegistration.Get<IImporterWorker>().ScheduleRefresh(share.BaseResourcePath, share.MediaCategories, true);
   outParams = null;
   return null;
 }
開發者ID:chekiI,項目名稱:MediaPortal-2,代碼行數:9,代碼來源:UPnPContentDirectoryServiceImpl.cs

示例11: OnGetShare

 static UPnPError OnGetShare(DvAction action, IList<object> inParams, out IList<object> outParams,
     CallContext context)
 {
   Guid shareId = MarshallingHelper.DeserializeGuid((string) inParams[0]);
   Share result = ServiceRegistration.Get<IMediaLibrary>().GetShare(shareId);
   outParams = new List<object> {result};
   return null;
 }
開發者ID:chekiI,項目名稱:MediaPortal-2,代碼行數:8,代碼來源:UPnPContentDirectoryServiceImpl.cs

示例12: OnGetShares

 static UPnPError OnGetShares(DvAction action, IList<object> inParams, out IList<object> outParams,
     CallContext context)
 {
   string systemId = (string) inParams[0];
   string sharesFilterStr = (string) inParams[1];
   bool all;
   UPnPError error = ParseOnlineState("SharesFilter", sharesFilterStr, out all);
   if (error != null)
   {
     outParams = null;
     return error;
   }
   IDictionary<Guid, Share> shares = ServiceRegistration.Get<IMediaLibrary>().GetShares(systemId);
   ICollection<Share> result;
   if (all)
     result = shares.Values;
   else
   {
     ICollection<string> connectedClientsIds = ServiceRegistration.Get<IClientManager>().ConnectedClients.Select(
         connection => connection.Descriptor.MPFrontendServerUUID).ToList();
     result = new List<Share>();
     foreach (Share share in shares.Values)
       if (connectedClientsIds.Contains(share.SystemId))
         result.Add(share);
   }
   outParams = new List<object> {result};
   return null;
 }
開發者ID:chekiI,項目名稱:MediaPortal-2,代碼行數:28,代碼來源:UPnPContentDirectoryServiceImpl.cs

示例13: OnUpdateShare

 static UPnPError OnUpdateShare(DvAction action, IList<object> inParams, out IList<object> outParams,
     CallContext context)
 {
   Guid shareId = MarshallingHelper.DeserializeGuid((string) inParams[0]);
   ResourcePath baseResourcePath = ResourcePath.Deserialize((string) inParams[1]);
   string shareName = (string) inParams[2];
   string[] mediaCategories = ((string) inParams[3]).Split(',');
   string relocateMediaItemsStr = (string) inParams[4];
   RelocationMode relocationMode;
   UPnPError error = ParseRelocationMode("RelocateMediaItems", relocateMediaItemsStr, out relocationMode);
   if (error != null)
   {
     outParams = null;
     return error;
   }
   IMediaLibrary mediaLibrary = ServiceRegistration.Get<IMediaLibrary>();
   int numAffected = mediaLibrary.UpdateShare(shareId, baseResourcePath, shareName, mediaCategories, relocationMode);
   outParams = new List<object> {numAffected};
   return null;
 }
開發者ID:chekiI,項目名稱:MediaPortal-2,代碼行數:20,代碼來源:UPnPContentDirectoryServiceImpl.cs

示例14: OnRegisterShare

 static UPnPError OnRegisterShare(DvAction action, IList<object> inParams, out IList<object> outParams,
     CallContext context)
 {
   Share share = (Share) inParams[0];
   ServiceRegistration.Get<IMediaLibrary>().RegisterShare(share);
   outParams = null;
   return null;
 }
開發者ID:chekiI,項目名稱:MediaPortal-2,代碼行數:8,代碼來源:UPnPContentDirectoryServiceImpl.cs

示例15: OnNotifyPlayback

 static UPnPError OnNotifyPlayback(DvAction action, IList<object> inParams, out IList<object> outParams,
     CallContext context)
 {
   IMediaLibrary mediaLibrary = ServiceRegistration.Get<IMediaLibrary>();
   Guid mediaItemId = MarshallingHelper.DeserializeGuid((string) inParams[0]);
   mediaLibrary.NotifyPlayback(mediaItemId);
   outParams = null;
   return null;
 }
開發者ID:chekiI,項目名稱:MediaPortal-2,代碼行數:9,代碼來源:UPnPContentDirectoryServiceImpl.cs


注:本文中的UPnP.Infrastructure.Dv.CallContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。