I've been working on a project using a dictionary, but I got a problem.
In my one wpf class (form) I create a dictionary with some stuff inside. In my second class, I want to read from that dictionary, so I've set the modifier of my dictionary to 'public'. And there is the problem. My dictionary gives the error: CS0050: Inconsistent accessibility: return type 'Dictionary<int, CachedSound>' is less accessible than field 'LoadAudioForm.noteValue'
. Does any of you know how to fix this?
This is a part of my code of my first class:
public partial class LoadAudioForm : Form
{
public Dictionary<int, CachedSound> noteValue = new Dictionary<int, CachedSound>();
private void worker_DoWork(object sender, DoWorkEventArgs e)
{
var worker = sender as BackgroundWorker;
for (int i = 36; i < 97; i++)
{
noteValue.Add(i, new CachedSound("E:/VirtualCarillon/VirtualCarillon/VirtualCarillon/VirtualCarillon/Audio/01/" + i + ".wav"));
}
And now the second class:
AudioPlaybackEngine.Instance.PlaySound(LoadAudioForm.noteValue[ne.NoteNumber + (Convert.ToInt32(nVelR) * 100)]);