【发布时间】:2011-04-20 10:56:13
【问题描述】:
我想这样做(我在 silverlight 上但没有什么特别的,所以想在 winform 和 wpf 上也这样做)
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 我的组件
为什么?这是Lib中的代码
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
{
}
}
【问题讨论】:
标签: c# .net wpf winforms silverlight