示例#1
0
        internal static string RemoveTag(string tagName, IGlobalAccounts accounts, IGlobalAccount account)
        {
            if (!account.Tags.ContainsKey(tagName))
            {
                return("You can't remove a tag that doesn't exist...");
            }

            account.Tags.Remove(tagName);
            accounts.SaveAccounts(account.Id);

            return($"Successfully removed the tag {tagName}!");
        }
示例#2
0
        internal static string UpdateTag(string tagName, string tagContent, IGlobalAccounts accounts, IGlobalAccount account)
        {
            if (!account.Tags.ContainsKey(tagName))
            {
                return("You can't update a tag that doesn't exist...");
            }

            account.Tags[tagName] = tagContent;
            accounts.SaveAccounts(account.Id);

            return($"Successfully updated the tag {tagName}!");
        }
示例#3
0
        internal static string AddTag(string tagName, string tagContent, IGlobalAccounts accounts, IGlobalAccount account)
        {
            var response = "A tag with that name already exists!\n" +
                           "If you want to override it use `update <tagName> <tagContent>`";

            if (account.Tags.ContainsKey(tagName))
            {
                return(response);
            }
            account.Tags.Add(tagName, tagContent);
            accounts.SaveAccounts(account.Id);
            response = $"Successfully added tag `{tagName}`.";

            return(response);
        }