`View.IsOverridden` doesn't work
See original GitHub issueI wrote these unit tests (ViewTests.cs) to prove it.
[Fact, AutoInitShutdown]
public void IsOverridden_False_IfNotOverriden ()
{
var view = new DerivedView () { Text = "DerivedView does not override MouseEvent", Width = 10, Height = 10 };
Assert.False (view.IsOverridden (view, "MouseEvent"));
}
[Fact, AutoInitShutdown]
public void IsOverridden_True_IfOverriden ()
{
var view = new Button () { Text = "Button overrides MouseEvent", Width = 10, Height = 10 };
Assert.True (view.IsOverridden (view, "MouseEvent"));
}
@BDisp - Where’d you get this code from?
/// <summary>
/// Check if the <paramref name="method"/> is overridden in the <paramref name="view"/>.
/// </summary>
/// <param name="view">The view.</param>
/// <param name="method">The method name.</param>
/// <returns><see langword="true"/> if it's overridden, <see langword="false"/> otherwise.</returns>
public bool IsOverridden (View view, string method)
{
Type t = view.GetType ();
MethodInfo m = t.GetMethod (method);
return (m.DeclaringType == t || m.ReflectedType == t) && m.GetBaseDefinition ().DeclaringType == typeof (Responder);
}
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
java - Override doesn't seem to work
Change the visibility of the filter() method to protected in Super class so it can be overridden. Private methods cannot be override.
Read more >Graphic overrides by category doesn´t work consistently in ...
Users reported that graphic overrides by category doesn´t work consistently in certain Revit views. In some views an Override by Category ...
Read more >Unable to override default "View" action
When I try to override the view action using the Lightning Component Bundle in Classic, it works with out any issue.
Read more >Overriding a specific display doesn't work - Drupal Answers
I created a view in Drupal 8 with 2 displays. I want to keep a display content view mode as teaser and the...
Read more >Is it possible to override Razor MVC Views in module? #5128
As per documentation overriding razor view is possible in theme But it doesn't explain on how to override views in a module.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This passes the tests:
Your fix also fix the #2140. Only replace the
ComboBoxTests
HideDropdownListOnClick_True_Highlight_Current_Item
in the line 827 with this. Because now theSelectedItem
default value is -1 then no item are selected on theListView
of theComboBox
.Edit: Is better replace all this test because we have to consider all the frame.