我想这样做(我对Silverlight的,但没有具体的所以要做到这一点也WinForm的和WPF).NET类接口,继承和图书馆:误差不实现接口成员
namespace MyComponents
{
public class IMyManager : ILibManager
{
void SetModel(ILibModel model);
}
}
但得到这个错误
错误2'MyComponents.IMymanager'没有实现接口成员'lib.manager.ILibManager.SetModel(lib.model.ILibModel)'。 'MyComponents.IMymanager.SetModel(lib.model.ILibModel)'不能实现接口成员,因为它不公开。 C:... \ MyComponents \ MyComponents \ IMymanager.cs 17 18 MyComponents
为什么?这是库
代码using lib.model;
using System;
using System.Collections.Generic;
using System.Text;
namespace lib.manager
{
public interface ILibManager
{
public void SetModel(ILibModel model);
}
}
using lib.model;
using System;
using System.Net;
using System.Windows;
namespace lib.manager
{
public class Manager: IManager
{
// Constructor
public Manager() {
}
public void SetModel(ILibModel model) {
}
}
}
namespace lib.model
{
public interface ILibModel
{
}
}
namespace lib.model
{
public class Model : ILibModel
{
}
}
好,我犯了一个错误有但那一点都不高。我也在界面中声明了public void。 – user310291 2011-04-20 16:10:49