private void SearchRunClick(object sender, RoutedEventArgs e) { if (!(sender is Button button)) { return; } Fc.loadWeaponListHandler -= SearchRunEvent; var tags = button.Tag; switch (tags) { case "Search": Fc.NowPage = 1; break; case "Goto": var tempInt = string.IsNullOrEmpty(tbGotoValue.Text) ? 1 : Convert.ToInt32(tbGotoValue.Text); if (tempInt > Fc.PageCount || tempInt < 1) { NoticeX.Show("页码超出范围", "error", MessageBoxIcon.Error, 900); return; } Fc.NowPage = tempInt; break; } FilterRunMethod(); Fc.loadWeaponListHandler += SearchRunEvent; }
private void Read() { var r = new Random(); try { while (IsReading) { Thread.Sleep(150); var now = DateTime.Now; _trend = double.Parse(Act_Hight); ChartValues.Add(new MeasureModel { DateTime = now, Value = _trend }); SetAxisLimits(now); //lets only use the last 150 values if (ChartValues.Count > 50) { ChartValues.RemoveAt(0); } } } catch (Exception x) { NoticeX.Show("Error", Panuon.UI.Silver.MessageBoxIcon.Error); NoticeX.Show(x.ToString(), Panuon.UI.Silver.MessageBoxIcon.Error); } }
private void FilterRunMethod() { this.IsMaskVisible = false; var Obj = Fc.FilterRun(); WeaponList.Clear(); if (Obj.hasError || Obj.ObjList.Count == 0) { NoticeX.Show("加载列表出错:" + (string.IsNullOrEmpty(Obj.ErrorMsg) ? "没有查询到数据" : Obj.ErrorMsg), MessageBoxIcon.Error, 900); return; } WeaponList.AddRange(Obj.ObjList); this.IsMaskVisible = false; }
public uint mDeviceCount = 0; //返回设备读取的轴数 public PCIE_1203Initialize() { int Retry_OpenDEV = 0; bool bRescan = false; var iResult = Motion.mAcm_GetAvailableDevs(CurAvailableDevs, Motion.MAX_DEVICES, ref mDeviceCount); if (iResult == 0 && mDeviceCount > 0) { for (int i = 0; i < mDeviceCount; i++)//打开所有卡和所有轴 { do { var iResult0 = Motion.mAcm_DevOpen(CurAvailableDevs[i].DeviceNum, ref DeviceHandle[i]);//获得设备卡的句柄 if (iResult0 != 0) { Retry_OpenDEV++; bRescan = true; if (Retry_OpenDEV > 10) { bRescan = false; NoticeX.Show("Error Code" + iResult0.ToString() + "卡号" + i.ToString() + "开卡失败", Panuon.UI.Silver.MessageBoxIcon.Error); } Thread.Sleep(1000); } else { bRescan = false; } } while (bRescan); var Result_A = Motion.mAcm_GetU32Property(DeviceHandle[i], (uint)PropertyID.FT_DevAxesCount, ref m_AxisCount[i]); if (Result_A == 0)//打开设备轴下所有的轴 { for (int j = 0; j < m_AxisCount[i]; j++) { Motion.mAcm_AxOpen(DeviceHandle[i], (ushort)j, ref AxisHandle[j]); } } } } else { NoticeX.Show("Success", "轴卡初始化失败", Panuon.UI.Silver.MessageBoxIcon.Error, 1000); } }
private void ApplyButtonClick(object sender, System.Windows.RoutedEventArgs e) { if (OldPathStr.Length == 0) { MessageBoxX.Show("您尚未添加任何文件!", "错误", MessageBoxButton.OK, MessageBoxIcon.Error); return; } else { if (RuleList.Count == 0) { MessageBoxX.Show("您尚未添加任何规则!", "警告", MessageBoxButton.OK, MessageBoxIcon.Warning); return; } else { for (int i = 0; i < NewPathStr.Length; i++) { if (NewPathStr[i] == "") { MessageBoxX.Show("任何输出文件名不能为空!", "错误", MessageBoxButton.OK, MessageBoxIcon.Error); return; } } MessageBoxResult t = MessageBoxX.Show("您是否确认应用所有重命名规则?", "应用确认", MessageBoxButton.OKCancel, MessageBoxIcon.Info, DefaultButton.YesOK); if (t == MessageBoxResult.OK) { Computer rename = new Computer(); for (int i = 0; i < OldPathStr.Length; i++) { rename.FileSystem.RenameFile(Path + OldPathStr[i], NewPathStr[i]); } OldPathStr = new string[0]; NewPathStr = new string[0]; Path = ""; ReGlobal.PathCount = 0; max = 0; Show_List(); NoticeX.Show("重命名文件成功!", "批量重命名工具", MessageBoxIcon.Info, 3000); } } } }
public void Notice(string cap) { switch (cap) { case "none": NoticeX.Show("This is a message. This is a message. This is a message. This is a message. This is a message.", "None", MessageBoxIcon.None, 3000); break; case "info": NoticeX.Show("This is a message. This is a message. This is a message. This is a message. This is a message.", "Info", MessageBoxIcon.Info, 3000); break; case "warning": NoticeX.Show("This is a message. This is a message. This is a message. This is a message. This is a message.", "Warning", MessageBoxIcon.Warning, 3000); break; case "error": NoticeX.Show("This is a message. This is a message. This is a message. This is a message. This is a message.", "Error", MessageBoxIcon.Error, 3000); break; case "question": NoticeX.Show("This is a message. This is a message. This is a message. This is a message. This is a message.", "Question", MessageBoxIcon.Question, 3000); break; case "success": NoticeX.Show("This is a message. This is a message. This is a message. This is a message. This is a message.", "Warning", MessageBoxIcon.Success, 3000); break; case "image": NoticeX.Show("This is a message.", "Image", "/UIBrowser;component/Resources/Images/panuon.png", 3000); break; case "always": NoticeX.Show("This is a message.", "Image", "/UIBrowser;component/Resources/Images/panuon.png"); break; } }
protected override void OnExit(object sender, EventArgs e) { NoticeX.Dispose(); base.OnExit(sender, e); }