コード例 #1
0
    private MetadataTracker(IWpfTextView textView, ProjectTracker projectTracker, VSTextProperties vsTextProperties) {
      Contract.Requires(projectTracker != null);
      Contract.Requires(textView != null);
      this._vsTextProperties = vsTextProperties;
      this._textView = textView;
      this._projectTracker = projectTracker;
      VSServiceProvider.Current.ExtensionFailed += OnExtensionFailed;

      _timer = new System.Timers.Timer();
      _timer.AutoReset = false;

        if (!AdornmentManager.TryGetAdornmentManager(textView, "MetadataAdornments", out _adornmentManager))
      {
        VSServiceProvider.Current.Logger.WriteToLog("Metadata adornments layer not instantiated.");
        return;
      }
      
      _timer.Elapsed += OnLayoutSettled;
      textView.LayoutChanged += OnLayoutChanged;
    }
コード例 #2
0
        private InheritanceTracker(TextViewTracker textViewTracker)
        {
            Contract.Requires(textViewTracker != null);
            Contract.Requires(textViewTracker.TextView != null);
            if (!AdornmentManager.TryGetAdornmentManager(textViewTracker.TextView, "InheritanceAdornments", out _adornmentManager))
            {
                ContractsPackageAccessor.Current.Logger.WriteToLog("Inheritance adornment layer not instantiated.");
                throw new InvalidOperationException("Inheritance adornment layer not instantiated.");
            }

            _methodsNeedingContractLookup    = new Queue <KeyValuePair <object, MethodDeclarationNode> >();
            _propertiesNeedingContractLookup = new Queue <KeyValuePair <Tuple <object, object>, PropertyDeclarationNode> >();
            _methodKeys   = new HashSet <object>();
            _propertyKeys = new HashSet <object>();

            _textViewTracker = textViewTracker;
            _textViewTracker.LatestCompilationChanged += OnLatestCompilationChanged;
            _textViewTracker.LatestSourceFileChanged  += OnLatestSourceFileChanged;
            _textViewTracker.ProjectTracker.BuildDone += OnBuildDone;
            _textViewTracker.TextView.Closed          += OnClosed;
        }