SORU
3 HAZİRAN 2011, Cuma


Tutarsız Erişilebilirlik: Parametre türü yöntem daha az ulaşılabilir

Bir nesne (şu anda oturum açmış kullanıcı için bir referans, temelde iki form arasında geçiş yapmaya çalışıyorum. Şu anda, giriş formunda bu doğrultuda bir şey var:

private ACTInterface oActInterface;

public void button1_Click(object sender, EventArgs e)
    {
        oActInterface = new ACTInterface(@"\\actserver\Database\Premier.pad",this.textUser.Text,this.textPass.Text);

        if (oActInterface.checkLoggedIn())
        {
            //user has authed against ACT, so we can carry on
            clients oClientForm = new clients(oActInterface);
            this.Hide();
            oClientForm.Show();
        }
        else...

bir sonraki formda (öğrenci), var:

public partial class clients : Form
{
    private ACTInterface oActInt {get; set;}

    public clients(ACTInterface _oActInt)

beni içeri aldığın sonuçları:...

Error   1   Inconsistent accessibility: 
parameter type 'support.ACTInterface' is less accessible than method    
'support.clients.clients(support.ACTInterface)'  
c:\work\net\backup\support\support\clients.cs   20  16  support

Gerçekten sorunun ne olduğunu bilmiyorum, her iki alan özel ve formdan ilgili kamu yöntemi ile erişilebilir. Google'da sadece bir öğesi ortak olmak ve bu durumda burada değil diğer özel, doğru puan olarak çok bir faydası olmayacak.

Kimseye yardım?

CEVAP
3 HAZİRAN 2011, Cuma


public clients sınıfın yapıcı public ama private tip ACTInterface bir parametre (bir sınıfta iç içe değil mi?) vardır. Bunu yapamazsın. ACTInterface en az erişilebilir clients olarak yapmak gerekir.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • DorkmanScott

    DorkmanScott

    14 NİSAN 2006
  • Justin Davis

    Justin Davis

    14 Ocak 2008
  • The White House

    The White Ho

    21 Ocak 2006