private void AddTag(string tag, bool update) { HBox box; Label label; Button button; if (tagsDict.ContainsKey(tag)) { return; } box = new HBox(); label = new Label(tag); label.Justify = Justification.Left; button = new Button("gtk-delete"); button.Clicked += delegate { RemoveTag(tag); }; box.PackStart(label, true, false, 0); box.PackStart(button, false, false, 0); tagsbox.PackStart(box, false, false, 0); box.ShowAll(); tagsDict.Add(tag, box); if (update) { template.Add(tag); } }
public async Task <IActionResult> Post([FromBody] SubCategory subCategory) { if (subCategory != null) { return(Ok(await subCategory.Add())); } return(BadRequest("Parameters are null")); }