Ejemplo n.º 1
0
        /// <summary>
        /// Called during the rename process - adjusts the position of the item to fit the renamed
        /// </summary>
        public override void UpdateReplaceSpan()
        {
            char splitChar;

            if (ComesFromWebSiteResourceReference)
            {
                splitChar = ',';
            }
            else
            {
                splitChar = '.';
            }

            string prefix       = OriginalReferenceText.Substring(0, OriginalReferenceText.LastIndexOf(splitChar)).RemoveWhitespace();
            string newReference = prefix + splitChar + KeyAfterRename;

            TextSpan newSpan = new TextSpan();

            newSpan.iStartIndex     = ReplaceSpan.iStartIndex;
            newSpan.iStartLine      = ReplaceSpan.iStartLine;
            newSpan.iEndLine        = ReplaceSpan.iStartLine;
            newSpan.iEndIndex       = ReplaceSpan.iStartIndex + newReference.Length;
            this.ReplaceSpan        = newSpan;
            this.AbsoluteCharLength = newReference.Length;
            this.FullReferenceText  = FullReferenceText.Substring(0, FullReferenceText.LastIndexOf('.')).RemoveWhitespace() + '.' + KeyAfterRename;
            this.Key = KeyAfterRename;
            this.OriginalReferenceText = newReference;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called during the rename process - adjusts the position of the item to fit the renamed
        /// </summary>
        public override void UpdateReplaceSpan()
        {
            string prefix       = OriginalReferenceText.Substring(0, OriginalReferenceText.LastIndexOf('.')).RemoveWhitespace();
            string newReference = prefix + "." + KeyAfterRename;

            TextSpan newSpan = new TextSpan();

            newSpan.iStartIndex     = ReplaceSpan.iStartIndex;
            newSpan.iStartLine      = ReplaceSpan.iStartLine;
            newSpan.iEndLine        = ReplaceSpan.iStartLine;
            newSpan.iEndIndex       = ReplaceSpan.iStartIndex + newReference.Length;
            this.ReplaceSpan        = newSpan;
            this.AbsoluteCharLength = newReference.Length;
            this.FullReferenceText  = FullReferenceText.Substring(0, FullReferenceText.LastIndexOf('.')).RemoveWhitespace() + "." + KeyAfterRename;
            this.Key = KeyAfterRename;
            this.OriginalReferenceText = newReference;
        }