forked from enlightenment/efl
eolian_mono: avoid generating set-only property
Summary: According to Property Design Guidelines of MS, set-only properties are not recommeneded. (see more, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/property) Furthermore, there is stylecop warnings(CA1044) ref T8396 List of removed set-only properies. ``` Efl.Access.Editable.IText.TextContent { set; } Efl.App.CommandArray { set; } Efl.App.CommandString { set; } Efl.Canvas.Filter.IInternal.FilterChanged { set; } Efl.Canvas.Filter.IInternal.FilterInvalid { set; } Efl.Canvas.ImageInternal.FilterChanged { set; } Efl.Canvas.ImageInternal.FilterInvalid { set; } Efl.Canvas.Textblock.FilterChanged { set; } Efl.Canvas.Textblock.FilterInvalid { set; } Efl.Canvas.Vg.Image.Data { set; } Efl.Canvas.Vg.Node.CompMethod { set; } Efl.Core.ICommandLine.CommandArray { set; } Efl.Core.ICommandLine.CommandString { set; } Efl.Exe.CommandArray { set; } Efl.Exe.CommandString { set; } Efl.Ui.AlertPopup.Button { set; } Efl.Ui.Collection.MatchContent { set; } Efl.Ui.CollectionView.MatchContent { set; } Efl.Ui.IScrollable.MatchContent { set; } Efl.Ui.ImageZoomable.MatchContent { set; } Efl.Ui.Panel.MatchContent { set; } Efl.Ui.PositionManager.Grid.DataAccess { set; } Efl.Ui.PositionManager.Grid.ScrollPosition { set; } Efl.Ui.PositionManager.Grid.Viewport { set; } Efl.Ui.PositionManager.IDataAccessV1.DataAccess { set; } Efl.Ui.PositionManager.IEntity.ScrollPosition { set; } Efl.Ui.PositionManager.IEntity.Viewport { set; } Efl.Ui.PositionManager.List.DataAccess { set; } Efl.Ui.PositionManager.List.ScrollPosition { set; } Efl.Ui.PositionManager.List.Viewport { set; } Efl.Ui.Scroll.Manager.MatchContent { set; } Efl.Ui.Scroll.Manager.Pan { set; } Efl.Ui.Scroller.MatchContent { set; } Efl.Ui.Spotlight.Manager.Size { set; } Efl.Ui.Textbox.TextContent { set; } Efl.Ui.Widget.ResizeObject { set; } Efl.Ui.Win.PropFocusSkip { set; } ``` Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: woohyun, felipealmeida, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8396 Differential Revision: https://phab.enlightenment.org/D11138
This commit is contained in:
parent
aeb2b506fd
commit
cade1b3c3c
|
@ -428,6 +428,10 @@ struct property_wrapper_definition_generator
|
|||
if (is_interface && (!is_get_public && !is_set_public))
|
||||
return true;
|
||||
|
||||
// Do not generate set-only proeprty
|
||||
if (property.setter.is_engaged() && !property.getter.is_engaged())
|
||||
return true;
|
||||
|
||||
// C# interface members are declared automatically as public
|
||||
if (is_interface)
|
||||
{
|
||||
|
|
|
@ -407,7 +407,7 @@ class TestCsharpProperties
|
|||
var obj = new Dummy.TestObject();
|
||||
int val = -1984;
|
||||
|
||||
obj.SetterOnly = val;
|
||||
obj.SetSetterOnly(val);
|
||||
Test.AssertEquals(val, obj.GetSetterOnly());
|
||||
obj.Dispose();
|
||||
}
|
||||
|
|
|
@ -320,7 +320,7 @@ class TestEventWithDeadWrappers
|
|||
EventHandler<Dummy.TestObjectEvtWithIntEventArgs> cb)
|
||||
{
|
||||
var obj = new Dummy.TestObject();
|
||||
manager.Emitter = obj;
|
||||
manager.SetEmitter(obj);
|
||||
|
||||
obj.EvtWithIntEvent += cb;
|
||||
return new WeakReference(obj);
|
||||
|
|
Loading…
Reference in New Issue