INTERACT FORUM

Windows => Plug-in Development => Topic started by: Doof on May 03, 2006, 11:15:31 pm

Title: Probably a very stupid question...
Post by: Doof on May 03, 2006, 11:15:31 pm
But how do you use the MJImageFileFlags for GetImageFile?

If I use GetImageFile(IMAGEFILE_IN_DATABASE) I'm told that "The name 'IMAGEFILE_IN_DATABASE' does not exist in the current context".

If I just try sticking an integer in there, ie GetImageFile(3), then I get "The best overloaded method match for 'MediaJukebox.IMJFileAutomation.GetImageFile(MediaJukebox.MJImageFileFlags)' has some invalid arguments" and "Argument '1': cannot convert from 'int' to 'MediaJukebox.MJImageFileFlags'"

So where are these MJImageFileFlags defined and how do I gain access to them? This is in C# 2005 Express Edition, BTW...
Title: Re: Probably a very stupid question...
Post by: Doof on May 04, 2006, 10:02:40 am
Anyone?
Title: Re: Probably a very stupid question...
Post by: Mr ChriZ on May 04, 2006, 10:17:36 am
IMAGEFILE_IN_DATABASE must be part of an enumated type at a guess.

Infact it would be this one
MediaJukebox.MJImageFileFlags.IMAGEFILE_IN_DATABASE

I've just realised a flaw in the template, which stems from
the time I created the C# Script plugin.

The method called
public void Init ( object MediaJukebox )
is very badly named and cased...

MediaJukebox is an Interface.  By doing what i've done above
Intellisense gets confused.

Change the method to look like this
public void Init ( MediaJukebox.MJAutomation mediaCenterRef )
 {           
            this.mediaCenterReference = mediaCenterRef ;           
 }


This will allow Visual Studio to give you better intellisense information when
using the MediaJukeBox Interface.
Title: Re: Probably a very stupid question...
Post by: Doof on May 04, 2006, 10:58:59 am
That seems to have done the trick. Thanks!