예제 #1
0
        public static bool RequiresTypeGeneration(this Snippet snippet, string typeName)
        {
            if (snippet.HasTag(KnownTags.GenerateType) ||
                snippet.HasTag(KnownTags.GenerateTypeTag(typeName)))
            {
                if (KnownTags.GenerateTypeTag(typeName) != KnownTags.GenerateVoidType ||
                    snippet.HasTag(KnownTags.GenerateVoidType))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #2
0
        public static string GetTitleWithoutShortcut(this Snippet snippet)
        {
            if (snippet.HasTag(KnownTags.TitleStartsWithShortcut))
            {
                string s = snippet.Title;

                int i = 0;

                while (i < s.Length &&
                       s[i] != ' ')
                {
                    i++;
                }

                while (i < s.Length &&
                       s[i] == ' ')
                {
                    i++;
                }

                return(s.Substring(i));
            }

            return(snippet.Title);
        }
예제 #3
0
 public static bool RequiresModifierGeneration(this Snippet snippet, string modifierName)
 {
     return(snippet.HasTag(KnownTags.GenerateAccessModifier) ||
            snippet.HasTag(KnownTags.GenerateModifierTag(modifierName)));
 }