4
namespace ConsoleApplication8
{
    public class Foo<T>
        where T : IFoo, IFoo2
    {
        public Foo(T fooThing)
        {
        }
    }

    public interface IFoo
    {
        string Name {get;}
    }

    public interface IFoo2
    {
        string Name2 {get;}
    }
}

VS 2010 UML 类图设计器中的模板参数集合编辑器似乎不允许您向单个泛型类型参数添加多个约束。

(图片被拒绝,因为我没有足够的“声誉”点)

我错过了什么吗?基本上,我如何在 VS 2010 UML 类设计器中建模,代码示例中的多类型参数约束?

4

1 回答 1

0

你是对的 - VS 无法证明这一点。UI 只允许您选择一种约束类型。

于 2010-11-02T21:50:18.630 回答