c# - access to protected enum -


i have base class written in vb.net using in c# project. base class has properties have give them value in project. have problem accessing 1 of these properties. follows:

this in base class:

public mustinherit class ftpuploaderbase {   private _protocol ftpprotocol    protected property protocol() ftpprotocol             return _protocol     end     set(byval value ftpprotocol)         _protocol = value     end set end property     protected enum ftpprotocol     ftp = 1 'standard ftp (port 21)     sftp = 2 'secure ftp on ssh (port 22)     ftps = 3 'secure ftp on implicit ssl (port 990)     ftpes = 4 'secure ftp on explicit ssl (port 21 - forward 443) end enum   } 

this c# class drived base class:

 public class ftpuploadeclass:ftpuploader.ftpuploaderbase {   public ftpprotocol protocol   {             {           return base.protocol;       }        set       {             base.protocol = value;       }    }     } 

it shows error on protocol: inconsistent accessibility: property type'ftpuploaded.ftpuplodedbase.ftpprotocol' less accessible property 'my base class name here'

solution: have changed name of property in c# class , works

you can't declare public property type ftpprotocol because type not visible class not inheriting base class.

to make work change visibility of enum public or create second enum maps first 1 ( public ).


Comments