GetCurrentOffset() public abstract method

Given an offset in the original document (at the start of script execution), returns the offset in the current document.
public abstract GetCurrentOffset ( TextLocation originalDocumentLocation ) : int
originalDocumentLocation TextLocation
return int
コード例 #1
0
            void RemoveText(Script script, TextLocation start, TextLocation end)
            {
                var startOffset = script.GetCurrentOffset(start);
                var endOffset   = script.GetCurrentOffset(end);

                if (startOffset < endOffset)
                {
                    script.RemoveText(startOffset, endOffset - startOffset);
                }
            }
コード例 #2
0
			void RemoveText (Script script, TextLocation start, TextLocation end)
			{
				var startOffset = script.GetCurrentOffset (start);
				var endOffset = script.GetCurrentOffset (end);
				if (startOffset < endOffset)
					script.RemoveText (startOffset, endOffset - startOffset);
			}