//returns a matching Tag or creates a new on if none was fond. public static Tag find_or_create_by(string tag_name, string save_dir, bool save_on_create = true) { tag_name = sanitize_name(tag_name); if (String.IsNullOrEmpty(tag_name)) { return(null); } Tag tag = Tags.find(tag_name, save_dir); if (tag == null) { tag = new Tag(tag_name, save_dir); } if (save_on_create) { Tags.save(); } return(tag); }
//Edit Tag Dialog (using tag_dialog_form) protected void edit_tag_dialog(string tag_name, float top, float left) { Tag tag = Tags.find(tag_name, active_save_dir); tag_dialog_form("Edit", true, tag.name, active_save_dir, tag.rule_based, tag.rule_attribute, tag.rule_comparitor, tag.rule_value, top, left, null); }