GetActivePlugin() private method

private GetActivePlugin ( ) : Plugin
return Plugin
示例#1
0
        private string SanitizeDescription(string desc)
        {
            string result;

            if (Provider.GetActivePlugin() != null && Provider.GetActivePlugin().name != "Perforce")
            {
                result = desc;
            }
            else
            {
                int num = desc.IndexOf('\'');
                if (num == -1)
                {
                    result = desc;
                }
                else
                {
                    num++;
                    int num2 = desc.IndexOf('\'', num);
                    if (num2 == -1)
                    {
                        result = desc;
                    }
                    else
                    {
                        result = desc.Substring(num, num2 - num).Trim(new char[]
                        {
                            ' ',
                            '\t'
                        });
                    }
                }
            }
            return(result);
        }
示例#2
0
        private string SanitizeDescription(string desc)
        {
            if (Provider.GetActivePlugin() != null && Provider.GetActivePlugin().name != "Perforce")
            {
                return(desc);
            }
            int num1 = desc.IndexOf('\'');

            if (num1 == -1)
            {
                return(desc);
            }
            int startIndex = num1 + 1;
            int num2       = desc.IndexOf('\'', startIndex);

            if (num2 == -1)
            {
                return(desc);
            }
            return(desc.Substring(startIndex, num2 - startIndex).Trim(' ', '\t'));
        }
示例#3
0
        private string SanitizeDescription(string desc)
        {
            if ((Provider.GetActivePlugin() != null) && (Provider.GetActivePlugin().name != "Perforce"))
            {
                return(desc);
            }
            int index = desc.IndexOf('\'');

            if (index == -1)
            {
                return(desc);
            }
            index++;
            int num2 = desc.IndexOf('\'', index);

            if (num2 == -1)
            {
                return(desc);
            }
            char[] trimChars = new char[] { ' ', '\t' };
            return(desc.Substring(index, num2 - index).Trim(trimChars));
        }
示例#4
0
        private string SanitizeDescription(string desc)
        {
            if (Provider.GetActivePlugin() != null && Provider.GetActivePlugin().name != "Perforce")
            {
                return(desc);
            }

            // The format of the desc is "327: on 2013/02/03 by foo@bar *pending* 'The real description'"
            // Extract the part after *pending*
            int idx = desc.IndexOf('*');

            if (idx == -1)
            {
                return(desc);
            }
            idx++;
            int idx2 = desc.IndexOf('*', idx);

            if (idx2 == -1)
            {
                return(desc);
            }
            return(desc.Substring(idx2 + 1, desc.Length - idx2 - 1).TrimStart(' ').Trim(' ', '\t'));
        }
示例#5
0
        private string SanitizeDescription(string desc)
        {
            if (Provider.GetActivePlugin() != null && Provider.GetActivePlugin().name != "Perforce")
            {
                return(desc);
            }

            // The format of the desc is "on 2013/02/03 by foo@bar *pending* 'The real description'"
            // Extract the part between ' and '
            int idx = desc.IndexOf('\'');

            if (idx == -1)
            {
                return(desc);
            }
            idx++;
            int idx2 = desc.IndexOf('\'', idx);

            if (idx2 == -1)
            {
                return(desc);
            }
            return(desc.Substring(idx, idx2 - idx).Trim(' ', '\t'));
        }