Attribute annotation for individual indexer position


I am in the process of Localizating a large code base that use indexers heavily

Can anyone provide a starting point for a code analyzer (ReSharperPlugin) that can help in the following senario?

pseudo code:
     class MyClass {
          public string Caption { get; set; }

          public object Data { get; set; }

actual code:
   interface IMessage {
         object this[string index] { get; set; }
   IMessage message = GetMessage("MyClass");
   message["Caption"] = "Foo"; // Wanted: LocalizationRequired warning here
   message["Data"] = "Bar"; // No warning here

It is OK to add a new attribute to IMessage but converteing the code to use classes as in the pseudo code is a no go


1 comment

Please sign in to leave a comment.