////////////////////////////////////////////////////////////////////////////// // Mark Screen /////////////////////////////////////////////////////////////// private void pbMain_MouseClick(object sender, MouseEventArgs e) { if (!xppMark.Expand) { return; } Point point = new Point(e.X, e.Y); if (e.Button == System.Windows.Forms.MouseButtons.Left) { switch (get_property_type(map.bmp.GetPixel(point.X, point.Y))) { case property_type.Property: fill(get_color_by_property_type(property_type.Home), point); map_changed(); break; case property_type.Home: fill(get_color_by_property_type(property_type.Property), point); map_changed(); break; default: return; } } else if (e.Button == System.Windows.Forms.MouseButtons.Right) { switch (get_property_type(map.bmp.GetPixel(point.X, point.Y))) { case property_type.Home: property_type prop = add_dnc(point); if (prop == property_type.DNC) { fill(get_color_by_property_type(property_type.DNC), point); map_changed(); } else if (prop == property_type.SO) { fill(get_color_by_property_type(property_type.SO), point); map_changed(); } break; default: return; } } }
public static Color get_color_by_property_type(property_type type) { switch (type) { case property_type.Property: return(Form1.map.property_color); case property_type.Home: return(Form1.map.house_color); case property_type.DNC: return(Form1.map.dnc_color); case property_type.SO: return(Form1.map.so_color); } return(Color.Empty); }