private void DeleteLab(Objects.Label Lab) { CmdDeleteLabel CmdDeleteLabel = new CmdDeleteLabel(); CmdDeleteLabel.Execute(Lab); CmdDeleteLabel.hierarchyID = Lab.HierarchyID; }
private void btnDeleteLabel_Click(object sender, EventArgs e) { this.IsChecked_btnRectRed = false; this.IsChecked_btnRectBlue = false; this.IsChecked_btnSelect = false; if (Selected.Count == 1) { for (int i = 0; i < Objects.Count; i++) { if (Selected[0] == Objects[i]) { Objects[i].Moved = false; Objects[i].Deleted = true; if (Objects[i].Name == "Label") { CmdDeleteLabel CmdDeleteLabel = new CmdDeleteLabel(); Objects.Label Help_object = (Objects.Label)Objects[i]; Help_object.Username = Username; CmdDeleteLabel.ID_Command = Guid.NewGuid(); CmdDeleteLabel.Execute(Help_object); CmdDeleteLabel.hierarchyID = Help_object.HierarchyID; BinaryFormatter bf = new BinaryFormatter(); using (MemoryStream data = new MemoryStream()) { bf.Serialize(data, CmdDeleteLabel); ServerStream_priv.Write(data.ToArray(), 0, data.ToArray().Length); ServerStream_priv.Flush(); } } Selected.Clear(); break; } } } }