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); }
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); }
public static bool RequiresModifierGeneration(this Snippet snippet, string modifierName) { return(snippet.HasTag(KnownTags.GenerateAccessModifier) || snippet.HasTag(KnownTags.GenerateModifierTag(modifierName))); }