2004-09-18, 11:10 AM
hello,
I know this is a bit off topic but hopefully a more experienced c# programmer can point me in the correct direction
I am trying to make what I thought was small amendment to the jukebox plugin so that it will display a deafult image if no image is available in the current folder.
I want to read the variable userDir defined in the class FileSelectionTask from the function render in the class CurrentTrackTask , but I have no idea how to do it.
code fragments as follows
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
public class FileSelectionTask
{
private string userDir;
public void AddMusicDir(string name)
{
if (userDir == "")
{
userDir = name; // I want to read userDir
}
dbDirs.Enqueue(name);
}
}
public class CurrentTrackTask
{
public void Render(Graphics g)
{
.... lots of code
I'd like to say
string noIndexName = userDir + "\\noimage.jpg";
and then use it later in the function
}
[/QUOTE]
I have treid things like FileSelectionTask.userDir
or creating public static string topMusicDir in the FileSelectionTask and copying userDir to it.
then referencing topMusicDir or FileSelctionTask.topMusicDir from the other class
but nothing seems to give me the contents of the variable
any *pointers gratefully received
tkgafs
I know this is a bit off topic but hopefully a more experienced c# programmer can point me in the correct direction
I am trying to make what I thought was small amendment to the jukebox plugin so that it will display a deafult image if no image is available in the current folder.
I want to read the variable userDir defined in the class FileSelectionTask from the function render in the class CurrentTrackTask , but I have no idea how to do it.
code fragments as follows
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
public class FileSelectionTask
{
private string userDir;
public void AddMusicDir(string name)
{
if (userDir == "")
{
userDir = name; // I want to read userDir
}
dbDirs.Enqueue(name);
}
}
public class CurrentTrackTask
{
public void Render(Graphics g)
{
.... lots of code
I'd like to say
string noIndexName = userDir + "\\noimage.jpg";
and then use it later in the function
}
[/QUOTE]
I have treid things like FileSelectionTask.userDir
or creating public static string topMusicDir in the FileSelectionTask and copying userDir to it.
then referencing topMusicDir or FileSelctionTask.topMusicDir from the other class
but nothing seems to give me the contents of the variable
any *pointers gratefully received
tkgafs