public static Task <ConflictResolution> ResolveConflictsAsync(
     RenameLocations renameLocationSet,
     string originalText,
     string replacementText,
     OptionSet optionSet,
     Func <IEnumerable <ISymbol>, bool?> hasConflict,
     CancellationToken cancellationToken)
 {
     try {
         var task         = resolveConflictsAsyncMethod.Invoke(null, new object [] { renameLocationSet.instance, originalText, replacementText, optionSet, hasConflict, cancellationToken });
         var propertyInfo = task.GetType().GetProperty("Result");
         return(Task.FromResult(new ConflictResolution(propertyInfo.GetValue(task))));
     } catch (TargetInvocationException ex) {
         ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
         return(null);
     }
 }
示例#2
0
		public static Task<ConflictResolution> ResolveConflictsAsync(
			RenameLocations renameLocationSet,
			string originalText,
			string replacementText,
			OptionSet optionSet,
			Func<IEnumerable<ISymbol>, bool?> hasConflict,
			CancellationToken cancellationToken)
		{
			try {
				var task = resolveConflictsAsyncMethod.Invoke (null, new object [] { renameLocationSet.instance, originalText, replacementText, optionSet, hasConflict, cancellationToken });
				var propertyInfo = task.GetType ().GetProperty ("Result");
				return Task.FromResult (new ConflictResolution (propertyInfo.GetValue (task)));
			} catch (TargetInvocationException ex) {
				ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
				return null;
			}
		}