• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PluginManager.PluginRuntime类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



PluginRuntime类属于MediaPortal.Common.PluginManager命名空间,在下文中一共展示了PluginRuntime类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Activated

 public void Activated(PluginRuntime pluginRuntime)
 {
   messageQueue = new AsynchronousMessageQueue(this,
     new string[] {SystemMessaging.CHANNEL, PlayerManagerMessaging.CHANNEL});
   messageQueue.MessageReceived += OnMessageReceived;
   messageQueue.Start();
 }
开发者ID:chli,项目名称:AtmoLight,代码行数:7,代码来源:Plugin.cs


示例2: 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


示例3: Activated

        public void Activated(PluginRuntime pluginRuntime)
        {
            if (_isInitialized)
                return;

            _isInitialized = true;


            // All non-default media item aspects must be registered
            var miatr = ServiceRegistration.Get<IMediaItemAspectTypeRegistration>();
            miatr.RegisterLocallyKnownMediaItemAspectType(OnlineVideosAspect.Metadata);

            InitializeOnlineVideoSettings();

            // create a message queue for OnlineVideos to broadcast that the list of site utils was rebuild
            _messageQueue = new AsynchronousMessageQueue(this, new string[] { OnlineVideosMessaging.CHANNEL });
            _messageQueue.Start();

            // load and update sites in a background thread, it takes time and we are on the Main thread delaying MP2 startup
            ServiceRegistration.Get<IThreadPool>().Add(
                InitialSitesUpdateAndLoad,
                "OnlineVideos Initial Sites Load & Update",
                QueuePriority.Low,
                ThreadPriority.BelowNormal,
                AfterInitialLoad);
        }
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:26,代码来源:OnlineVideosPlugin.cs


示例4: Activated

 public void Activated(PluginRuntime pluginRuntime)
 {
   ServiceRegistration.Set<ITvHandler>(new SlimTvHandler());
   
   // Register recording section in MediaLibrary
   RecordingsLibrary.RegisterOnMediaLibrary();
 }
开发者ID:HAF-Blade,项目名称:MediaPortal-2,代码行数:7,代码来源:SlimTvClientPlugin.cs


示例5: 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


示例6: Activated

    public void Activated(PluginRuntime pluginRuntime)
    {
      var meta = pluginRuntime.Metadata;
      Logger.Info(string.Format("{0} v{1} [{2}] by {3}", meta.Name, meta.PluginVersion, meta.Description, meta.Author));

      DvDevice device = ServiceRegistration.Get<IBackendServer>().UPnPBackendServer.FindDevicesByDeviceTypeAndVersion(UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE, UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE_VERSION, true).FirstOrDefault();
      if (device != null)
      {
        var serverSettings = new ServerSettingsImpl();
        Logger.Debug("ServerSettings: Registering ServerSettings service.");
        device.AddService(serverSettings);
        Logger.Debug("ServerSettings: Adding ServerSettings service to MP2 backend root device");

        // List all assemblies
        InitPluginAssemblyList();

        // Set our own resolver to lookup types from any of assemblies from Plugins subfolder.
        SettingsSerializer.CustomAssemblyResolver = PluginsAssemblyResolver;
        // AppDomain.CurrentDomain.AssemblyResolve += PluginsAssemblyResolver;

        Logger.Debug("ServerSettings: Adding Plugins folder to private path");
      }
      else
      {
        Logger.Error("ServerSettings: MP2 backend root device not found!");
      }
    }
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:27,代码来源:ServerSettingsPlugin.cs


示例7: 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


示例8: BuildSection

 protected static ConfigSectionMetadata BuildSection(PluginItemMetadata itemData, PluginRuntime plugin)
 {
   string location = ConfigBaseMetadata.ConcatLocations(itemData.RegistrationLocation, itemData.Id);
   string text = null;
   string iconSmallPath = null;
   string iconLargePath = null;
   foreach (KeyValuePair<string, string> attr in itemData.Attributes)
   {
     switch (attr.Key)
     {
       case "Text":
         text = attr.Value;
         break;
       case "IconSmallPath":
         iconSmallPath = attr.Value;
         break;
       case "IconLargePath":
         iconLargePath = attr.Value;
         break;
       default:
         throw new ArgumentException("'ConfigSection' builder doesn't define an attribute '" + attr.Key + "'");
     }
   }
   if (text == null)
     throw new ArgumentException("'ConfigSection' item needs an attribute 'Text'");
   return new ConfigSectionMetadata(location, text,
                                    plugin.Metadata.GetAbsolutePath(iconSmallPath),
                                    plugin.Metadata.GetAbsolutePath(iconLargePath));
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:29,代码来源:ConfigBuilder.cs


示例9: Activated

 public void Activated(PluginRuntime pluginRuntime)
 {
     EmulatorsCore.Init(new EmulatorsSettings());
     importer = new Importer();
     EmulatorsCore.Database.OnItemDeleting += Database_OnItemDeleting;
     ServiceRegistration.Set<IEmulatorsService>(this);
     ImporterMessaging.SendImporterMessage(ImporterMessaging.MessageType.Init);
 }
开发者ID:ministerkrister,项目名称:Emulators,代码行数:8,代码来源:EmulatorsService.cs


示例10: BuildItem

 public object BuildItem(PluginItemMetadata itemData, PluginRuntime plugin)
 {
   BuilderHelper.CheckParameter("Type", itemData);
   BuilderHelper.CheckParameter("Directory", itemData);
   return new PluginResource(
       (PluginResourceType) Enum.Parse(typeof (PluginResourceType), itemData.Attributes["Type"]),
       plugin.Metadata.GetAbsolutePath(itemData.Attributes["Directory"]));
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:8,代码来源:ResourceBuilder.cs


示例11: Activated

 public void Activated(PluginRuntime pluginRuntime)
 {
   var meta = pluginRuntime.Metadata;
   Logger.Info(string.Format("{0} v{1} [{2}] by {3}", meta.Name, meta.PluginVersion, meta.Description, meta.Author));
   ServiceRegistration.Get<IMessageBroker>().RegisterMessageReceiver(SystemMessaging.CHANNEL, this);
   SubscribeToMessages();
   //Logger.Debug("UPnPRenderPlugin: Adding UPNP device as a root device");
   //ServiceRegistration.Get<IFrontendServer>().UPnPFrontendServer.AddRootDevice(_device);
 }
开发者ID:aspik,项目名称:MediaPortal-2,代码行数:9,代码来源:UPnPRendererPlugin.cs


示例12: Activated

        public void Activated(PluginRuntime pluginRuntime)
        {
            var meta = pluginRuntime.Metadata;
            Logger.Info(string.Format("{0} v{1} [{2}] by {3}", meta.Name, meta.PluginVersion, meta.Description, meta.Author));

            Logger.Debug("MediaServerPlugin: Adding UPNP device as a root device");
            ServiceRegistration.Get<IBackendServer>().UPnPBackendServer.AddRootDevice(_device);
            ServiceRegistration.Get<IResourceServer>().AddHttpModule(new DlnaResourceAccessModule());
        }
开发者ID:FreakyJ,项目名称:MediaServer-fo-MP2,代码行数:9,代码来源:MediaServerPlugin.cs


示例13: RevokeItem

 public void RevokeItem(object item, PluginItemMetadata itemData, PluginRuntime plugin)
 {
   BackgroundType type;
   string typeName = GetBackgroundAndType(itemData.Attributes, out type);
   switch (type)
   {
     case BackgroundType.Manager:
       plugin.RevokePluginObject(typeName);
       break;
   }
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:11,代码来源:BackgroundBuilder.cs


示例14: Activated

    public void Activated(PluginRuntime pluginRuntime)
    {
      var meta = pluginRuntime.Metadata;
      Logger.Info(string.Format("{0} v{1} [{2}] by {3}", meta.Name, meta.PluginVersion, meta.Description, meta.Author));

      IResourceServer server = ServiceRegistration.Get<IResourceServer>();
      if (server != null)
      {
        ServiceRegistration.Set<IFanArtService>(new FanArtService());
        _fanartModule = new FanartAccessModule();
        server.AddHttpModule(_fanartModule);
      }
    }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:13,代码来源:FanArtServicePlugin.cs


示例15: Activated

    public void Activated(PluginRuntime pluginRuntime)
    {
      ISystemResolver systemResolver = ServiceRegistration.Get<ISystemResolver>();
      var appKey = systemResolver.SystemType == SystemType.Server ? KEY_SERVER : KEY_CLIENT;

      // The appkey and shared key can be found in onetrueeror.com
      OneTrue.Configuration.Credentials(appKey.Item1, appKey.Item2);
      OneTrue.Configuration.CatchWinFormsExceptions();
      OneTrue.Configuration.Advanced.UploadReportFailed += OnUploadReportFailed;

      // Exchange the logger by the error reporting wrapper
      var currentLogger = ServiceRegistration.Get<ILogger>();
      var errorLogger = new ErrorLogWrapper(currentLogger);
      ServiceRegistration.Set<ILogger>(errorLogger);
    }
开发者ID:pacificIT,项目名称:MediaPortal-2,代码行数:15,代码来源:ErrorReportingService.cs


示例16: BuildItem

 public object BuildItem(PluginItemMetadata itemData, PluginRuntime plugin)
 {
   BackgroundType type;
   string value = GetBackgroundAndType(itemData.Attributes, out type);
   switch (type)
   {
     case BackgroundType.Static:
       return new StaticBackgroundManager(value);
     case BackgroundType.Manager:
       // The cast is necessary here to ensure the returned instance is an IBackgroundManager
       return (IBackgroundManager) plugin.InstantiatePluginObject(value);
     default:
       throw new NotImplementedException(string.Format(
           "Background builder: Background type '{0}' is not implemented", type));
   }
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:16,代码来源:BackgroundBuilder.cs


示例17: BuildItem

    public object BuildItem(PluginItemMetadata itemData, PluginRuntime plugin)
    {
      BuilderHelper.CheckParameter("ClassName", itemData);
      BuilderHelper.CheckParameter("Filter", itemData);
      // Support for simplified escaping inside XML tag
      string filter = itemData.Attributes["Filter"].Replace("{", "<").Replace("}", ">");
      FilterWrapper wrapper;

      if (_serializer == null)
        _serializer = new XmlSerializer(typeof(FilterWrapper));

      using (var reader = new StringReader(filter))
        wrapper = (FilterWrapper)_serializer.Deserialize(reader);

      return new MediaNavigationFilter(itemData.Attributes["ClassName"], wrapper.Filter);
    }
开发者ID:aspik,项目名称:MediaPortal-2,代码行数:16,代码来源:MediaNavigationFilterBuilder.cs


示例18: Activated

 public void Activated(PluginRuntime pluginRuntime)
 {
   ISystemStateService sss = ServiceRegistration.Get<ISystemStateService>();
   if (sss.CurrentState == SystemState.Running)
   {
     _reloadSkinActions.RegisterKeyActions();
     _loadSkinThemeActions.RegisterKeyActions();
   }
   else
   {
     _messageQueue = new AsynchronousMessageQueue(typeof(ReloadSkinActions), new string[]
       {
           SystemMessaging.CHANNEL
       });
     _messageQueue.MessageReceived += OnMessageReceived;
     _messageQueue.Start();
   }
 }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:18,代码来源:PluginStateTracker.cs


示例19: Activated

    public void Activated(PluginRuntime pluginRuntime)
    {
      var meta = pluginRuntime.Metadata;
      Logger.Info(string.Format("{0} v{1} [{2}] by {3}", meta.Name, meta.PluginVersion, meta.Description, meta.Author));

      DvDevice device = ServiceRegistration.Get<IBackendServer>().UPnPBackendServer.FindDevicesByDeviceTypeAndVersion(UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE, UPnPTypesAndIds.BACKEND_SERVER_DEVICE_TYPE_VERSION, true).FirstOrDefault();
      if (device != null)
      {
        ServiceRegistration.Set<IFanArtService>(new FanArtService());
        Logger.Debug("FanArtService: Registered IFanArtService.");
        device.AddService(new FanArtServiceImpl());
        Logger.Debug("FanArtService: Adding FanArt service to MP2 backend root device");
      }
      else
      {
        Logger.Error("FanArtService: MP2 backend root device not found!");
      }
    }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:18,代码来源:FanArtServicePlugin.cs


示例20: BuildGroup

 protected static ConfigGroupMetadata BuildGroup(
   PluginItemMetadata itemData, PluginRuntime plugin)
 {
   string location = ConfigBaseMetadata.ConcatLocations(itemData.RegistrationLocation, itemData.Id);
   string text = null;
   foreach (KeyValuePair<string, string> attr in itemData.Attributes)
   {
     switch (attr.Key)
     {
       case "Text":
         text = attr.Value;
         break;
       default:
         throw new ArgumentException("'ConfigGroup' builder doesn't define an attribute '" + attr.Key + "'");
     }
   }
   if (text == null)
     throw new ArgumentException("'ConfigGroup' item needs an attribute 'Text'");
   return new ConfigGroupMetadata(location, text);
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:20,代码来源:ConfigBuilder.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Library.Action类代码示例发布时间:2022-05-26
下一篇:
C# PluginManager.PluginItemMetadata类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap