Inconsistent accessibility Error

Source: Internet
Author: User

Today, we made a small item for outlook to move emails to the specified folder Based on the subjects of the email.

When I first started using C #, I also learned how to use it for many things. When I wrote my own outlook class, I directly used some code (class declaration) automatically generated by ), except for the following issues:

 

 

 

Error 1 inconsistent accessibility: property type 'movemailbasedonname. Outlook 'is less accessible than property 'movemailbasedonname. settingform. myoutlook'

 

The access level of the outlook class is not modified. The default access level is used. In settingform, the setting is used to access the myoutlook attribute in settingform in mainform.

 

Privrate outlook myoutlook = NULL;

 

Public outlook myoutllok

{

Get {return myoutlook ;}

}

 

This is the cause of compilation errors. Because the default access level of the outlook class is protect, it is lower than the public level when the get property is set. So an error occurs.

The modification method is also very simple. You only need to set the access level of the outlook class to public.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.