/// <summary> /// Initializes a new instance of the <see cref="CallbackColorPicker"/> class. /// </summary> /// <param name="pickColor">The callback delegate.</param> /// <exception cref="ArgumentNullException"><paramref name="pickColor"/> is null.</exception> public CallbackColorPicker(PickColor pickColor) { if (pickColor == null) { throw new ArgumentNullException(nameof(pickColor)); } this.pickColor = pickColor; }
private void B_Color_Click(object sender, EventArgs e) { DialogResult result = PickColor.ShowDialog(); if (result == DialogResult.OK) { _color = PickColor.Color; } }
/// <summary> /// Xử lí khi click vào chọn BoderColor /// </summary> /// <param name="btnBoder"></param> /// <param name="e"></param> public void Boder_Click(object btnBoder, RoutedEventArgs e) { PickColor pickcolor = new PickColor(status.getBoderColor()); pickcolor.Title = "Edit Boder Color"; if ((bool)pickcolor.ShowDialog()) { } if (pickcolor.result) status.setBoderColor(pickcolor.color); BoderColor.Background = new SolidColorBrush(status.getBoderColor()); }
/// <summary> /// Sets the pick color function callback delegate. /// </summary> /// <param name="pickerCallback">The color picker callback.</param> /// <exception cref="ArgumentNullException"><paramref name="pickerCallback"/> is null.</exception> public void SetPickColorCallback(PickColor pickerCallback) { if (pickerCallback == null) { throw new ArgumentNullException(nameof(pickerCallback)); } pickColor = pickerCallback; }
private void ColorCard_PreviewMouseUp(object sender, MouseButtonEventArgs e) { if (inputFileID != -1) { PickColor pickColor = new PickColor(colorCode); if (pickColor.ShowDialog() == true) { Mouse.OverrideCursor = Cursors.Wait; var pickedColor = pickColor.ColorPicker.Color; ChangeColor(pickedColor); var group = GroupManager.GetGroup(groupName); if (group != null) { foreach (var actGroup in GroupManager.Groups) { if (actGroup.Name.Equals(groupName)) { var channel = actGroup.GetAttribute(ChannelName); if (channel != null) { channel.Color = pickedColor.ToString(); } } } } else { foreach (var inputFile in InputFileManager.InputFiles) { if (inputFile.ID == inputFileID) { foreach (var channel in inputFile.Channels) { if (channel.Name.Equals(ChannelName)) { channel.Color = pickedColor.ToString(); } } } } } GroupManager.SaveGroups(); ((GroupSettings)((SettingsMenu)MenuManager.GetTab(TextManager.SettingsMenuName).Content).GetTab(TextManager.GroupsSettingsName).Content).InitAttributes(); ((InputFilesSettings)((SettingsMenu)MenuManager.GetTab(TextManager.SettingsMenuName).Content).GetTab(TextManager.FilesSettingsName).Content).InitChannelItems(); //TODO if driverless, a driverlesseset updatelje ha nem akkor meg a másikat ((DriverlessMenu)MenuManager.GetTab(TextManager.DriverlessMenuName).Content).BuildCharts(); Mouse.OverrideCursor = null; } } }
void Start() { chosenColor = GetComponent <PickColor> (); if (hairType == PlayerPrefs.GetInt("HairType")) { gameObject.SetActive(true); Debug.Log("true" + PlayerPrefs.GetInt("HairType")); } else { gameObject.SetActive(false); Debug.Log("false" + hairType); } chosenColor.PutColor(PlayerPrefs.GetInt("HairColor")); }