Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 2f4482a

Browse files
Restoring AutoCompleteBoxTests
1 parent 6817bfd commit 2f4482a

File tree

5 files changed

+265
-168
lines changed

5 files changed

+265
-168
lines changed

src/GitHub.Extensions/ReflectionExtensions.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Globalization;
55
using System.Linq;
66
using System.Reflection;
7+
using System.Runtime.Serialization;
78

89
namespace GitHub.Extensions
910
{
@@ -53,5 +54,20 @@ public static string GetCustomAttributeValue<T>(this Assembly assembly, string p
5354
var value = propertyInfo.GetValue(attribute, null);
5455
return value.ToString();
5556
}
57+
58+
public static T CreateUninitialized<T>()
59+
{
60+
// WARNING: THIS METHOD IS PURE EVIL!
61+
// Only use this in cases where T is sealed and has an internal ctor and
62+
// you're SURE the API you're passing it into won't do anything interesting with it.
63+
// Even then, consider refactoring.
64+
return (T)FormatterServices.GetUninitializedObject(typeof(T));
65+
}
66+
67+
public static void Invoke(object obj, string methodName, params object[] parameters)
68+
{
69+
var method = obj.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic);
70+
method.Invoke(obj, parameters);
71+
}
5672
}
5773
}

src/GitHub.UI/Controls/AutoCompleteBox/AutoCompleteBox.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ private static void OnTextPropertyChanged(DependencyObject d, DependencyProperty
620620
/// Gets or sets the Text template part.
621621
/// </summary>
622622
[SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0")]
623-
protected internal IAutoCompleteTextInput TextBox
623+
public IAutoCompleteTextInput TextBox
624624
{
625625
get { return textInput; }
626626
set { UpdateTextBox(value); }
@@ -701,12 +701,12 @@ IObservable<bool> ObserveTextBoxChanges()
701701
/// <value>The selection adapter used to populate the drop-down with a
702702
/// list of selectable items.</value>
703703
/// <remarks>
704-
/// You can use this property when you create an automation peer to
704+
/// You can use this property when you create an automation peer to sw
705705
/// use with AutoCompleteBox or deriving from AutoCompleteBox to
706706
/// create a custom control.
707707
/// </remarks>
708708
[SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0")]
709-
protected internal ISelectionAdapter SelectionAdapter
709+
public ISelectionAdapter SelectionAdapter
710710
{
711711
get { return adapter; }
712712
set

src/GitHub.UI/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Windows;
1+
using System.Runtime.CompilerServices;
2+
using System.Windows;
23
using System.Windows.Markup;
34

45
[assembly: ThemeInfo(

0 commit comments

Comments
 (0)