I'm sorry I'm new to C# and WPF.
namespace MyProgram
{
/// <summary>
/// Description of TSearchFiles.
/// </summary>
public class TSearchFiles
{
private TBoolWrapper canceled;
public TSearchFiles(TBoolWrapper bw)
{
canceled = bw;
}
public List<TPhotoRecord> GetFilesRecursive(string b)
{
List<TPhotoRecord> result = new List<TPhotoRecord>();
return result;
}
}
}
I got this error message:
Error 1 Inconsistent accessibility: return type 'System.Collections.Generic.List<MyProgram.TPhotoRecord>' is less accessible than method 'MyProgram.TSearchFiles.GetFilesRecursive(string)'
How to fix it? The code compiled fine in Winforms
Thanks in advance.
Probably TPhotoRecord class is private, i.e.
private class TPhotoRecord
{
//...
}
As far as you return a List<TPhotoRecord> in a public method of a public class:
public class TSearchFiles
{
//...
public List<TPhotoRecord> GetFilesRecursive(string b){/*...*/}
}
TPhotoRecord cannot be less accessible, i.e. it also should be public.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With