public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
        {
            string text       = DisplayText;
            bool   needsQuote = text.IndexOf(' ') != -1;

            if (text == "Pick from file...")
            {
                return(string.Empty);
            }

            if (needsQuote)
            {
                // Prefer to use single quotes, but if the inline style uses single quotes, then use double quotes.
                char quote = (textSource == CssTextSource.InlineStyleSingleQuote) ? '"' : '\'';

                if (typingSpan != null)
                {
                    // If the user already typed a quote, then use it

                    string typingText = typingSpan.GetText(typingSpan.TextBuffer.CurrentSnapshot);

                    if (!string.IsNullOrEmpty(typingText) && (typingText[0] == '"' || typingText[0] == '\''))
                    {
                        quote = typingText[0];
                    }
                }

                if (text != null && text.IndexOf(quote) == -1)
                {
                    text = quote.ToString() + text + quote.ToString();
                }
            }

            return(text);
        }
        public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
        {
            string text = DisplayText;
            bool needsQuote = text.IndexOf(' ') != -1;
            if (text == "Pick from file...")
            {
                return string.Empty;
            }

            if (needsQuote)
            {
                // Prefer to use single quotes, but if the inline style uses single quotes, then use double quotes.
                char quote = (textSource == CssTextSource.InlineStyleSingleQuote) ? '"' : '\'';

                if (typingSpan != null)
                {
                    // If the user already typed a quote, then use it

                    string typingText = typingSpan.GetText(typingSpan.TextBuffer.CurrentSnapshot);

                    if (!string.IsNullOrEmpty(typingText) && (typingText[0] == '"' || typingText[0] == '\''))
                    {
                        quote = typingText[0];
                    }
                }

                if (text != null && text.IndexOf(quote) == -1)
                {
                    text = quote.ToString() + text + quote.ToString();
                }
            }

            return text;
        }
        public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
        {
            if (IsFolder)
            {
                return DisplayText + "/";
            }

            return DisplayText;
        }
Esempio n. 4
0
        public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
        {
            if (IsFolder)
            {
                return(DisplayText + "/");
            }

            return(DisplayText);
        }
Esempio n. 5
0
        public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
        {
            string text = HttpUtility.UrlPathEncode(DisplayText);

            if (IsFolder)
            {
                text += "/";
            }
            return(text);
        }
 public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
 {
     return("region");//"/*#region MyRegion */\n\n\n\n/*#endregion*/";
 }
 public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
 {
     return DisplayText;
 }
Esempio n. 8
0
 public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
 {
     return(_insertion);
 }
 public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
 {
     string text = HttpUtility.UrlPathEncode(DisplayText);
     if (IsFolder)
         text += "/";
     return text;
 }
 public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
 {
     return _insertion;
 }
 public string GetInsertionText(CssTextSource textSource, ITrackingSpan typingSpan)
 {
     return "region";//"/*#region MyRegion */\n\n\n\n/*#endregion*/";
 }