Пример #1
0
        void OnLatestCompilationChanged(object sender, LatestCompilationChangedEventArgs e)
        {
            Contract.Requires(e.LatestCompilation != null);

            //Do any methods need their contract information looked up?
            if (ContractsPackageAccessor.Current.VSOptionsPage.InheritanceOnMethods && _methodsNeedingContractLookup.Count > 0)
            {
                //Recursively look up the needed contract information
                ContractsPackageAccessor.Current.Logger.WriteToLog("Attempting to lookup contracts for " + _methodsNeedingContractLookup.Count + " methods.");
                ContractsPackageAccessor.Current.QueueWorkItem(() => RecursivelyLookupContractsForMethods(this), () => _textViewTracker.TextView.HasAggregateFocus);
            }

            //Do any properties need their contract information looked up?
            if (ContractsPackageAccessor.Current.VSOptionsPage.InheritanceOnProperties && _propertiesNeedingContractLookup.Count > 0)
            {
                //Recursively look up the needed contract information
                ContractsPackageAccessor.Current.Logger.WriteToLog("Attempting to lookup contracts for " + _propertiesNeedingContractLookup.Count + " properties.");
                ContractsPackageAccessor.Current.QueueWorkItem(() => RecursivelyLookupContractsForProperties(this), () => _textViewTracker.TextView.HasAggregateFocus);
            }
        }
    void OnLatestCompilationChanged(object sender, LatestCompilationChangedEventArgs e) {

      Contract.Requires(e.LatestCompilation != null);

      //Do any methods need their contract information looked up?
      if (ContractsPackageAccessor.Current.VSOptionsPage.InheritanceOnMethods && _methodsNeedingContractLookup.Count > 0) {

        //Recursively look up the needed contract information
        ContractsPackageAccessor.Current.Logger.WriteToLog("Attempting to lookup contracts for " + _methodsNeedingContractLookup.Count + " methods.");
        ContractsPackageAccessor.Current.QueueWorkItem(() => RecursivelyLookupContractsForMethods(this), () => _textViewTracker.TextView.HasAggregateFocus);
      }

      //Do any properties need their contract information looked up?
      if (ContractsPackageAccessor.Current.VSOptionsPage.InheritanceOnProperties && _propertiesNeedingContractLookup.Count > 0) {

        //Recursively look up the needed contract information
        ContractsPackageAccessor.Current.Logger.WriteToLog("Attempting to lookup contracts for " + _propertiesNeedingContractLookup.Count + " properties.");
        ContractsPackageAccessor.Current.QueueWorkItem(() => RecursivelyLookupContractsForProperties(this), () => _textViewTracker.TextView.HasAggregateFocus);
      }
    }