public AssetTextOccurrence(UnityMethodsOccurrence assetOccurrence, string oldName, string newName, bool isProperty) { var curRange = assetOccurrence.MethodData.TextRange; var pointer = assetOccurrence.SourceFile.Document.ToPointer(); myRangeMarker = new RangeMarker(pointer, isProperty ? new TextRange(curRange.StartOffset + 4, curRange.EndOffset) : curRange); myAssetOccurrence = assetOccurrence; NewName = newName; OldName = isProperty ? oldName.RemoveStart("get_").RemoveStart("set_") : oldName; }
public AssetTextOccurrence(UnityEventHandlerOccurrence assetOccurrence, IPsiSourceFile sourceFile, string oldName, string newName, bool isProperty) { var curRange = assetOccurrence.MethodUsages.TextRangeOwnerPsiPersistentIndex; var pointer = sourceFile.Document.ToPointer(); myRangeMarker = new RangeMarker(pointer, isProperty ? new TextRange(curRange.StartOffset + 4, curRange.EndOffset) : curRange); myAssetOccurrence = assetOccurrence; NewName = newName; OldName = isProperty ? oldName.RemoveStart("get_").RemoveStart("set_") : oldName; }