title: c# attributes and generic--list
body: <p>I have such generic class of list:</p>
  
  <pre><code>using System;
  using System.Collections;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace Lab7
  {
      public class MyListClass&lt;T&gt;: IEnumerable&lt;T&gt;
      {
          public delegate void MyDelegate();
          public event MyDelegate AddEvent;
          public event MyDelegate RemEvent;   
  
          List&lt;T&gt; list;
  
          public T this[int index]
          {
              get { return list[index]; }
              set { list[index] = value; }
          }
  
          public void Add(T item)
          {
              list.Add(item);
              if (AddEvent != null)
                  AddEvent();   
          }
  
          public void Remove(T item)
          {
              list.Remove(item);
              if (RemEvent != null)
                  RemEvent();   
          }
  
          public void RemoveAt(int index)
          {
              list.RemoveAt(index);
              if (RemEvent != null)
                  RemEvent();   
          }
  
          public MyListClass()
          {
              list = new List&lt;T&gt;();
          }
  
          public MyListClass(List&lt;T&gt; list)
          {
              this.list = list;
          }
  
          public IEnumerator&lt;T&gt; GetEnumerator()
          {
              return list.GetEnumerator();
          }
  
          IEnumerator IEnumerable.GetEnumerator()
          {
              return list.GetEnumerator();
          }
  
          #region Events
          /*static void AddHandler()
          {
              Console.WriteLine("Объект добавлен в коллекцию"); 
          }
          static void RemoveHandler()
          {
              Console.WriteLine("Объект удалён из коллекции коллекцию");
          }*/
          #endregion
  
      }
  }
  </code></pre>
  
  <p>Where i must put attribute to write something to different classes, according to type of this list? How do I write this attribute?</p>
  
  <p>I didn't understand sense of attributes in this lab.</p>
  
  <p>If you want to see all lab, it's here </p>
  
  <blockquote>
    <p>Write generic class of list with
    opportunity to generate events when
    you call some class methods.
    Information about events must e
    written in some files, which must be
    determinated by attached to this class
    attribute.</p>
  </blockquote>