I have an adornment that works great, however, my question is, how do I assign a value to the object parameter in GetTags?
[Modified at 09/16/2010 09:29 AM]
public class SyncTag : ITag
{
}
public class SyncTagger : TaggerBase<SyncTag>
{
public SyncTagger(ICodeDocument document) :
base("SyncTagger", null, document, true)
{
}
public override IEnumerable<TagSnapshotRange<SyncTag>> GetTags(NormalizedTextSnapshotRangeCollection snapshotRanges, object parameter)
{
if (snapshotRanges != null)
{
// Loop through the snapshot ranges
foreach (TextSnapshotRange snapshotRange in snapshotRanges)
{
// Get the text of the snapshot range
string text = snapshotRange.Text;
//TODO: use object parameter
if (text.StartsWith("P"))
{
// Create a tag
SyncTag tag = new SyncTag();
// Yield the tag
yield return new TagSnapshotRange<SyncTag>(
TextSnapshotRange.FromSpan(snapshotRange.Snapshot, snapshotRange.StartOffset, 250), tag);
}
}
}
}