How restrict attribute on interface's method
<p>I'd like to create a custom attribute but restrict its usage to interface's methods. Is it possible to do that in C#?</p>

<p>I'd like to have compilator error when I try to do this:</p>

<pre><code>public class SomeClass
{
   [MyAttribute]
   public void SomeMethod() { ... }
}

[MyAttribute]
public interface IMyInterface { ... }
</code></pre>

<p>I want to be be able to do only this:</p>

<pre><code>public interface IMyInterface
{
   [MyAttribute]
   void SomeMethod();
}
</code></pre>

<p>I can limit my attribute to interface or to methods but not both in the same time</p>

<pre><code>[AttributeUsage(AttributeTargets.Method)]
</code></pre>
