Skip to content

Attribute to suppress message #543

@SelvinPL

Description

@SelvinPL

Add attribute to suppress message

Method 'XXXX' matches automatic change method name but has parameters and will not be used as automatic change callback. Rename the method to remove this warning or remove parameters to use as automatic callback method.
fx I had class

class SomeBaseViewModel<T> : ViewModelBase
{
	public T SelectedItem { get; set; }

	protected virtual void OnSelectedItemChanged(T item) { }

	[SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Used by generator")]
	private void OnSelectedItemChanged()
	{
		OnSelectedItemChanged(SelectedItem);
	}
}

I would like to my build be silent

resolution:

add some code here

var callbackReferences = (from method in declaringType.Methods

to not take method with some attribute into account

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions