//private void pictureBoxIconEditor_MouseMove(object sender, MouseEventArgs e) //{ // if (e.Button == MouseButtons.Left) // { // } //} private void pictureBoxIconEditor_MouseDown(object sender, MouseEventArgs e) { if (comboBoxIconList.SelectedItem != null) { Icon selectedIcon = comboBoxIconList.SelectedItem as Icon; if (selectedIcon.IconPoints.Count(p => p.X == e.X / FieldSize && p.Y == e.Y / FieldSize) > 0) { DC.IconPoints.DeleteAllOnSubmit(selectedIcon.IconPoints.Where(p => p.X == e.X / FieldSize && p.Y == e.Y / FieldSize)); } else { IconPoint ip = new IconPoint(); ip.X = e.X / FieldSize; ip.Y = e.Y / FieldSize; ip.Color = buttonColor.BackColor.ToArgb(); //selectedIcon.IconPoints.Add(ip); ip.Icon = selectedIcon; } DC.SubmitChanges(); LoadIconList(selectedIcon); } }
private void pictureBoxIconEditor_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (checkBoxdDrawing.Checked) { Icon selectedIcon = comboBoxIconList.SelectedItem as Icon; IconPoint ip = new IconPoint(); ip.X = e.X / FieldSize; ip.Y = e.Y / FieldSize; ip.Color = buttonColor.BackColor.ToArgb(); //selectedIcon.IconPoints.Add(ip); ip.Icon = selectedIcon; DC.SubmitChanges(); LoadIconList(selectedIcon); } else if (checkBox2.Checked) { Icon selectedIcon = comboBoxIconList.SelectedItem as Icon; DC.IconPoints.DeleteAllOnSubmit(selectedIcon.IconPoints.Where(p => p.X == e.X / FieldSize && p.Y == e.Y / FieldSize)); DC.SubmitChanges(); LoadIconList(selectedIcon); } } }
partial void DeleteIconPoint(IconPoint instance);
partial void UpdateIconPoint(IconPoint instance);
partial void InsertIconPoint(IconPoint instance);
private void detach_IconPoints(IconPoint entity) { this.SendPropertyChanging(); entity.Icon = null; }
private void attach_IconPoints(IconPoint entity) { this.SendPropertyChanging(); entity.Icon = this; }