当前位置: 首页>>代码示例>>C#>>正文


C# PluginRuntime.GetPluginType方法代码示例

本文整理汇总了C#中MediaPortal.Common.PluginManager.PluginRuntime.GetPluginType方法的典型用法代码示例。如果您正苦于以下问题:C# PluginRuntime.GetPluginType方法的具体用法?C# PluginRuntime.GetPluginType怎么用?C# PluginRuntime.GetPluginType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaPortal.Common.PluginManager.PluginRuntime的用法示例。


在下文中一共展示了PluginRuntime.GetPluginType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildItem

 public object BuildItem(PluginItemMetadata itemData, PluginRuntime plugin)
 {
   BuilderHelper.CheckParameter("ClassName", itemData);
   BuilderHelper.CheckParameter("ProviderName", itemData);
   BuilderHelper.CheckParameter("Priority", itemData);
   return new ThumbnailProviderRegistration(plugin.GetPluginType(itemData.Attributes["ClassName"]), itemData.Id, itemData.Attributes["ProviderName"], itemData.Attributes["Priority"]);
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:7,代码来源:ThumbnailProviderBuilder.cs

示例2: BuildItem

 public object BuildItem(PluginItemMetadata itemData, PluginRuntime plugin)
 {
   BuilderHelper.CheckParameter("ClassName", itemData);
   BuilderHelper.CheckParameter("Caption", itemData);
   BuilderHelper.CheckParameter("Sort", itemData);
   return new MediaItemActionExtension(plugin.GetPluginType(itemData.Attributes["ClassName"]), itemData.Attributes["Caption"], itemData.Attributes["Sort"], itemData.Id);
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:7,代码来源:MediaItemActionBuilder.cs

示例3: BuildItem

 public object BuildItem(PluginItemMetadata itemData, PluginRuntime plugin)
 {
   BuilderHelper.CheckParameter("ClassName", itemData);
   return new FanartImageSourceProviderRegistration(plugin.GetPluginType(itemData.Attributes["ClassName"]), itemData.Id);
 }
开发者ID:aspik,项目名称:MediaPortal-2,代码行数:5,代码来源:FanartImageSourceProviderBuilder.cs

示例4: ParseAdditionalTypes

 protected static IDictionary<string, Type> ParseAdditionalTypes(string additionalTypesList, PluginRuntime plugin)
 {
   IDictionary<string, Type> result = new Dictionary<string, Type>();
   if (additionalTypesList == null)
     return result;
   string[] entries = additionalTypesList.Replace(" ", string.Empty).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
   foreach (string entry in entries)
   {
     int index = entry.IndexOf('=');
     if (index == -1)
       throw new ArgumentException("AdditionTypes must contain entries in the form 'entry=typename'");
     else
     {
       string typeName = entry.Substring(index + 1, entry.Length - index - 1).Trim();
       Type type = plugin.GetPluginType(typeName);
       result.Add(entry.Substring(0, index).Trim(), type);
     }
   }
   return result;
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:20,代码来源:ConfigBuilder.cs

示例5: BuildItem

 public object BuildItem(PluginItemMetadata itemData, PluginRuntime plugin)
 {
   BuilderHelper.CheckParameter("ServiceClassName", itemData);
   string serviceClassName = itemData.Attributes["ServiceClassName"];
   object serviceInstance = plugin.InstantiatePluginObject(serviceClassName);
   if (serviceInstance == null)
   {
     ServiceRegistration.Get<ILogger>().Warn("ServiceBuilder: Could not instantiate service class '{0}' in plugin '{1}' (id: '{2}')",
         serviceClassName, itemData.PluginRuntime.Metadata.Name, itemData.PluginRuntime.Metadata.PluginId);
     return null;
   }
   string registrationClassAssembly;
   if (!itemData.Attributes.TryGetValue("RegistrationClassAssembly", out registrationClassAssembly))
     registrationClassAssembly = null;
   string registrationClassName;
   if (!itemData.Attributes.TryGetValue("RegistrationClassName", out registrationClassName))
     registrationClassName = null;
   Type registrationType;
   if (string.IsNullOrEmpty(registrationClassName))
     registrationType = serviceInstance.GetType();
   else
     registrationType = string.IsNullOrEmpty(registrationClassAssembly) ? plugin.GetPluginType(registrationClassName) :
         Type.GetType(registrationClassName + ", " + registrationClassAssembly);
   if (registrationType == null)
   {
     ServiceRegistration.Get<ILogger>().Warn("ServiceBuilder: Could not instantiate service registration type '{0}' (Assembly: '{1}') in plugin '{2}' (id: '{3}')",
         registrationClassName, registrationClassAssembly, itemData.PluginRuntime.Metadata.Name, itemData.PluginRuntime.Metadata.PluginId);
     return null;
   }
   return new ServiceItem(registrationType, serviceInstance);
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:31,代码来源:ServiceBuilder.cs

示例6: BuildItem

 public object BuildItem(PluginItemMetadata itemData, PluginRuntime plugin)
 {
   BuilderHelper.CheckParameter("ClassName", itemData);
   BuilderHelper.CheckParameter("MimeType", itemData);
   return new VideoPlayerMimeTypeMapping(plugin.GetPluginType(itemData.Attributes["ClassName"]), itemData.Attributes["MimeType"]);
 }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:6,代码来源:VideoPlayerBuilder.cs


注:本文中的MediaPortal.Common.PluginManager.PluginRuntime.GetPluginType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。