static public string OpenIconPicker(string iconFile) { IconExtractor.PickerDialog picker = new IconExtractor.PickerDialog(); var pathIndex = TextHelpers.Split2(iconFile, "|"); picker.FileName = pathIndex.Item1; picker.IconIndex = MiscFunc.parseInt(pathIndex.Item2); if (picker.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return(null); } IconExtractor extractor = new IconExtractor(picker.FileName); if (extractor.Count == 0) { return(null); } return(picker.FileName + "|" + picker.IconIndex); }
private void icon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (SuspendChange > 0) return; if (e.ChangedButton == MouseButton.Left && e.ClickCount == 2) // double click { IconExtractor.PickerDialog picker = new IconExtractor.PickerDialog(); var pathIndex = TextHelpers.Split2(Program.GetIcon(), "|"); picker.FileName = pathIndex.Item1; picker.IconIndex = MiscFunc.parseInt(pathIndex.Item2); if (picker.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; IconExtractor extractor = new IconExtractor(picker.FileName); if (extractor.Count == 0) return; Program.config.Icon = picker.FileName + "|" + picker.IconIndex; App.client.UpdateProgram(Program.guid, Program.config); icon.Source = ImgFunc.GetIcon(Program.GetIcon(), icon.Width); } }