Пример #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;
        }
Пример #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;
        }
Пример #3
0
        /// <summary>
        /// Returns reference built from KeyAfterRename
        /// </summary>
        public override string GetReferenceAfterRename(string newKey)
        {
            char splitChar;

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

            string prefix = OriginalReferenceText.Substring(0, OriginalReferenceText.LastIndexOf(splitChar));

            return(prefix + splitChar + newKey);
        }
Пример #4
0
        /// <summary>
        /// Returns reference built from KeyAfterRename
        /// </summary>
        public override string GetReferenceAfterRename(string newKey)
        {
            string prefix = OriginalReferenceText.Substring(0, OriginalReferenceText.LastIndexOf('.'));

            return(prefix + "." + newKey);
        }