title: How this way of defining properties is called
body: <pre><code>public class TestClass
  {
      private Dictionary&lt;string, int&gt; _testDictionary = new Dictionary&lt;string,int&gt;();
  
      private string _key;
  
      public int this[string key]
      {
          get { return _testDictionary[key];}
          set 
          {
              if (_testDictionary.ContainsKey(key))
                  _testDictionary[key] = value;
              else
                  _testDictionary.Add(key, value);
          }
      }
  
  }
  
  public class Program
  {
          static void Main(string[] args)
          {
              TestClass test = new TestClass();
              test["T1"] = 1;
              test["T2"] = 2;
  
              Console.WriteLine(test["T1"]);
              Console.WriteLine(test["T2"]);
          }
  
  }
  </code></pre>
  
  <p>So how this way of defining properties is called, I want to read more about that. Also is it possible to have same definition like this in other places, for an example in Methods etc.</p>