public ToolBoxController() : base() { OpenClickCommand = new DelegateCommand((x) => { AyMessageBox.ShowInformation("谢谢你的留言"); }); }
private void Page_Loaded(object sender, RoutedEventArgs e) { openHuoJian.Click = new DelegateCommand((x) => { AyMessageBox.ShowInformation("小火箭已经开启!"); }); }
private void openPromt_Click(object sender, RoutedEventArgs e) { AyMessageBox.Promt((text) => { AyMessageBox.ShowInformation(winThis, "你刚刚输入的是:{0}".StringFormat(text)); }, "等待你的输入..."); }
public static void ShowMessageBox(this CommonReturnDTO returnDTO, Window owner = null) { //查找aylayer if (returnDTO.IsSuccess) { AyMessageBox.ShowRight(owner, GetMessageByType(returnDTO), Langs.share_tip.Lang()); } else if (returnDTO.Error != null) { AyMessageBox.ShowError(owner, GetMessageByType(returnDTO), Langs.share_tip.Lang()); } else { AyMessageBox.ShowInformation(owner, GetMessageByType(returnDTO), Langs.share_tip.Lang()); } }
private void MenuItem_Click_1(object sender, RoutedEventArgs e) { AyMessageBox.ShowInformation("Ay指定位置杀毒了!"); }
private void AyAnimationButton_Click(object sender, RoutedEventArgs e) { AyMessageBox.ShowInformation("开始杀毒了!"); }
//判断重复未写! //导入功能未写! public async void InputDateToDatabase() { if (StringUtil.isBlank(cmb_tables.Text)) { AyMessageBox.ShowError("未选择数据表!"); return; } String table_name = cmb_tables.Text; String fieldString = cmb_fielditem.Text; int fieldIndex = cmb_fielditem.SelectedIndex; if (reFlag && StringUtil.isBlank(fieldString)) { AyMessageBox.ShowError("未选择需要筛选的重复字段!"); return; } btn_exit.IsEnabled = false; btn_databaseConfig.IsEnabled = false; btn_inputDataToDatabase.IsEnabled = false; btn_readFileData.IsEnabled = false; btn_selectFile.IsEnabled = false; if (emptyFlag) { try { Global.my.Query("Truncate Table " + table_name); } catch { AyMessageBox.ShowError("清空表数据失败!"); return; } } Int32 successCount = 0, failedCount = 0, reCount = 0; String sqlStr = "INSERT INTO " + table_name + " (" + StringUtil.changeArrayToString(fieldArray, ",") + ") VALUES "; String[] valueString = new String[rowCount]; List <RowViewItem> list_no_input = list.Where(x => true).ToList(); if (list_no_input != null) { if (list_no_input.Count > 0) { int list_no_input_count = list_no_input.Count; for (int i = 0; i < list_no_input_count; i++) { valueString[i] = "(" + GetRowValueToString(table_datagrid, i) + ")"; await Task.Run(() => { Thread.Sleep(5); if (reFlag && StringUtil.isNotBlank(fieldString)) { String reSqlString = "select count(1) from " + table_name + " where " + fieldArray[fieldIndex - 1] + " = '" + GetCellValue(i, fieldIndex) + "'"; String baseCountString = Global.my.ExecuteSelect(reSqlString); int baseCount = Int32.Parse(baseCountString); if (baseCount > 0) { list_no_input[i]._state = "数据重复"; reCount++; } else { if (Global.my.Query(sqlStr + valueString[i])) { list_no_input[i]._state = "成功"; successCount++; } else { list_no_input[i]._state = "数据失败"; failedCount++; } } } else { if (Global.my.Query(sqlStr + valueString[i])) { list_no_input[i]._state = "成功"; successCount++; } else { list_no_input[i]._state = "数据失败"; failedCount++; } } }); } table_datagrid.ItemsSource = list; } } btn_exit.IsEnabled = true; btn_databaseConfig.IsEnabled = true; btn_inputDataToDatabase.IsEnabled = true; btn_readFileData.IsEnabled = true; btn_selectFile.IsEnabled = true; AyMessageBox.ShowInformation("导入结束,共执行:" + list_no_input.Count + " 条命令" + "\n成功:" + successCount + " 条" + "\n重复:" + reCount + " 条" + "\n失败:" + failedCount + " 条"); GC.Collect(); }
private void btnLogin_Click(object sender, RoutedEventArgs e) { AyMessageBox.ShowInformation("你的用户名:" + cbo.Text + ",用户密码:" + wpb.Password + ",登录成功.."); }
private void openMessageBox_Click(object sender, RoutedEventArgs e) { if (cboMsgType.Text == "信息") { AyMessageBox.ShowInformation(winThis, "必须填写用户名"); } else if (cboMsgType.Text == "警告") { AyMessageBox.ShowWarning(winThis, "必须填写用户名"); } else if (cboMsgType.Text == "错误") { AyMessageBox.ShowError(winThis, "必须填写用户名"); } else if (cboMsgType.Text == "异常") { AyMessageBox.ShowError(winThis, "必须填写用户名"); } else if (cboMsgType.Text == "疑问") { AyMessageBox.ShowQuestion(winThis, "必须填写用户名"); } else if (cboMsgType.Text == "长文本内容") { AyMessageBox.ShowInformation(winThis, "我是AY,首先声明,我在做一件很枯燥的事情,我是个91后程序员,每天熬夜完成计划的过着下班后的生活\n" + "那天有人反对,那天有人安慰,那天有人嘲讽,那天有人祝福。\n" + "过了6个月后,我对自己的梦想一直没有改变过,继续坚持,终于,AYUI诞生了。\n" + "今天有人说造轮子,今天有人说你好厉害,今天有人说开源吗 ? 有人说好喜欢...\n" + "有贬有褒,但是好的声音多了。\n" + "但是身体的各种问题也来了.."); } else if (cboMsgType.Text == "DIY的弹窗") { AyMessageBox.Show(winThis, "我是AY,首先声明,我在做一件很枯燥的事情,我是个91后程序员,每天熬夜完成计划的过着下班后的生活\n" + "那天有人反对,那天有人安慰,那天有人嘲讽,那天有人祝福。\n" + "过了6个月后,我对自己的梦想一直没有改变过,继续坚持,终于,AYUI诞生了。\n" + "今天有人说造轮子,今天有人说你好厉害,今天有人说开源吗 ? 有人说好喜欢...\n" + "有贬有褒,但是好的声音多了。\n" + "但是身体的各种问题也来了..", "AY自我介绍", MessageBoxButton.OK, AyMessageBoxImage.None, MessageBoxResult.Yes, MessageBoxOptions.RightAlign); } else if (cboMsgType.Text == "长文本内容") { } else if (cboMsgType.Text == "删除") { if (MessageBoxResult.OK == AyMessageBox.ShowDelete(winThis, "确认删除吗", "删除")) { AyMessageBox.ShowRight("操作成功!"); } else { AyMessageBox.ShowRight(winThis, "操作已经被取消!", "操作"); } } else if (cboMsgType.Text == "疑问确认取消") { if (MessageBoxResult.OK == AyMessageBox.ShowQuestionOkCancel(winThis, "确认操作吗?此操作不可以更改", "操作提示")) { AyMessageBox.ShowRight("操作成功!"); } else { AyMessageBox.ShowRight(winThis, "操作已经被取消!", "操作"); } } else if (cboMsgType.Text == "ok") { AyMessageBox.ShowRight(winThis, "操作成功!"); } }
internal static void PlayAyMusic(PlayListItemModel music) { if (System.IO.File.Exists(music.SongPath)) { if (currentPlayTimer != null) { currentPlayTimer.Stop(); currentPlayTimer = null; } MainWindow.curr.ProgressEnbaled = true; if (lastMusic != null) { MainWindow.CurrentPlayer.Stop(); MainWindow.CurrentPlayer.Dispose(); } if (music.ExtName == ".mp3") { Mp3File mp3 = new Mp3File(music.SongPath); if (mp3.TagHandler.Picture != null) { MemoryStream stream = new MemoryStream(AyFuncFactory.GetFunc <AyFuncBitmapWithWpf>().ImageToBytes(mp3.TagHandler.Picture, System.Drawing.Imaging.ImageFormat.Jpeg)); string filename = AyFuncFactory.GetFunc <AyFuncSecrity>().GetMD5Result(mp3.TagHandler.Song + mp3.TagHandler.Artist.ToObjectString()); filename = ExtendUtils.GetDATA_TEMP_ALBUM_PATH() + "\\" + filename + ".jpg"; var dsd = imageSourceConverter.ConvertFrom(stream); if (!File.Exists(filename)) { System.Drawing.Image bm = System.Drawing.Image.FromStream(stream, true); bm.Save(filename); } if (dsd == null) { MainWindow.SetAlbumImage(null, filename); } else { MainWindow.SetAlbumImage(dsd as System.Windows.Media.Imaging.BitmapFrame, filename); } } else { MainWindow.SetAlbumImage(null); } MainWindow.curr.Singer = "- " + mp3.TagHandler.Artist; mp3 = null; AyExtension.MemoryGC(); } else { MainWindow.curr.Singer = "- 未知AY"; } MainWindow.CurrentPlayer = new VlcPlayer(); MainWindow.CurrentPlayer.Initialize(@"Contents\LibVlc", new string[] { "-I", "--dummy", "--ignore-config", "--no-video-title", "--no-sub-autodetect-file" }); MainWindow.CurrentPlayer.EndBehavior = EndBehavior.Repeat; MainWindow.CurrentPlayer.LoadMedia(music.SongPath); MainWindow.CurrentPlayer.Play(); MainWindow.CurSongGuid = music.SongGuid; music.PlayStatus = true; MainWindow.curr.WorldPlayStatus = true; MainWindow.curr.GeName = music.SongNameWithoutExt; if (lastMusic != null && lastMusic.SongGuid != music.SongGuid) { lastMusic.PlayStatus = false; } lastMusic = music; MainWindow.curr.WorldLoveStatus = music.LoveStatus; currentPlayTimer = AyTime.setInterval(100, () => { var totalDuration = MainWindow.CurrentPlayer.GetDuration(); if (totalDuration.Hours > 0) { MainWindow.curr.TotalTime = string.Format("{0:00}:{1:00}:{2:00}", totalDuration.Hours, totalDuration.Minutes, totalDuration.Seconds); } else if (totalDuration.Hours == 0) { MainWindow.curr.TotalTime = string.Format("{0:00}:{1:00}", totalDuration.Minutes, totalDuration.Seconds); } if (MainWindow.CurrentPlayer != null && (MainWindow.CurrentPlayer.State == Meta.Vlc.Interop.Media.MediaState.Paused || MainWindow.CurrentPlayer.State == Meta.Vlc.Interop.Media.MediaState.Stopped)) { currentPlayTimer.Stop(); } var dd = MainWindow.CurrentPlayer.GetPlayTime(); MainWindow.curr.CurrentTime = string.Format("{0:00}:{1:00}:{2:00}", dd.Hours, dd.Minutes, dd.Seconds); if (dd.Hours > 0) { MainWindow.curr.CurrentTime = string.Format("{0:00}:{1:00}:{2:00}", dd.Hours, dd.Minutes, dd.Seconds); } else if (dd.Hours == 0) { MainWindow.curr.CurrentTime = string.Format("{0:00}:{1:00}", dd.Minutes, dd.Seconds); } if (!MainWindow.curr.sliderProgressLock) { MainWindow.curr.CurrentPlayerPosition = MainWindow.CurrentPlayer.Position; } }); } else { AyMessageBox.ShowInformation("音乐文件不存在!"); } }