public XamlTypeName ()
{
+ TypeArguments = empty_type_args;
}
static readonly XamlTypeName [] empty_type_args = new XamlTypeName [0];
public XamlTypeName (XamlType xamlType)
+ : this ()
{
if (xamlType == null)
throw new ArgumentNullException ("xamlType");
l.AddRange (from x in xamlType.TypeArguments.AsQueryable () select new XamlTypeName (x));
TypeArguments = l;
}
- else
- TypeArguments = empty_type_args;
}
public XamlTypeName (string xamlNamespace, string name)
}
public XamlTypeName (string xamlNamespace, string name, IEnumerable<XamlTypeName> typeArguments)
+ : this ()
{
Namespace = xamlNamespace;
Name = name;
l.AddRange (typeArguments);
TypeArguments = l;
}
- else
- TypeArguments = empty_type_args;
}
public string Name { get; set; }
return null;
Type [] genArgs = null;
- if (typeArguments != null) {
+ if (typeArguments != null && typeArguments.Count > 0) {
var xtns = typeArguments;
genArgs = new Type [xtns.Count];
for (int i = 0; i < genArgs.Length; i++) {
[Test]
public void ConstructorDefault ()
{
- new XamlTypeName ();
+ var xtn = new XamlTypeName ();
+ Assert.IsNotNull (xtn.TypeArguments, "#1");
}
[Test]
public void ConstructorNameNull ()
{
// allowed.
- new XamlTypeName ("urn:foo", null);
+ var xtn = new XamlTypeName ("urn:foo", null);
+ Assert.IsNotNull (xtn.TypeArguments, "#1");
}
[Test]
public void ConstructorNamespaceNull ()
{
// allowed.
- new XamlTypeName (null, "FooBar");
+ var xtn = new XamlTypeName (null, "FooBar");
+ Assert.IsNotNull (xtn.TypeArguments, "#1");
}
[Test]
}
[Test]
- [Category ("NotWorking")]
public void Read_DictionaryInt32String ()
{
ReadTest ("Dictionary_Int32_String.xml");
}
[Test]
- [Category ("NotWorking")]
public void Read_DictionaryStringType ()
{
ReadTest ("Dictionary_String_Type.xml");