public void CreateRect(Element item) { List <RectangleNamed> rctngl = SomeUtilities.GetLogicalChildCollection <RectangleNamed>(canvas1); for (int i = 0; i < rctngl.Count; i++) { if (rctngl[i].Name == item.name) { return; } } RectangleNamed rect; rect = new RectangleNamed(); rect.description = item.name; rect.Stroke = new SolidColorBrush(Colors.Black); rect.Fill = item.item_fill; rect.Opacity = item.opacity; rect.Width = item.size_width; rect.Height = item.size_height; Canvas.SetLeft(rect, item.pos_x); Canvas.SetTop(rect, item.pos_y); canvas1.Children.Add(rect); }
public void CreateRect(string rectname, Brush rectcolor, double rectopacity, double width, double height, double x, double y) { List <RectangleNamed> rctngl = SomeUtilities.GetLogicalChildCollection <RectangleNamed>(canvas1); for (int i = 0; i < rctngl.Count; i++) { if (rctngl[i].Name == rectname) { return; } } RectangleNamed rect; rect = new RectangleNamed(); rect.description = rectname; rect.Stroke = new SolidColorBrush(Colors.Black); rect.Fill = rectcolor; rect.Width = width; rect.Height = height; rect.Opacity = rectopacity; Canvas.SetLeft(rect, x); Canvas.SetTop(rect, y); canvas1.Children.Add(rect); SaveItem(rect); }
private void hiddenAllGroupBox() { List <GroupBox> groupboxes = SomeUtilities.GetLogicalChildCollection <GroupBox>(propertiesbox); for (int i = 0; i < groupboxes.Count; i++) { groupboxes[i].Visibility = System.Windows.Visibility.Hidden; } }
private void uncheckAllCheckboxes() { List <CheckBox> checkboxes = SomeUtilities.GetLogicalChildCollection <CheckBox>(grid1); for (int i = 0; i < checkboxes.Count; i++) { if (checkboxes[i].Content.ToString() == "") { checkboxes[i].IsChecked = false; } } }
private bool checCheckedCheckboxes(DependencyObject parent) { List <CheckBox> checkboxes = SomeUtilities.GetLogicalChildCollection <CheckBox>(parent); for (int i = 0; i < checkboxes.Count; i++) { if (checkboxes[i].IsChecked == true) { return(true); } } return(false); }
public void RemoveRect(string rectname) { List <RectangleNamed> rctngl = SomeUtilities.GetLogicalChildCollection <RectangleNamed>(canvas1); for (int i = 0; i < rctngl.Count; i++) { if (rctngl[i].Name == rectname) { if (rctngl[i].isSelected) { rctngl[i].Unselect(); } canvas1.Children.Remove(rctngl[i]); toolbox.currentView.removeItem(rectname); } } }
public void CreateRect(string rectname, Element.types typeOfElement, Brush rectcolor, double rectopacity, double width, double height, double x, double y, bool horizontalResizing = true, bool verticallResizing = true) { List <RectangleNamed> rctngl = SomeUtilities.GetLogicalChildCollection <RectangleNamed>(canvas1); for (int i = 0; i < rctngl.Count; i++) { if (rctngl[i].Name == rectname) { return; } } RectangleNamed rect; rect = new RectangleNamed(rectname, typeOfElement, rectcolor, rectopacity, width, height, x, y); rect.MouseMove += RectangleNamed_MouseMove; rect.MouseLeave += RectangleNamed_MouseLeave; rect.MouseDown += RectangleNamed_MouseDown; rect.onRectangleNamedSelectedChange += rectangleSelectChanget; rect.horizontalResizing = horizontalResizing; rect.verticallResizing = verticallResizing; SaveItem(rect, typeOfElement); rect.fillProperties(propertiesbox.getPropertiesByType(typeOfElement)); canvas1.Children.Add(rect); }