private MetadataTracker(IWpfTextView textView, double defaultFontSize = 10.0d) {
      this.defaultFontSize = defaultFontSize;
      this.textView = textView;

      bool isMetadataFile = false;
      fileName = textView.TextBuffer.GetFileName();
      if (fileName.Contains('$'))//TODO: This is a very weak check, we need a better way to check this!
        isMetadataFile = true;

      if (!isMetadataFile)
        return;

      adornmentManager = AdornmentManager.GetOrCreateAdornmentManager(textView, "MetadataAdornments");

      //timer = new Timer();
      //timer.BeginInit();
      //timer.AutoReset = false;
      //timer.Elapsed += OnLayoutSettled;
      //timer.Interval = 2000;
      //timer.EndInit();
      //timer.Start();

      textView.LayoutChanged += OnLayoutChanged;

      var foo = new ContractAdornment(11, textView.TextSnapshot.CreateTrackingSpan(0, 10, SpanTrackingMode.EdgeExclusive), defaultFontSize);
    }
 /// <summary>
 /// Tries to get an adornment manager for a particular text view.
 /// </summary>
 public static bool TryGetAdornmentManager(IWpfTextView textView, string adornmentLayer, out AdornmentManager adornmentManager) {
   Contract.Requires(textView != null);
   
   return textView.Properties.TryGetProperty<AdornmentManager>(adornmentLayer, out adornmentManager);
 }