error in .net reflector

2020-05-06 13:08发布

问题:

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 ?

回答1:

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; }
} 


标签: c# reflector