Esempio n. 1
0
 public FoundReferenceEntry(
     TableDataSourceFindUsagesContext context,
     FoundReference reference)
 {
     _context  = context;
     Reference = reference;
 }
Esempio n. 2
0
            public override Task OnReferenceFoundAsync(FoundReference reference)
            {
                var entry = new FoundReferenceEntry(this, reference);

                if (entry != null)
                {
                    lock (Gate) {
                        Entries = Entries.Add(entry);
                    }

                    NotifyChange();
                }

                return(Task.CompletedTask);
            }
        public override Task OnReferenceFoundAsync(FoundReference reference)
        {
            var sr = new MemberReference(
                new CounterfeitVariable(reference.Name),
                reference.FilePath,
                reference.Offset,
                reference.Length);

            if (antiDuplicatesSet.TryAdd(sr, null))
            {
                sr.ReferenceUsageType = reference.Usage switch
                {
                    ReferenceUsage.Declaration => ReferenceUsageType.Declaration,
                    ReferenceUsage.Write => ReferenceUsageType.Write,
                    ReferenceUsage.Read => ReferenceUsageType.Read,
                    _ => ReferenceUsageType.Unknown
                };
            }
            return(Task.CompletedTask);
        }