本文整理汇总了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"]);
}
示例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);
}
示例3: BuildItem
public object BuildItem(PluginItemMetadata itemData, PluginRuntime plugin)
{
BuilderHelper.CheckParameter("ClassName", itemData);
return new FanartImageSourceProviderRegistration(plugin.GetPluginType(itemData.Attributes["ClassName"]), itemData.Id);
}
示例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;
}
示例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);
}
示例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"]);
}