NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 31 32 33 34 35 … 93 Next »
Csharp Event help needed..

 
  • 0 Vote(s) - 0 Average
Csharp Event help needed..
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#1
2008-05-25, 12:28 AM
Anyone know is there's a way of determine if an object has already defined an event method?

I've got this in the plugin constructor that is being called twice:
Code:
MediaLibrary.OnMediaAddEvent += new AddMediaEventHandler(MediaLibrary_OnMediaAddEvent);

And because I use the IEventNotification the plugin is initialised twice - meaning when i fire the event it fires twice. Anyone know how to check is i've already run the event notification?
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#2
2008-05-25, 12:47 AM
psycik Wrote:Anyone know is there's a way of determine if an object has already defined an event method?
How about (pseudo code)
Code:
private AlreadyDefined = false;

...

if (!AlreadyDefined)
{
    // Define whatever
    AlreadyDefined = true;
}
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#3
2008-05-25, 01:02 AM
yeah I did it that way, was hoping there was a way that the object knew rather than me having to keep track of it...

Actually you have to use a static, cos it's two new objects (plugins) that are defined
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#4
2008-05-25, 05:52 AM
This is a bit of a shot in the dark, but is GetInvocationList() available as a property of OnMediaAddEvent?
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#5
2008-05-25, 06:19 AM
Nope doesn't seem to be. Prob. cos there's a static object in there...
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Recording Event jrockow 10 4,670 2014-07-28, 02:51 PM
Last Post: jrockow
  New web service clarification needed bgowland 6 3,198 2013-10-19, 02:36 AM
Last Post: bgowland
  Skin help needed for EventDetails.xml bgowland 7 3,267 2011-06-26, 11:55 PM
Last Post: Jaggy
  Event codes mvallevand 10 3,768 2011-04-06, 04:26 AM
Last Post: mvallevand
  "Rating" in cached event details xml alibert 74 16,608 2011-03-28, 01:06 AM
Last Post: zehd
  STARTUP_COMPLETE event on NMT alibert 6 2,317 2011-02-12, 05:15 PM
Last Post: sub
  NPVR - temporary solution to lack of searchable fields after event is gone from guide carpeVideo 5 2,199 2010-09-29, 03:08 AM
Last Post: mvallevand
  MVP/NMT testers needed for Weather2 scb147 46 11,777 2010-03-03, 08:12 PM
Last Post: scb147
  How do I catch the event where a list item is selected? mkenyon2 3 1,408 2009-01-06, 06:36 PM
Last Post: sub
  SQL help needed bgowland 4 2,085 2008-05-25, 07:08 AM
Last Post: bgowland

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode