error in .net reflector

2020-05-06 12:58发布

i have reflected one program with .net reflector and open it in visual studio. one item in each form is:

bool IControlByOptions.get_IsDisposed()
{
  return this.IsDisposed;
}

when i build solution , it has an error : 'Solo.Module.CtrlProductForm.Solo.Base.IControlByEdition.get_IsDisposed()' explicit method implementation cannot implement 'Solo.Base.IControlByEdition.IsDisposed.get' because it is an accessor.

IControlByOptions file contents :

using System;

namespace Solo.Base
{
 public interface IControlByOptions
 {
    bool IsDisposed { get; }

    void RefreshUIFromCompanyOrPersonalOptions();
 }
}

how to fix this error ?

标签: c# reflector
1条回答
狗以群分
2楼-- · 2020-05-06 13:24

Try changing the implementation to

bool IControlByOptions.IsDisposed
{
    get { return this.IsDisposed; }
}

Update based on your comments. Try this for properties with setter.

bool ICtrlTemplateOption.Visible
{
    get { return this.Visible; }
    set { this.Visible = value; }
} 
查看更多
登录 后发表回答