Browse Source

Fixed WpfDesign unit tests.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2578 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
560b0ea00e
  1. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTestHelper.cs
  2. 6
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTestHelper.cs

@ -30,7 +30,7 @@ namespace ICSharpCode.WpfDesign.Tests.Designer @@ -30,7 +30,7 @@ namespace ICSharpCode.WpfDesign.Tests.Designer
protected XamlDesignContext CreateContext(string xaml)
{
log = new StringBuilder();
XamlDesignContext context = new XamlDesignContext(new XmlTextReader(new StringReader(xaml)), null);
XamlDesignContext context = new XamlDesignContext(new XmlTextReader(new StringReader(xaml)), new XamlLoadSettings());
/*context.Services.Component.ComponentRegistered += delegate(object sender, DesignItemEventArgs e) {
log.AppendLine("Register " + ItemIdentity(e.Item));
};

6
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Diagnostics;
using System.IO;
using System.Reflection;
@ -158,7 +159,10 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -158,7 +159,10 @@ namespace ICSharpCode.WpfDesign.XamlDom
object instance;
if (initializeFromTextValueInsteadOfConstructor != null) {
instance = TypeDescriptor.GetConverter(elementType).ConvertFromString(initializeFromTextValueInsteadOfConstructor.Text);
instance = TypeDescriptor.GetConverter(elementType).ConvertFromString(
document.GetTypeDescriptorContext(),
CultureInfo.InvariantCulture,
initializeFromTextValueInsteadOfConstructor.Text);
} else {
instance = settings.CreateInstanceCallback(elementType, emptyObjectArray);
}

Loading…
Cancel
Save