void rpRenameXamlNamespacePrefix_Apply(object sender, ApplyContentEventArgs ea) { IEnumerable <TagPrefix> tagPrefixes = GetTagPrefixes(ea.Element); ILinkedIdentifierList linkedIdentifiers = CodeRush.LinkedIdentifiers.ActiveStorage.NewList(); foreach (TagPrefix tp in tagPrefixes) { linkedIdentifiers.Add(tp.Range); } CodeRush.LinkedIdentifiers.ActiveStorage.Invalidate(); }
/// <summary> /// Links ranges in the document passed as parameter /// </summary> /// <param name="document"></param> /// <param name="ranges"></param> private static void setUpLinksForDocument(TextDocument document, FileSourceRangeCollection ranges) { if ((ranges != null) && (document != null)) { ILinkedIdentifierList list = CodeRush.LinkedIdentifiers.GetStorage(document).NewList(); int count = ranges.Count; for (int i = 0; i < count; i++) { FileSourceRange range = ranges[i]; ILinkedIdentifier identifier = list.Add(range.Range); if (identifier != null) { identifier.Affix = range.Data as LinkedIdentifierAffix; } } } }