예제 #1
0
        public async Task FindLiteralReferencesAsync(object value)
        {
            var solution = await GetSolutionAsync().ConfigureAwait(false);

            var progressCallback = new FindLiteralReferencesProgressCallback(this);
            await SymbolFinder.FindLiteralReferencesInCurrentProcessAsync(
                value, solution, progressCallback, CancellationToken).ConfigureAwait(false);
        }
        public async Task FindLiteralReferencesAsync(object value, TypeCode typeCode)
        {
            var convertedType = System.Convert.ChangeType(value, typeCode);
            var solution      = await GetSolutionAsync().ConfigureAwait(false);

            var progressCallback = new FindLiteralReferencesProgressCallback(this);
            await SymbolFinder.FindLiteralReferencesInCurrentProcessAsync(
                convertedType, solution, progressCallback, CancellationToken).ConfigureAwait(false);
        }
        public Task FindLiteralReferencesAsync(object value, TypeCode typeCode, CancellationToken cancellationToken)
        {
            return(RunServiceAsync(async token =>
            {
                using (UserOperationBooster.Boost())
                {
                    var convertedType = System.Convert.ChangeType(value, typeCode);
                    var solution = await GetSolutionAsync(token).ConfigureAwait(false);

                    var progressCallback = new FindLiteralReferencesProgressCallback(this);
                    await SymbolFinder.FindLiteralReferencesInCurrentProcessAsync(
                        convertedType, solution, progressCallback, token).ConfigureAwait(false);
                }
            }, cancellationToken));
        }