private static void ShowSplash() { splashWindow = new SplashWindow(); splashWindow.Show(); ResetSplashCreated.Set(); System.Windows.Threading.Dispatcher.Run(); }
public bool StartService() { bCanceld = false; var splash = new SplashWindow(); if (splash.ShowDialog() == false) { bCanceld = true; return false; } if (TraceFile.Instance.Start(splash.NameBox.Text, splash.PathBox.Text)) { Error = string.Empty; return true; } Error = TraceFile.Instance.Errormsg; return false; }
private void TPSCheckButton_Click(object sender, EventArgs e) { Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } FrontsCatalog = new FrontsCatalog(2); DecorCatalog = new DecorCatalog(2); FrontsCatalogBinding(); DecorCatalogBinding(); FrontsGridsSettings(); DecorGridsSettings(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } }
private void dgvWorks_SelectionChanged(object sender, EventArgs e) { if (dgvWorks.SelectedRows.Count == 0) { _plannedWorkManager.UpdateExecutors(0); _plannedWorkManager.UpdateFiles(0); return; } int plannedWorkId = 0; int plannedWorkStatusId = 0; if (dgvWorks.SelectedRows[0].Cells["PlannedWorkID"].Value != DBNull.Value) { plannedWorkId = Convert.ToInt32(dgvWorks.SelectedRows[0].Cells["PlannedWorkID"].Value); } if (dgvWorks.SelectedRows[0].Cells["PlannedWorkStatusID"].Value != DBNull.Value) { plannedWorkStatusId = Convert.ToInt32(dgvWorks.SelectedRows[0].Cells["PlannedWorkStatusID"].Value); } if (NeedSplash) { Thread T = new Thread( delegate() { SplashWindow.CreateSmallSplash(ref _topForm, "Обновление данных.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } _plannedWorkManager.UpdateExecutors(plannedWorkId); _plannedWorkManager.UpdateFiles(plannedWorkId); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } } else { _plannedWorkManager.UpdateExecutors(plannedWorkId); _plannedWorkManager.UpdateFiles(plannedWorkId); } if (_roleType == RoleTypes.Ordinary) { btnConfirm.Enabled = false; btnStart.Enabled = false; btnEnd.Enabled = false; } else { switch (plannedWorkStatusId) { case 1: btnConfirm.Enabled = true; btnStart.Enabled = false; btnEnd.Enabled = false; break; case 2: btnConfirm.Enabled = false; btnStart.Enabled = true; btnEnd.Enabled = false; break; case 3: btnConfirm.Enabled = false; btnStart.Enabled = false; btnEnd.Enabled = true; break; case 4: btnConfirm.Enabled = false; btnStart.Enabled = false; btnEnd.Enabled = false; break; default: btnConfirm.Enabled = false; btnStart.Enabled = false; btnEnd.Enabled = false; break; } } }
private void DoRun() { if (AppUtil.GetMutex(NTKeyword.MinerClientAppMutex)) { NotiCenterWindow.ShowWindow(); Logger.InfoDebugLine($"==================NTMiner.exe {EntryAssemblyInfo.CurrentVersionStr}=================="); // 在另一个UI线程运行欢迎界面以确保欢迎界面的响应不被耗时的主界面初始化过程阻塞 // 注意:必须确保SplashWindow没有用到任何其它界面用到的依赖对象 SplashWindow splashWindow = null; SplashWindow.ShowWindowAsync(window => { splashWindow = window; }); if (!NTMiner.Windows.WMI.IsWmiEnabled) { DialogWindow.ShowHardDialog(new DialogWindowViewModel( message: "开源矿工无法运行所需的组件,因为本机未开启WMI服务,开源矿工需要使用WMI服务检测windows的内存、显卡等信息,请先手动开启WMI。", title: "提醒", icon: "Icon_Error")); Shutdown(); Environment.Exit(0); } if (!NTMiner.Windows.Role.IsAdministrator) { NotiCenterWindowViewModel.Instance.Manager .CreateMessage() .Warning("提示", "请以管理员身份运行。") .WithButton("点击以管理员身份运行", button => { WpfUtil.RunAsAdministrator(); }) .Dismiss().WithButton("忽略", button => { }).Queue(); } BuildPaths(); NTMinerContext.Instance.Init(() => { _appViewFactory.BuildPaths(); if (VirtualRoot.IsLTWin10) { VirtualRoot.ThisLocalWarn(nameof(App), AppRoot.LowWinMessage, toConsole: true); } if (NTMinerContext.Instance.GpuSet.Count == 0) { VirtualRoot.ThisLocalError(nameof(App), "没有矿卡或矿卡未驱动。", toConsole: true); } if (NTMinerContext.WorkType != WorkType.None && NTMinerContext.Instance.ServerContext.CoinSet.Count == 0) { VirtualRoot.ThisLocalError(nameof(App), "访问阿里云失败,请尝试更换本机dns解决此问题。", toConsole: true); } UIThread.Execute(() => { Window mainWindow = null; AppRoot.NotifyIcon = ExtendedNotifyIcon.Create("开源矿工", isMinerStudio: false); if (NTMinerRegistry.GetIsNoUi() && NTMinerRegistry.GetIsAutoStart()) { ConsoleWindow.Instance.Hide(); VirtualRoot.Out.ShowSuccess("以无界面模式启动,可在选项页调整设置", header: "开源矿工"); } else { _appViewFactory.ShowMainWindow(isToggle: false, out mainWindow); } // 主窗口显式后退出SplashWindow splashWindow?.Dispatcher.Invoke((Action) delegate() { splashWindow?.OkClose(); }); // 启动时Windows状态栏显式的是SplashWindow的任务栏图标,SplashWindow关闭后激活主窗口的Windows任务栏图标 mainWindow?.Activate(); StartStopMineButtonViewModel.Instance.AutoStart(); // 注意:因为推迟到这里才启动的计时器,所以别忘了在Upgrade、和Action情况时启动计时器 VirtualRoot.StartTimer(new WpfTimingEventProducer()); if (CommandLineArgs.Action.TryParse(out MinerClientActionType resourceType)) { VirtualRoot.Execute(new MinerClientActionCommand(resourceType)); } }); Task.Factory.StartNew(() => { var minerProfile = NTMinerContext.Instance.MinerProfile; if (minerProfile.IsDisableUAC) { NTMiner.Windows.UAC.DisableUAC(); } if (minerProfile.IsAutoDisableWindowsFirewall) { Firewall.DisableFirewall(); } if (minerProfile.IsDisableWAU) { NTMiner.Windows.WAU.DisableWAUAsync(); } if (minerProfile.IsDisableAntiSpyware) { NTMiner.Windows.Defender.DisableAntiSpyware(); } if (!Firewall.IsMinerClientRuleExists()) { Firewall.AddMinerClientRule(); } try { HttpServer.Start($"http://{NTKeyword.Localhost}:{NTKeyword.MinerClientPort.ToString()}"); Daemon.DaemonUtil.RunNTMinerDaemon(); NoDevFee.NoDevFeeUtil.RunNTMinerNoDevFee(); } catch (Exception ex) { Logger.ErrorDebugLine(ex); } }); }); } else { try { _appViewFactory.ShowMainWindow(this, NTMinerAppType.MinerClient); } catch (Exception) { DialogWindow.ShowSoftDialog(new DialogWindowViewModel( message: "另一个开源矿工正在运行但唤醒失败,请重试。", title: "错误", icon: "Icon_Error")); Process currentProcess = Process.GetCurrentProcess(); NTMiner.Windows.TaskKill.KillOtherProcess(currentProcess); } } }
private void MFSummaryDG_SelectionChanged(object sender, EventArgs e) { if (ExpOrdersSummaryCheckBox.Checked) { return; } if (ExpeditionStatistics != null) { if (ExpeditionStatistics.MFSummaryBS.Count > 0) { if (((DataRowView)ExpeditionStatistics.MFSummaryBS.Current)["ClientID"] != DBNull.Value) { bool Profil = ExpProfilCheckBox.Checked; bool TPS = ExpTPSCheckBox.Checked; int FactoryID = 0; if (Profil && !TPS) { FactoryID = 1; } if (!Profil && TPS) { FactoryID = 2; } if (!Profil && !TPS) { FactoryID = -1; } if (NeedSplash) { NeedSplash = false; Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } if (ExpClientSummaryCheckBox.Checked) { ExpeditionStatistics.FMarketingOrders(FactoryID, Convert.ToInt32(((DataRowView)ExpeditionStatistics.MFSummaryBS.Current)["ClientID"])); } else { ExpeditionStatistics.FMarketingOrders1(FactoryID, Convert.ToInt32(((DataRowView)ExpeditionStatistics.MFSummaryBS.Current)["MegaOrderID"])); } if (!ExpeditionStatistics.HasFronts) { ExpeditionStatistics.ClearFrontsOrders(); } ExpFrontsInfo(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } NeedSplash = true; } else { if (ExpClientSummaryCheckBox.Checked) { ExpeditionStatistics.FMarketingOrders(FactoryID, Convert.ToInt32(((DataRowView)ExpeditionStatistics.MFSummaryBS.Current)["ClientID"])); } else { ExpeditionStatistics.FMarketingOrders1(FactoryID, Convert.ToInt32(((DataRowView)ExpeditionStatistics.MFSummaryBS.Current)["MegaOrderID"])); } if (!ExpeditionStatistics.HasFronts) { ExpeditionStatistics.ClearFrontsOrders(); } ExpFrontsInfo(); } } } } }
private static void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args) { if (args.Error == null) { if (args.IsUpdateAvailable) { var messageBox = new AdonisUI.Controls.MessageBoxModel { Text = $"There is new version {args.CurrentVersion} available.{Environment.NewLine}" + $"You are using version {args.InstalledVersion}.{Environment.NewLine}" + $"{ChangelogText}{Environment.NewLine}" + $"Do you want to update the application now?", Caption = @"Update Available", Buttons = AdonisUI.Controls.MessageBoxButtons.YesNo() }; AdonisUI.Controls.MessageBox.Show(messageBox); if (!manual) { SplashWindow.splash.Hide(); } if (messageBox.Result.Equals(AdonisUI.Controls.MessageBoxResult.Yes)) { try { if (AutoUpdater.DownloadUpdate(args)) { if (!manual) { SplashWindow.Stop(); } Application.Current.Shutdown(); Environment.Exit(0); } } catch (Exception exception) { AdonisUI.Controls.MessageBox.Show( exception.Message, exception.GetType().ToString(), AdonisUI.Controls.MessageBoxButton.OK, AdonisUI.Controls.MessageBoxImage.Error); } } if (!manual) { SplashWindow.splash.Show(); } } } else { if (args.Error is WebException) { AdonisUI.Controls.MessageBox.Show( @"There is a problem reaching update server. Please check your internet connection and try again later.", @"Update Check Failed", AdonisUI.Controls.MessageBoxButton.OK, AdonisUI.Controls.MessageBoxImage.Error); } else { AdonisUI.Controls.MessageBox.Show( args.Error.Message, args.Error.GetType().ToString(), AdonisUI.Controls.MessageBoxButton.OK, AdonisUI.Controls.MessageBoxImage.Error); } } }
private void LoadWithSampleButton_Click(object sender, EventArgs e) { if (InfiniumFileList.Selected == -1) { return; } if (InfiniumFiles.CheckInheritedPermission(Security.CurrentUserID, InfiniumFileList.Entered) == false) { InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600); return; } if (InfiniumFileList.CheckVisible) { InfiniumFileList.CheckVisible = false; CheckMultipleButton.BringToFront(); } UploadFileDialog.Multiselect = false; if (UploadFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (InfiniumFiles.CheckFileExist(UploadFileDialog.FileNames, InfiniumFileList.Entered) == true)//file exist { InfiniumTips.ShowTip(this, 50, 85, "Один или несколько файлов уже существуют в папке", 2600); return; } PhantomForm PhantomForm = new PhantomForm(); PhantomForm.Show(); //set attributes DocumentAttributesForm DocumentAttributesForm = new DocumentAttributesForm(ref InfiniumFiles, ref TopForm); TopForm = DocumentAttributesForm; DocumentAttributesForm.ShowDialog(); bool bFirstSign = DocumentAttributesForm.bFirstSign; if (DocumentAttributesForm.bCanceled) { PhantomForm.Close(); PhantomForm.Dispose(); TopForm = null; return; } //upload UploadFileForm UploadFileForm = new UploadFileForm(ref InfiniumFiles.FM, ref InfiniumFiles, UploadFileDialog.FileNames, InfiniumFileList.Entered, ref TopForm); TopForm = UploadFileForm; UploadFileForm.ShowDialog(); PhantomForm.Close(); PhantomForm.Dispose(); TopForm = null; UploadFileDialog.Dispose(); InfiniumFiles.SetAttributes(Path.GetFileName(UploadFileDialog.FileNames[0]), InfiniumFileList.Entered, bFirstSign); Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(InfiniumFileList.Top + UpdatePanel.Top, InfiniumFileList.Left + UpdatePanel.Left, InfiniumFileList.Height, InfiniumFileList.Width); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } InfiniumFiles.EnterFolder(InfiniumFileList.Entered); InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable; bC = true; } }
private void RemoveButton_Click(object sender, EventArgs e) { if (InfiniumFileList.Selected == -1) { return; } if (InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption == "[...]") { return; } if (InfiniumFiles.CurrentItemsDataTable.Select("FolderID = " + InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID)[0]["Extension"].ToString() == "folder") { if (InfiniumFiles.CheckFolderPermission(Security.CurrentUserID, InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID) == false) { InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600); return; } } else { if (InfiniumFiles.CanEditFile(Security.CurrentUserID, InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID) == false) { InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600); return; } } if (InfiniumFileList.CheckVisible) { int r = InfiniumFiles.CheckCheckedItems(InfiniumFileList.ItemsDataTable); if (r == 0) { InfiniumTips.ShowTip(this, 50, 85, "Выберите один или несколько файлов", 5600); return; } bool OK = LightMessageBox.Show(ref TopForm, true, "Удалить выбранные файлы\\папки?", "Удаление"); if (!OK) { return; } InfiniumFiles.RemoveFolder(InfiniumFileList.ItemsDataTable); InfiniumFiles.RemoveFile(InfiniumFileList.ItemsDataTable); } else { if (InfiniumFileList.Selected > -1) { bool OK = LightMessageBox.Show(ref TopForm, true, "Удалить?", "Удаление"); if (!OK) { return; } if (InfiniumFiles.CurrentItemsDataTable.Select("FolderID = " + InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID)[0]["Extension"].ToString() == "folder") { if (InfiniumFiles.RemoveFolder(InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID) == false) { InfiniumTips.ShowTip(this, 50, 85, "Ошибка удаления папки с хостинга", 4000); } } else { InfiniumFiles.RemoveFile(InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID, InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID, InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption); } } } Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(InfiniumFileList.Top + UpdatePanel.Top, InfiniumFileList.Left + UpdatePanel.Left, InfiniumFileList.Height, InfiniumFileList.Width); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } InfiniumFiles.EnterFolder(InfiniumFileList.Entered); InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable; InfiniumFileList.EnterInFolder(InfiniumFileList.Entered); if (InfiniumFileList.CheckVisible) { InfiniumFileList.CheckVisible = false; CheckMultipleButton.BringToFront(); } bC = true; }
//Распечатать все этикетки в одном заказе private void PrintMegaOrderContextMenuItem_Click(object sender, EventArgs e) { Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Создание этикеток.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } if (MarketingPackagesPrintManager.MegaOrdersBindingSource.Count < 1) { return; } MarketingPackagesPrintManager.MegaOrdersBindingSource.Position = CurrentRowIndex; //Проверка int MegaOrderID = Convert.ToInt32(((DataRowView)MarketingPackagesPrintManager.MegaOrdersBindingSource.Current).Row["MegaOrderID"]); int MainOrderID = 0; if (!MarketingPackagesPrintManager.IsMegaOrderPacked(MegaOrderID, ref MainOrderID)) { Infinium.LightMessageBox.Show(ref TopForm, false, "Этикетки распечатать нельзя. Подзаказ № " + MainOrderID + " должен быть полностью распределен на обеих фирмах", "Ошибка печати"); return; } int[] MainOrders = MarketingPackagesPrintManager.GetMainOrders(); int PackNumber = 0; int PackageID = 0; int ProductType = 0; ArrayList PackageIDs = new ArrayList(); PackageLabel.ClearLabelInfo(); DataTable TempPackagesDataTable = new DataTable(); for (int j = 0; j < MainOrders.Count(); j++) { TempPackagesDataTable = MarketingPackagesPrintManager.TempPackages(MainOrders[j], FrontIDs, ProductIDs).Copy(); for (int i = 0; i < TempPackagesDataTable.Rows.Count; i++) { DataTable DT = new DataTable(); Infinium.Modules.Packages.Marketing.Info LabelInfo = new Modules.Packages.Marketing.Info(); ProductType = Convert.ToInt32(TempPackagesDataTable.Rows[i]["ProductType"]); PackNumber = Convert.ToInt32(TempPackagesDataTable.Rows[i]["PackNumber"]); PackageID = Convert.ToInt32(TempPackagesDataTable.Rows[i]["PackageID"]); PackageIDs.Add(PackageID); if (ProductType == 0) { ProductType = 0; GetPackageInfo(MainOrders[j], PackNumber, ProductType, PackageID, ref LabelInfo); LabelInfo.ProductType = ProductType; PrintBarCode.FilterFrontsOrders(MainOrders[j], PackageID); LabelInfo.TechnoInset = PrintBarCode.TechnoInset; DT = PrintBarCode.FillFrontsDataTable().Copy(); } if (ProductType == 1) { ProductType = 1; GetPackageInfo(MainOrders[j], PackNumber, ProductType, PackageID, ref LabelInfo); LabelInfo.ProductType = ProductType; PrintBarCode.FilterDecorOrders(MainOrders[j], PackageID); DT = PrintBarCode.FillDecorDataTable().Copy(); } LabelInfo.OrderData = DT; LabelInfo.GroupType = "М"; PackageLabel.AddLabelInfo(0, ref LabelInfo); MarketingPackagesPrintManager.FilterPackages(MainOrders[j], FrontIDs, ProductIDs); } } PrintDialog.Document = PackageLabel.PD; if (PrintDialog.ShowDialog() == DialogResult.OK) { for (int i = 0; i < PackageIDs.Count; i++) { PackageID = Convert.ToInt32(PackageIDs[i]); MarketingPackagesPrintManager.PrintedCountUp(PackageID); } PackageLabel.Print(); } TempPackagesDataTable.Dispose(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } }
public SplashWindowViewModel(SplashWindow view) => _view = view;
private void kryptonCheckSet1_CheckedButtonChanged(object sender, EventArgs e) { if (MarketingNews == null) { return; } Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(LightNewsContainer.Top, LightNewsContainer.Left, LightNewsContainer.Height, LightNewsContainer.Width); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } MarketingNews.FillLikes(); if (cbtnClients.Checked) { ClientsMenu.ClientsDataTable = MarketingNews.ClientsDataTable; ClientsMenu.InitializeItems(); ClientsMenu.Selected = 0; MarketingNews.FillNews(ClientsMenu.Items[ClientsMenu.Selected].ClientID); MarketingNews.FillNewClientsNews(); NewClientsMenu.ClientsDataTable = MarketingNews.ClientsNewsDataTable; NewClientsMenu.InitializeItems(); if (ClientsMenu.Selected == -1) { MarketingNews.ReloadClientsNews(20, NewClientsMenu.Items[NewClientsMenu.Selected].ClientID); } else { MarketingNews.ReloadClientsNews(20, ClientsMenu.Items[ClientsMenu.Selected].ClientID); } if (MarketingNews.ClientsNewsDataTable.Rows.Count == 0) { ClientsMenu.Top = 0; ClientsMenu.Height = panel1.Height; } else { ClientsMenu.Top = 239; ClientsMenu.Height = panel1.Height - ClientsMenu.Top; NewClientsMenu.Selected = 0; ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name); } panel1.BringToFront(); } else { ClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersDataTable; ClientsManagersMenu.InitializeItems(); ClientsManagersMenu.Selected = 0; MarketingNews.FillMNews(ClientsManagersMenu.Items[ClientsManagersMenu.Selected].ClientID); MarketingNews.FillNewManagersNews(); NewClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersNewsDataTable; NewClientsManagersMenu.InitializeItems(); if (ClientsManagersMenu.Selected == -1) { MarketingNews.ReloadManagersNews(20, NewClientsManagersMenu.Items[NewClientsManagersMenu.Selected].ClientID); } else { MarketingNews.ReloadManagersNews(20, ClientsManagersMenu.Items[ClientsManagersMenu.Selected].ClientID); } if (MarketingNews.ClientsManagersNewsDataTable.Rows.Count == 0) { ClientsManagersMenu.Top = 0; ClientsManagersMenu.Height = panel4.Height; } else { ClientsManagersMenu.Top = 239; ClientsManagersMenu.Height = panel4.Height - ClientsManagersMenu.Top; NewClientsManagersMenu.Selected = 0; ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name); } panel4.BringToFront(); } MarketingNews.ReloadComments(); MarketingNews.ReloadAttachments(); LightNewsContainer.NewsDataTable = MarketingNews.NewsDataTable.Copy(); LightNewsContainer.CommentsDT = MarketingNews.CommentsDataTable.Copy(); LightNewsContainer.AttachsDT = MarketingNews.AttachmentsDataTable.Copy(); LightNewsContainer.CreateNews(); LightNewsContainer.ScrollToTop(); LightNewsContainer.Focus(); bC = true; }
private void UpdateNewsButton_Click(object sender, EventArgs e) { Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(LightNewsContainer.Top, LightNewsContainer.Left, LightNewsContainer.Height, LightNewsContainer.Width); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } if (cbtnClients.Checked) { MarketingNews.FillNewClientsNews(); NewClientsMenu.ClientsDataTable = MarketingNews.ClientsNewsDataTable; NewClientsMenu.InitializeItems(); if (MarketingNews.ClientsNewsDataTable.Rows.Count == 0) { ClientsMenu.Top = 0; ClientsMenu.Height = panel1.Height; MarketingNews.FillNewManagersNews(); NewClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersNewsDataTable; NewClientsManagersMenu.InitializeItems(); if (MarketingNews.ClientsManagersNewsDataTable.Rows.Count == 0) { ClientsManagersMenu.Top = 0; ClientsManagersMenu.Height = panel1.Height; } else { cbtnManagers.Checked = true; ClientsManagersMenu.Top = 239; ClientsManagersMenu.Height = panel1.Height - ClientsManagersMenu.Top; NewClientsManagersMenu.Selected = 0; ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name); } } else { ClientsMenu.Top = 239; ClientsMenu.Height = panel1.Height - ClientsMenu.Top; NewClientsMenu.Selected = 0; ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name); } } if (cbtnManagers.Checked) { MarketingNews.FillNewManagersNews(); NewClientsManagersMenu.ClientsManagersDataTable = MarketingNews.ClientsManagersNewsDataTable; NewClientsManagersMenu.InitializeItems(); if (MarketingNews.ClientsManagersNewsDataTable.Rows.Count == 0) { ClientsManagersMenu.Top = 0; ClientsManagersMenu.Height = panel1.Height; MarketingNews.FillNewClientsNews(); NewClientsMenu.ClientsDataTable = MarketingNews.ClientsNewsDataTable; NewClientsMenu.InitializeItems(); if (MarketingNews.ClientsNewsDataTable.Rows.Count == 0) { ClientsMenu.Top = 0; ClientsMenu.Height = panel1.Height; } else { cbtnClients.Checked = true; ClientsMenu.Top = 239; ClientsMenu.Height = panel1.Height - ClientsMenu.Top; NewClientsMenu.Selected = 0; ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name); } } else { ClientsManagersMenu.Top = 239; ClientsManagersMenu.Height = panel1.Height - ClientsManagersMenu.Top; NewClientsManagersMenu.Selected = 0; ActiveNotifySystem.ClearSubscribesRecords(Security.CurrentUserID, this.Name); } } UpdateNewsButton.Visible = false; bC = true; }
protected bool PulseGTK() { if(quitNow) return false; if( ( needEndSplashWin && pingEnd ) || ! thread.IsAlive) { fakeSplashButton.Click(); Log.Write("splash window ending here"); return false; } //need to do this, if not it crashes because chronopicWin gets died by thread ending splashWin = SplashWindow.Show(); //Log.WriteLine("splash"); if(updatingDB) { splashWin.ShowProgressbar("updating"); splashWin.UpdateLabel(splashMessage + " " + Sqlite.PrintConversionText()); splashWin.UpdateProgressbar("version", Sqlite.PrintConversionVersion()); splashWin.UpdateProgressbar("rate", Sqlite.PrintConversionRate()); splashWin.UpdateProgressbar("subrate", Sqlite.PrintConversionSubRate()); } else if(creatingDB) { splashWin.ShowProgressbar("creating"); splashWin.UpdateProgressbar("version", Sqlite.PrintCreation()); //splashWin.UpdateProgressbar("rate", Sqlite.PrintConversionRate()); splashWin.UpdateProgressbar("subrate", Sqlite.PrintConversionSubRate()); } if(needUpdateSplashMessage) { splashWin.UpdateLabel(splashMessage); needUpdateSplashMessage = false; } Thread.Sleep (50); //Log.Write(" (PulseGTK:" + thread.ThreadState.ToString() + ") "); return true; }
public static SplashWindow Show() { if (SplashWindowBox == null) { SplashWindowBox = new SplashWindow(); } SplashWindowBox.splash_window.Show (); return SplashWindowBox; }
protected override void OnStartup(StartupEventArgs e) { BootLog.Log("App.OnStartup start"); RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; try { appMutex = new Mutex(true, _appPipName, out createdNew); } catch (Exception) { createdNew = false; } if (createdNew) { if (!NTMiner.Windows.Role.IsAdministrator) { AppHelper.RunAsAdministrator(); return; } BootLog.Log("new SplashWindow"); SplashWindow splashWindow = new SplashWindow(); splashWindow.Show(); NTMinerRoot.Inited = () => { NTMinerRoot.KernelDownloader = new KernelDownloader(); Execute.OnUIThread(() => { bool?result = true; if (string.IsNullOrEmpty(Server.LoginName) || string.IsNullOrEmpty(Server.Password)) { LoginWindow loginWindow = new LoginWindow(); splashWindow.Hide(); result = loginWindow.ShowDialog(); } if (result.HasValue && result.Value) { BootLog.Log("new MainWindow"); ControlCenterWindow window = new ControlCenterWindow(); IMainWindow mainWindow = window; this.MainWindow = window; this.MainWindow.Show(); this.MainWindow.Activate(); BootLog.Log("MainWindow showed"); notifyIcon = new ExtendedNotifyIcon("pack://application:,,,/ControlCenterApp;component/logo.ico"); notifyIcon.Init(); #region 处理显示主界面命令 Global.Access <ShowMainWindowCommand>( Guid.Parse("01f3c467-f494-42b8-bcb5-848050df59f3"), "处理显示主界面命令", LogEnum.None, action: message => { Execute.OnUIThread(() => { Dispatcher.Invoke((ThreadStart)mainWindow.ShowThisWindow); AppHelper.MainWindowShowed(); }); }); #endregion Task.Factory.StartNew(() => { AppHelper.RunPipeServer(this, _appPipName); }); } splashWindow?.Close(); BootLog.SyncToDisk(); }); }; } else { try { AppHelper.ShowMainWindow(this, _appPipName); } catch (Exception) { DialogWindow.ShowDialog(message: "另一个NTMiner正在运行,请手动结束正在运行的NTMiner进程后再次尝试。", title: "alert", icon: "Icon_Error"); Process currentProcess = Process.GetCurrentProcess(); Process[] processes = Process.GetProcessesByName(currentProcess.ProcessName); foreach (var process in processes) { if (process.Id != currentProcess.Id) { NTMiner.Windows.TaskKill.Kill(process.Id); } } } } base.OnStartup(e); BootLog.Log("App.OnStartup end"); BootLog.SyncToDisk(); }
private void Window_Unloaded(object sender, RoutedEventArgs e) { SplashWindow.ShowWindow(); }
private void dgvGeneralSummary_SelectionChanged(object sender, EventArgs e) { lbAllSFSquare.Text = string.Empty; lbAllSFCount.Text = string.Empty; lbAllCFCount.Text = string.Empty; lbOnProdSFSquare.Text = string.Empty; lbOnProdSFCount.Text = string.Empty; lbOnCFCount.Text = string.Empty; lbInProdSFSquare.Text = string.Empty; lbInProdSFCount.Text = string.Empty; lbInCFCount.Text = string.Empty; lbReadySFSquare.Text = string.Empty; lbReadySFCount.Text = string.Empty; lbReadyCFCount.Text = string.Empty; lbAllDecorPogon.Text = string.Empty; lbAllDecorCount.Text = string.Empty; lbOnProdDecorPogon.Text = string.Empty; lbOnProdDecorCount.Text = string.Empty; lbInProdDecorPogon.Text = string.Empty; lbInProdDecorCount.Text = string.Empty; lbReadyDecorPogon.Text = string.Empty; lbReadyDecorCount.Text = string.Empty; if (BatchStatistics == null) { return; } if (dgvGeneralSummary.Rows.Count == 0) { BatchStatistics.ClearProductTables(); return; } bool Profil = BatchProfilCheckBox.Checked; bool TPS = BatchTPSCheckBox.Checked; int FactoryID = 0; decimal AllSquare = 0; decimal OnProdSquare = 0; decimal InProdSquare = 0; decimal ReadySquare = 0; int AllCount = 0; int OnProdCount = 0; int InProdCount = 0; int ReadyCount = 0; int AllCurvedCount = 0; int OnProdCurvedCount = 0; int InProdCurvedCount = 0; int ReadyCurvedCount = 0; decimal AllDecorPogon = 0; decimal OnProdDecorPogon = 0; decimal InProdDecorPogon = 0; decimal ReadyDecorPogon = 0; int AllDecorCount = 0; int OnProdDecorCount = 0; int InProdDecorCount = 0; int ReadyDecorCount = 0; if (Profil && !TPS) { FactoryID = 1; } if (!Profil && TPS) { FactoryID = 2; } if (!Profil && !TPS) { FactoryID = -1; } int GroupType = -1; int MegaBatchID = -1; if (dgvGeneralSummary.SelectedRows.Count != 0 && dgvGeneralSummary.SelectedRows[0].Cells["GroupType"].Value != DBNull.Value) { GroupType = Convert.ToInt32(dgvGeneralSummary.SelectedRows[0].Cells["GroupType"].Value); } if (dgvGeneralSummary.SelectedRows.Count != 0 && dgvGeneralSummary.SelectedRows[0].Cells["MegaBatchID"].Value != DBNull.Value) { MegaBatchID = Convert.ToInt32(dgvGeneralSummary.SelectedRows[0].Cells["MegaBatchID"].Value); } if (NeedSplash) { Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } if (cbtnSimpleFronts.Checked) { BatchStatistics.FilterSimpleFrontsOrders(GroupType, MegaBatchID, FactoryID); BatchStatistics.GetSimpleFrontsInfo(ref AllSquare, ref OnProdSquare, ref InProdSquare, ref ReadySquare, ref AllCount, ref OnProdCount, ref InProdCount, ref ReadyCount); } if (cbtnCurvedFronts.Checked) { BatchStatistics.FilterCurvedFrontsOrders(GroupType, MegaBatchID, FactoryID); BatchStatistics.GetCurvedFrontsInfo(ref AllCurvedCount, ref OnProdCurvedCount, ref InProdCurvedCount, ref ReadyCurvedCount); } if (cbtnDecor.Checked) { BatchStatistics.FilterDecorOrders(GroupType, MegaBatchID, FactoryID); BatchStatistics.GetDecorInfo(ref AllDecorPogon, ref OnProdDecorPogon, ref InProdDecorPogon, ref ReadyDecorPogon, ref AllDecorCount, ref OnProdDecorCount, ref InProdDecorCount, ref ReadyDecorCount); } while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } } else { if (cbtnSimpleFronts.Checked) { BatchStatistics.FilterSimpleFrontsOrders(GroupType, MegaBatchID, FactoryID); BatchStatistics.GetSimpleFrontsInfo(ref AllSquare, ref OnProdSquare, ref InProdSquare, ref ReadySquare, ref AllCount, ref OnProdCount, ref InProdCount, ref ReadyCount); } if (cbtnCurvedFronts.Checked) { BatchStatistics.FilterCurvedFrontsOrders(GroupType, MegaBatchID, FactoryID); BatchStatistics.GetCurvedFrontsInfo(ref AllCurvedCount, ref OnProdCurvedCount, ref InProdCurvedCount, ref ReadyCurvedCount); } if (cbtnDecor.Checked) { BatchStatistics.FilterDecorOrders(GroupType, MegaBatchID, FactoryID); BatchStatistics.GetDecorInfo(ref AllDecorPogon, ref OnProdDecorPogon, ref InProdDecorPogon, ref ReadyDecorPogon, ref AllDecorCount, ref OnProdDecorCount, ref InProdDecorCount, ref ReadyDecorCount); } } NumberFormatInfo nfi1 = new NumberFormatInfo() { CurrencyGroupSeparator = " ", CurrencySymbol = string.Empty, CurrencyDecimalDigits = 2, CurrencyDecimalSeparator = ".", NumberGroupSeparator = " ", NumberDecimalDigits = 2, NumberDecimalSeparator = "," }; NumberFormatInfo nfi2 = new NumberFormatInfo() { NumberGroupSeparator = " ", NumberDecimalSeparator = "," }; lbAllSFSquare.Text = AllSquare.ToString("N", nfi1); lbAllSFCount.Text = AllCount.ToString(); lbAllCFCount.Text = AllCurvedCount.ToString(); lbOnProdSFSquare.Text = OnProdSquare.ToString("N", nfi1); lbOnProdSFCount.Text = OnProdCount.ToString(); lbOnCFCount.Text = OnProdCurvedCount.ToString(); lbInProdSFSquare.Text = InProdSquare.ToString("N", nfi1); lbInProdSFCount.Text = InProdCount.ToString(); lbInCFCount.Text = InProdCurvedCount.ToString(); lbReadySFSquare.Text = ReadySquare.ToString("N", nfi1); lbReadySFCount.Text = ReadyCount.ToString(); lbReadyCFCount.Text = ReadyCurvedCount.ToString(); lbAllDecorPogon.Text = AllDecorPogon.ToString("N", nfi1); lbAllDecorCount.Text = AllDecorCount.ToString(); lbOnProdDecorPogon.Text = OnProdDecorPogon.ToString("N", nfi1); lbOnProdDecorCount.Text = OnProdDecorCount.ToString(); lbInProdDecorPogon.Text = InProdDecorPogon.ToString("N", nfi1); lbInProdDecorCount.Text = InProdDecorCount.ToString(); lbReadyDecorPogon.Text = ReadyDecorPogon.ToString("N", nfi1); lbReadyDecorCount.Text = ReadyDecorCount.ToString(); }
private void AddFolderButton_Click(object sender, EventArgs e) { if (InfiniumFileList.Entered > -1) { if (InfiniumFileList.CheckVisible) { InfiniumFileList.CheckVisible = false; CheckMultipleButton.BringToFront(); } if (InfiniumFiles.CheckInheritedPermission(Security.CurrentUserID, InfiniumFileList.Entered) == false) { InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600); return; } PhantomForm PhantomForm = new PhantomForm(); PhantomForm.Show(); CreateFolderForm CreateFolderForm = new CreateFolderForm(ref InfiniumFiles, ref TopForm); TopForm = CreateFolderForm; CreateFolderForm.ShowDialog(); PhantomForm.Close(); PhantomForm.Dispose(); TopForm = null; if (CreateFolderForm.Canceled) { return; } Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(InfiniumFileList.Top + UpdatePanel.Top, InfiniumFileList.Left + UpdatePanel.Left, InfiniumFileList.Height, InfiniumFileList.Width); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } InfiniumFiles.CreateFolder(InfiniumFileList.Entered, CreateFolderForm.FolderName); InfiniumFiles.EnterFolder(InfiniumFileList.Entered); InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable; InfiniumFileList.EnterInFolder(InfiniumFileList.Entered); CreateFolderForm.Dispose(); bC = true; } }
private void FilterExpedition() { bool Profil = ExpProfilCheckBox.Checked; bool TPS = ExpTPSCheckBox.Checked; int FactoryID = 0; if (Profil && !TPS) { FactoryID = 1; } if (!Profil && TPS) { FactoryID = 2; } if (!Profil && !TPS) { FactoryID = -1; } if (NeedSplash) { NeedSplash = false; Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } StorageStatistics.ShowColumns(ref PrepareFSummaryDG, ref PrepareCurvedFSummaryDG, ref PrepareDSummaryDG, Profil, TPS); StorageStatistics.PrepareOrders(FactoryID); PrepareFSummaryDG.BringToFront(); PrepareCurvedFSummaryDG.BringToFront(); PrepareDSummaryDG.BringToFront(); FrontsPrepareLabel.Visible = true; FrontsZOVLabel.Visible = false; DecorPrepareLabel.Visible = true; DecorZOVLabel.Visible = false; if (!StorageStatistics.HasCurvedFronts) { StorageStatistics.ClearCurvedFrontsOrders(2); } if (!StorageStatistics.HasFronts) { StorageStatistics.ClearFrontsOrders(2); } if (!StorageStatistics.HasDecor) { StorageStatistics.ClearDecorOrders(2); } ExpCurvedFrontsInfo(); ExpFrontsInfo(); ExpDecorInfo(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } NeedSplash = true; } }
private void UploadFileIButton_Click(object sender, EventArgs e) { if (InfiniumFileList.Selected == -1) { return; } if (InfiniumFiles.CheckInheritedPermission(Security.CurrentUserID, InfiniumFileList.Entered) == false) { InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600); return; } if (InfiniumFileList.CheckVisible) { InfiniumFileList.CheckVisible = false; CheckMultipleButton.BringToFront(); } UploadFileDialog.Multiselect = true; if (UploadFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (InfiniumFiles.CheckFileExist(UploadFileDialog.FileNames, InfiniumFileList.Entered) == true)//file exist { InfiniumTips.ShowTip(this, 50, 85, "Один или несколько файлов уже существуют в папке", 2600); return; } PhantomForm PhantomForm = new PhantomForm(); PhantomForm.Show(); UploadFileForm UploadFileForm = new UploadFileForm(ref InfiniumFiles.FM, ref InfiniumFiles, UploadFileDialog.FileNames, InfiniumFileList.Entered, ref TopForm); TopForm = UploadFileForm; UploadFileForm.ShowDialog(); if (UploadFileForm.bOk == 0) { InfiniumTips.ShowTip(this, 50, 85, "Отсутствует файл либо нет доступа к интернет", 5000); } PhantomForm.Close(); PhantomForm.Dispose(); TopForm = null; UploadFileDialog.Dispose(); Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(InfiniumFileList.Top + UpdatePanel.Top, InfiniumFileList.Left + UpdatePanel.Left, InfiniumFileList.Height, InfiniumFileList.Width); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } InfiniumFiles.EnterFolder(InfiniumFileList.Entered); InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable; bC = true; } }
protected override void OnStartup(StartupEventArgs e) { RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; try { appMutex = new Mutex(true, s_appPipName, out createdNew); } catch (Exception) { createdNew = false; } if (createdNew) { Vms.AppStatic.IsMinerClient = false; SplashWindow splashWindow = new SplashWindow(); splashWindow.Show(); NotiCenterWindow.Instance.Show(); NTMinerRoot.AppName = "开源矿工群控客户端"; NTMinerServices.NTMinerServicesUtil.RunNTMinerServices(); NTMinerRoot.Current.Init(() => { NTMinerRoot.KernelDownloader = new KernelDownloader(); UIThread.Execute(() => { splashWindow?.Close(); bool?result = true; if (Ip.Util.IsInnerIp(NTMinerRegistry.GetControlCenterHost())) { SingleUser.LoginName = "innerip"; SingleUser.SetPasswordSha1("123"); result = true; } else if (string.IsNullOrEmpty(SingleUser.LoginName) || string.IsNullOrEmpty(SingleUser.PasswordSha1)) { LoginWindow loginWindow = new LoginWindow(); result = loginWindow.ShowDialog(); } if (result.HasValue && result.Value) { ChartsWindow.ShowWindow(); System.Drawing.Icon icon = new System.Drawing.Icon(GetResourceStream(new Uri("pack://application:,,,/MinerStudio;component/logo.ico")).Stream); AppHelper.NotifyIcon = ExtendedNotifyIcon.Create(icon, "群控客户端", isMinerStudio: true); #region 处理显示主界面命令 VirtualRoot.Window <ShowMainWindowCommand>("处理显示主界面命令", LogEnum.None, action: message => { Dispatcher.Invoke((ThreadStart)ChartsWindow.ShowWindow); }); #endregion HttpServer.Start($"http://localhost:{WebApiConst.MinerStudioPort}"); AppHelper.RemoteDesktop = MsRdpRemoteDesktop.OpenRemoteDesktop; } }); }); VirtualRoot.Window <CloseNTMinerCommand>("处理关闭群控客户端命令", LogEnum.UserConsole, action: message => { UIThread.Execute(() => { if (MainWindow != null) { MainWindow.Close(); } Shutdown(); Environment.Exit(0); }); }); } else { try { AppHelper.ShowMainWindow(this, MinerServer.NTMinerAppType.MinerStudio); } catch (Exception) { DialogWindow.ShowDialog(message: "另一个NTMiner正在运行,请手动结束正在运行的NTMiner进程后再次尝试。", title: "alert", icon: "Icon_Error"); Process currentProcess = Process.GetCurrentProcess(); Process[] processes = Process.GetProcessesByName(currentProcess.ProcessName); foreach (var process in processes) { if (process.Id != currentProcess.Id) { NTMiner.Windows.TaskKill.Kill(process.Id); } } } } base.OnStartup(e); }
private void kryptonCheckSet2_CheckedButtonChanged(object sender, EventArgs e) { if (IncomeMonth == null) { return; } if (kryptonCheckSet2.CheckedButton.Name == "AllCheckButton") { Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } IncomeMonth.Factory = 0; IncomeMonth.Fill(); IncomeChart.RefreshData(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } } if (kryptonCheckSet2.CheckedButton.Name == "ProfilCheckButton") { Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } IncomeMonth.Factory = 1; IncomeMonth.Fill(); IncomeChart.RefreshData(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } } if (kryptonCheckSet2.CheckedButton.Name == "TPSCheckButton") { Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } IncomeMonth.Factory = 2; IncomeMonth.Fill(); IncomeChart.RefreshData(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } } }
//private Computer computer; public MainWindow() { try { SplashWindow.Loading("CPU"); cpu = new Cpu(); if (cpu.info.family.Equals(Cpu.Family.UNSUPPORTED)) { throw new ApplicationException("CPU is not supported."); } else if (cpu.info.codeName.Equals(Cpu.CodeName.Unsupported)) { throw new ApplicationException("CPU model is not supported.\nPlease run a debug report and send to the developer."); } IconSource = GetIcon("pack://application:,,,/ZenTimings;component/Resources/ZenTimings.ico", 16); InitializeComponent(); SplashWindow.Loading("Memory modules"); ReadMemoryModulesInfo(); SplashWindow.Loading("Timings"); // Read from first enabled DCT if (modules.Count > 0) { ReadTimings(modules[0].DctOffset); } else { ReadTimings(); } if (settings.AdvancedMode) { PowerCfgTimer.Interval = TimeSpan.FromMilliseconds(2000); PowerCfgTimer.Tick += PowerCfgTimer_Tick; SplashWindow.Loading("Waiting for power table"); if (WaitForPowerTable()) { SplashWindow.Loading("Reading power table"); // refresh the table again, to avoid displaying initial fclk, mclk and uclk values, // which seem to be a little off when transferring the table for the "first" time, // after an idle period RefreshPowerTable(); } else { SplashWindow.Loading("Power table error!"); } SplashWindow.Loading("Plugins"); SplashWindow.Loading("SVI2 Plugin"); plugins.Add(new SVI2Plugin(cpu)); ReadSVI(); /*computer = new Computer() * { * //CPUEnabled = true, * //RAMEnabled = true, * MainboardEnabled = true, * //FanControllerEnabled = true, * }; * * computer.Open();*/ if (!AsusWmi.Init()) { AsusWmi.Dispose(); AsusWmi = null; } StartAutoRefresh(); SplashWindow.Loading("Memory controller"); BMC = new BiosMemController(); ReadMemoryConfig(); } SplashWindow.Loading("Done"); DataContext = new { timings = MEMCFG, cpu.powerTable, WMIPresent = !compatMode, settings }; } catch (Exception ex) { HandleError(ex.Message); ExitApplication(); } }
static void Main() { App app = new App(); Assembly assembly = typeof(App).Assembly; SplashWindow splash = new SplashWindow("СЦ Тольятти", "Ряполов А.Н.", assembly); splash.Show(); DateTime dtStartSplash = DateTime.Now; // Проверка наличия рабочей директории if (!Directory.Exists(ProgramSettings.WorkFolder)) { Directory.CreateDirectory(ProgramSettings.WorkFolder); } // Вызов окна настроек подключения if (!File.Exists(ProgramSettings.WorkFolder + "conncfg.plg")) { //ConnectWindow connWindow = new ConnectWindow(); //if(!(bool)connWindow.ShowDialog()) //{ // connWindow.Close(); // Environment.Exit(0); // return; //} //connWindow.Close(); AddConnectionKeyWindow keyWindow = new AddConnectionKeyWindow(); if (!(bool)keyWindow.ShowDialog()) { keyWindow.Close(); Environment.Exit(0); return; } keyWindow.Close(); // Подключение к тестовой БД //#if (DEBUG) //ProgramSettings.Server = "remotemysql.com"; //ProgramSettings.DB = "ZxIqMwxdJi"; //ProgramSettings.AdminLogin = "******"; //ProgramSettings.AdminPassword = Criptex.Cript("kmO45otLo8"); //#endif } // Получение настроек подключения else { try { using (FileStream fs = new FileStream(ProgramSettings.WorkFolder + "conncfg.plg", FileMode.Open)) { BinaryFormatter serializer = new BinaryFormatter(); SaveConnectionData saveData = (SaveConnectionData)serializer.Deserialize(fs); ProgramSettings.ConnectionString = saveData.ConnectionString; //ProgramSettings.Server = Criptex.UnCript(saveData.Server); //ProgramSettings.DB = Criptex.UnCript(saveData.DB); //ProgramSettings.AdminLogin = Criptex.UnCript(saveData.AdminLogin); //ProgramSettings.AdminPassword = saveData.AdminPassword; } //// Подключение к тестовой БД //#if (DEBUG) // ProgramSettings.Server = "remotemysql.com"; // ProgramSettings.DB = "ZxIqMwxdJi"; // ProgramSettings.AdminLogin = "******"; // ProgramSettings.AdminPassword = Criptex.Cript("kmO45otLo8"); //#endif MySqlConnection connection = new MySqlConnection(Criptex.UnCript(ProgramSettings.ConnectionString)); connection.Open(); connection.Close(); connection.Dispose(); connection = null; } catch { // Запрос настроек подключения //ConnectWindow connWindow = new ConnectWindow(); //if (!(bool)connWindow.ShowDialog()) //{ // connWindow.Close(); // Environment.Exit(0); // return; //} //connWindow.Close(); AddConnectionKeyWindow keyWindow = new AddConnectionKeyWindow(); if (!(bool)keyWindow.ShowDialog()) { keyWindow.Close(); Environment.Exit(0); return; } keyWindow.Close(); } } // Запуск окна авторизации AuthentificateWindow authWindow = new AuthentificateWindow(); if (!(bool)authWindow.ShowDialog()) { authWindow.Close(); Environment.Exit(0); return; } ProgramSettings.CurrentUser.Login = authWindow.UserName; authWindow.Close(); ProgramSettings.CurrentUser.GetBaseDataByLogin(); ProgramSettings.CurrentUser.GetPublicDataByID(); GetSettings(); Windows.MainWin.MainWindow mainWindow = new Windows.MainWin.MainWindow(splash, dtStartSplash); Current.MainWindow = mainWindow; Current.ShutdownMode = ShutdownMode.OnMainWindowClose; app.Run(mainWindow); }
public static void Main(string[] args) { /* Initialize our catalog */ // Catalog.Init (Defines.Name, Defines.LocaleDir); /* Process our args */ options = new GtkMeshworkOptions(); options.ProcessArgs(args); getPlatform().SetProcessName("meshwork-gtk"); /* Initialize the GTK application */ Gtk.Application.Init(); if (!System.Diagnostics.Debugger.IsAttached) { /* If we crash, attempt to log the error */ GLib.ExceptionManager.UnhandledException += UnhandledGLibExceptionHandler; AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; } //XXX: Implement Gunique code here! splashWindow = new SplashWindow(); splashWindow.Show(); /* Load settings */ if (options.ConfigPath != null) { LoggingService.LogDebug("Using config dir: " + options.ConfigPath); Settings.OverrideConfigPath(options.ConfigPath); } tmpSettings = Settings.ReadSettings(); // First run, create initial settings. if (tmpSettings == null) { tmpSettings = new Settings { // FIXME // NickName = core.Platform.UserName, // RealName = core.Platform.RealName, IncompleteDownloadDir = Environment.GetFolderPath(Environment.SpecialFolder.Desktop), CompletedDownloadDir = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) }; tmpSettings.FirstRun = true; } /* Load Icons */ Gtk.Window.DefaultIconList = new Gdk.Pixbuf[] { new Gdk.Pixbuf(null, "Meshwork.Client.GtkClient.tray_icon.png") }; // Windows specific. Override stock icons to use embeded files. var sizes = new [] { 16, 22, 24, 34 }; var iconNames = new[] { "application-exit", "application-x-executable", "audio-x-generic", "computer", "dialog-error", "dialog-information", "dialog-password", "gtk-preferences", "dialog-question", "dialog-warning", "folder", "go-down", "go-home", "go-next", "go-previous", "go-up", "image-x-generic", "internet-group-chat", "list-add", "list-remove", "mail-attachment", "mail_generic", "mail-message-new", "mail-signed-verified", "network-transmit-receive", "stock_channel", "stock_internet", "system-search", "text-x-generic", "user-home", "video-x-generic", "view-refresh", "x-office-document" }; foreach (var size in sizes) { foreach (var iconName in iconNames) { if (Environment.OSVersion.Platform != PlatformID.Unix || !IconTheme.Default.HasIcon(iconName) || !IconTheme.Default.GetIconSizes(iconName).Contains(size)) { var pixbuf = Gui.LoadIconFromResource(iconName, size); if (pixbuf != null) { Gtk.IconTheme.AddBuiltinIcon(iconName, size, pixbuf); } else { LoggingService.LogWarning("Missing embeded icon: {0} ({1}x{1})", iconName, size); } } } } /* Start the event loop */ GLib.Idle.Add(new GLib.IdleHandler(FinishLoading)); Gtk.Application.Run(); }
private void FilterExpedition() { bool Profil = ExpProfilCheckBox.Checked; bool TPS = ExpTPSCheckBox.Checked; int FactoryID = 0; if (Profil && !TPS) { FactoryID = 1; } if (!Profil && TPS) { FactoryID = 2; } if (!Profil && !TPS) { FactoryID = -1; } if (NeedSplash) { NeedSplash = false; Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } ExpeditionStatistics.ShowColumns(ref MFSummaryDG, ref MDSummaryDG, Profil, TPS, bExpSummaryClient); ExpeditionStatistics.FMarketingOrders(FactoryID, -1); ExpeditionStatistics.DMarketingOrders(FactoryID, -1); if (!ExpClientSummaryCheckBox.Checked) { ExpeditionStatistics.MarketingSummary(FactoryID); } else { ExpeditionStatistics.ClientSummary(FactoryID); } if (!ExpeditionStatistics.HasFronts) { ExpeditionStatistics.ClearFrontsOrders(); } if (!ExpeditionStatistics.HasDecor) { ExpeditionStatistics.ClearDecorOrders(); } ExpFrontsInfo(); ExpDecorInfo(); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } NeedSplash = true; } }
private void kryptonContextMenuItem4_Click(object sender, EventArgs e) { int ClientID = Convert.ToInt32(((DataRowView)Clients.ClientsBindingSource.Current).Row["ClientID"]); decimal EURRUBCurrency = 0; decimal USDRUBCurrency = 0; decimal EURUSDCurrency = 0; decimal EURBYRCurrency = 0; bool fixedPaymentRate = false; Clients.GetFixedPaymentRate(ClientID, DateTime.Now, ref fixedPaymentRate, ref EURUSDCurrency, ref EURRUBCurrency, ref EURBYRCurrency); if (fixedPaymentRate) { USDRUBCurrency = 1; } else { EURRUBCurrency = 0; USDRUBCurrency = 0; EURUSDCurrency = 0; EURBYRCurrency = 0; Clients.CBRDailyRates(DateTime.Now, ref EURRUBCurrency, ref USDRUBCurrency); Clients.GetDateRates(DateTime.Now, ref EURBYRCurrency); if (USDRUBCurrency != 0) { EURUSDCurrency = Decimal.Round(EURRUBCurrency / USDRUBCurrency, 4, MidpointRounding.AwayFromZero); } } decimal Rate = EURBYRCurrency; Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Создание Excel.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } string FileName = "Прейскурант " + ((DataRowView)Clients.ClientsBindingSource.Current).Row["ClientName"].ToString(); decimal PriceGroup = Convert.ToDecimal(((DataRowView)Clients.ClientsBindingSource.Current).Row["PriceGroup"]); HSSFWorkbook hssfworkbook; hssfworkbook = new HSSFWorkbook(); FileName = FileName.Replace('/', '-'); FileName = FileName.Replace('\"', '\''); ClientFrontsPrice obj1 = new ClientFrontsPrice(Rate); ClientDecorPrice obj = new ClientDecorPrice(Rate); obj1.CreateReport(ref hssfworkbook, ClientID, PriceGroup); obj.CreateReport(ref hssfworkbook, ClientID, PriceGroup); string tempFolder = System.Environment.GetEnvironmentVariable("TEMP"); FileInfo file = new FileInfo(tempFolder + @"\" + FileName + ".xls"); int j = 1; while (file.Exists == true) { file = new FileInfo(tempFolder + @"\" + FileName + "(" + j++ + ").xls"); } FileStream NewFile = new FileStream(file.FullName, FileMode.Create); hssfworkbook.Write(NewFile); NewFile.Close(); System.Diagnostics.Process.Start(file.FullName); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } }
private void ItemsDataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (!StorageItemsManager.EditItem() || CreateStoreDetail || ItemsDataGrid.Columns[e.ColumnIndex].Name == "CheckBoxColumn") { return; } int TechStoreID = 0; if (ItemsDataGrid.SelectedRows.Count > 0 && ItemsDataGrid.SelectedRows[0].Cells["TechStoreID"].Value != DBNull.Value) { TechStoreID = Convert.ToInt32(ItemsDataGrid.SelectedRows[0].Cells["TechStoreID"].Value); } if (TechStoreID == 0) { return; } string TechStoreName = string.Empty; string TechStoreSubGroupName = string.Empty; string SubGroupNotes = string.Empty; string SubGroupNotes1 = string.Empty; string SubGroupNotes2 = string.Empty; if (ItemsDataGrid.SelectedRows.Count > 0 && ItemsDataGrid.SelectedRows[0].Cells["TechStoreName"].Value != DBNull.Value) { TechStoreName = ItemsDataGrid.SelectedRows[0].Cells["TechStoreName"].Value.ToString(); } if (SubGroupsDataGrid.SelectedRows.Count > 0 && SubGroupsDataGrid.SelectedRows[0].Cells["Notes"].Value != DBNull.Value) { SubGroupNotes = SubGroupsDataGrid.SelectedRows[0].Cells["Notes"].Value.ToString(); } if (SubGroupsDataGrid.SelectedRows.Count > 0 && SubGroupsDataGrid.SelectedRows[0].Cells["Notes1"].Value != DBNull.Value) { SubGroupNotes1 = SubGroupsDataGrid.SelectedRows[0].Cells["Notes1"].Value.ToString(); } if (SubGroupsDataGrid.SelectedRows.Count > 0 && SubGroupsDataGrid.SelectedRows[0].Cells["TechStoreSubGroupName"].Value != DBNull.Value) { TechStoreSubGroupName = SubGroupsDataGrid.SelectedRows[0].Cells["TechStoreSubGroupName"].Value.ToString(); } if (SubGroupsDataGrid.SelectedRows.Count > 0 && SubGroupsDataGrid.SelectedRows[0].Cells["Notes2"].Value != DBNull.Value) { SubGroupNotes2 = SubGroupsDataGrid.SelectedRows[0].Cells["Notes2"].Value.ToString(); } Thread T = new Thread(delegate() { SplashWindow.CreateSplash(); }); T.Start(); while (!SplashForm.bCreated) { ; } AddNewTechStoreItemForm AddNewStoreItemForm = new AddNewTechStoreItemForm(ref StorageItemsManager, TechStoreName, TechStoreSubGroupName, SubGroupNotes, SubGroupNotes1, SubGroupNotes2, bPrintLabels); TopForm = AddNewStoreItemForm; AddNewStoreItemForm.ShowDialog(); AddNewStoreItemForm.Close(); AddNewStoreItemForm.Dispose(); TopForm = null; SubGroupsDataGrid_SelectionChanged(null, null); StorageItemsManager.MoveToStore(TechStoreID); }
static Globals() { Configuration = new ConfigManager(); SplashScreen = new SplashWindow(); }
private void ConditionOrdersFilter_Click(object sender, EventArgs e) { bool OnAgreementOrders = rbtnOnAgreementOrders.Checked; bool AgreedOrders = rbtnAgreedOrders.Checked; bool OnProductionOrders = rbtnOnProduction.Checked; bool InProductionOrders = rbtnInProduction.Checked; decimal FrontCost = 0; decimal FrontSquare = 0; int FrontsCount = 0; int CurvedCount = 0; decimal DecorPogon = 0; decimal DecorCost = 0; int DecorCount = 0; DateTime Monday = GetMonday(CurrentWeekNumber); DateTime Wednesday = GetWednesday(CurrentWeekNumber); DateTime Friday = GetFriday(CurrentWeekNumber); FMondayLabel.Text = CurrentWeekNumber + " неделя\r\n" + "Понедельник " + Monday.ToString("dd.MM.yyyy HH:mm"); FWednesdayLabel.Text = CurrentWeekNumber + " неделя\r\n" + "Среда " + Wednesday.ToString("dd.MM.yyyy HH:mm"); FFridayLabel.Text = CurrentWeekNumber + " неделя\r\n" + "Пятница " + Friday.ToString("dd.MM.yyyy HH:mm"); DMondayLabel.Text = CurrentWeekNumber + " неделя\r\n" + "Понедельник " + Monday.ToString("dd.MM.yyyy HH:mm"); DWednesdayLabel.Text = CurrentWeekNumber + " неделя\r\n" + "Среда " + Wednesday.ToString("dd.MM.yyyy HH:mm"); DFridayLabel.Text = CurrentWeekNumber + " неделя\r\n" + "Пятница " + Friday.ToString("dd.MM.yyyy HH:mm"); int FactoryID = 0; if (CProfilCheckBox.Checked && !CTPSCheckBox.Checked) { FactoryID = 1; } if (!CProfilCheckBox.Checked && CTPSCheckBox.Checked) { FactoryID = 2; } if (!CProfilCheckBox.Checked && !CTPSCheckBox.Checked) { FactoryID = -1; } if (NeedSplash) { NeedSplash = false; Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Загрузка данных с сервера.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } ConditionOrdersStatistics.ClearOrders(); if (Monday < DateTime.Now && MondayCB.Checked) { if (OnAgreementOrders) { ConditionOrdersStatistics.GetOnAgreementOrders(Monday, FactoryID); } if (AgreedOrders) { ConditionOrdersStatistics.GetAgreedOrders(Monday, FactoryID); } if (OnProductionOrders) { ConditionOrdersStatistics.GetOnProductionOrders(Monday, FactoryID); } if (InProductionOrders) { ConditionOrdersStatistics.GetInProductionOrders(Monday, FactoryID); } } MondayFrontsDG.DataSource = new DataView(ConditionOrdersStatistics.FrontsSummaryDT.Copy()); MondayDecorProductsDG.DataSource = new DataView(ConditionOrdersStatistics.DecorProductsSummaryDT.Copy()); MondayDecorItemsDG.DataSource = new DataView(ConditionOrdersStatistics.DecorItemsSummaryDT.Copy()); ((DataView)MondayFrontsDG.DataSource).Sort = "Front, Square DESC"; ((DataView)MondayDecorProductsDG.DataSource).Sort = "DecorProduct, Measure ASC, Count DESC"; ((DataView)MondayDecorItemsDG.DataSource).Sort = "DecorItem, Count DESC"; FrontCost = 0; FrontSquare = 0; FrontsCount = 0; CurvedCount = 0; MondayFrontsSquareLabel.Text = string.Empty; MondayFrontsCostLabel.Text = string.Empty; MondayFrontsCountLabel.Text = string.Empty; MondayCurvedCountLabel.Text = string.Empty; ConditionOrdersStatistics.GetFrontsInfo(ref FrontSquare, ref FrontCost, ref FrontsCount, ref CurvedCount); MondayFrontsSquareLabel.Text = FrontSquare.ToString("N", nfi2); MondayFrontsCostLabel.Text = FrontCost.ToString("N", nfi2); MondayFrontsCountLabel.Text = FrontsCount.ToString(); MondayCurvedCountLabel.Text = CurvedCount.ToString(); DecorPogon = 0; DecorCost = 0; DecorCount = 0; MondayDecorPogonLabel.Text = string.Empty; MondayDecorCostLabel.Text = string.Empty; MondayDecorCountLabel.Text = string.Empty; ConditionOrdersStatistics.GetDecorInfo(ref DecorPogon, ref DecorCost, ref DecorCount); MondayDecorPogonLabel.Text = DecorPogon.ToString("N", nfi2); MondayDecorCostLabel.Text = DecorCost.ToString("N", nfi2); MondayDecorCountLabel.Text = DecorCount.ToString(); ConditionOrdersStatistics.ClearOrders(); if (Wednesday < DateTime.Now && WednesdayCB.Checked) { if (OnAgreementOrders) { ConditionOrdersStatistics.GetOnAgreementOrders(Wednesday, FactoryID); } if (AgreedOrders) { ConditionOrdersStatistics.GetAgreedOrders(Wednesday, FactoryID); } if (OnProductionOrders) { ConditionOrdersStatistics.GetOnProductionOrders(Wednesday, FactoryID); } if (InProductionOrders) { ConditionOrdersStatistics.GetInProductionOrders(Wednesday, FactoryID); } } WednesdayFrontsDG.DataSource = new DataView(ConditionOrdersStatistics.FrontsSummaryDT.Copy()); WednesdayDecorProductsDG.DataSource = new DataView(ConditionOrdersStatistics.DecorProductsSummaryDT.Copy()); WednesdayDecorItemsDG.DataSource = new DataView(ConditionOrdersStatistics.DecorItemsSummaryDT.Copy()); ((DataView)WednesdayFrontsDG.DataSource).Sort = "Front, Square DESC"; ((DataView)WednesdayDecorProductsDG.DataSource).Sort = "DecorProduct, Measure ASC, Count DESC"; ((DataView)WednesdayDecorItemsDG.DataSource).Sort = "DecorItem, Count DESC"; FrontCost = 0; FrontSquare = 0; FrontsCount = 0; CurvedCount = 0; WednesdayFrontsSquareLabel.Text = string.Empty; WednesdayFrontsCostLabel.Text = string.Empty; WednesdayFrontsCountLabel.Text = string.Empty; WednesdayCurvedCountLabel.Text = string.Empty; ConditionOrdersStatistics.GetFrontsInfo(ref FrontSquare, ref FrontCost, ref FrontsCount, ref CurvedCount); WednesdayFrontsSquareLabel.Text = FrontSquare.ToString("N", nfi2); WednesdayFrontsCostLabel.Text = FrontCost.ToString("N", nfi2); WednesdayFrontsCountLabel.Text = FrontsCount.ToString(); WednesdayCurvedCountLabel.Text = CurvedCount.ToString(); DecorPogon = 0; DecorCost = 0; DecorCount = 0; WednesdayDecorPogonLabel.Text = string.Empty; WednesdayDecorCostLabel.Text = string.Empty; WednesdayDecorCountLabel.Text = string.Empty; ConditionOrdersStatistics.GetDecorInfo(ref DecorPogon, ref DecorCost, ref DecorCount); WednesdayDecorPogonLabel.Text = DecorPogon.ToString("N", nfi2); WednesdayDecorCostLabel.Text = DecorCost.ToString("N", nfi2); WednesdayDecorCountLabel.Text = DecorCount.ToString(); ConditionOrdersStatistics.ClearOrders(); if (Friday < DateTime.Now && FridayCB.Checked) { if (OnAgreementOrders) { ConditionOrdersStatistics.GetOnAgreementOrders(Friday, FactoryID); } if (AgreedOrders) { ConditionOrdersStatistics.GetAgreedOrders(Friday, FactoryID); } if (OnProductionOrders) { ConditionOrdersStatistics.GetOnProductionOrders(Friday, FactoryID); } if (InProductionOrders) { ConditionOrdersStatistics.GetInProductionOrders(Friday, FactoryID); } } FridayFrontsDG.DataSource = new DataView(ConditionOrdersStatistics.FrontsSummaryDT.Copy()); FridayDecorProductsDG.DataSource = new DataView(ConditionOrdersStatistics.DecorProductsSummaryDT.Copy()); FridayDecorItemsDG.DataSource = new DataView(ConditionOrdersStatistics.DecorItemsSummaryDT.Copy()); ((DataView)FridayFrontsDG.DataSource).Sort = "Front, Square DESC"; ((DataView)FridayDecorProductsDG.DataSource).Sort = "DecorProduct, Measure ASC, Count DESC"; ((DataView)FridayDecorItemsDG.DataSource).Sort = "DecorItem, Count DESC"; FrontCost = 0; FrontSquare = 0; FrontsCount = 0; CurvedCount = 0; FridayFrontsSquareLabel.Text = string.Empty; FridayFrontsCostLabel.Text = string.Empty; FridayFrontsCountLabel.Text = string.Empty; FridayCurvedCountLabel.Text = string.Empty; ConditionOrdersStatistics.GetFrontsInfo(ref FrontSquare, ref FrontCost, ref FrontsCount, ref CurvedCount); FridayFrontsSquareLabel.Text = FrontSquare.ToString("N", nfi2); FridayFrontsCostLabel.Text = FrontCost.ToString("N", nfi2); FridayFrontsCountLabel.Text = FrontsCount.ToString(); FridayCurvedCountLabel.Text = CurvedCount.ToString(); DecorPogon = 0; DecorCost = 0; DecorCount = 0; FridayDecorPogonLabel.Text = string.Empty; FridayDecorCostLabel.Text = string.Empty; FridayDecorCountLabel.Text = string.Empty; ConditionOrdersStatistics.GetDecorInfo(ref DecorPogon, ref DecorCost, ref DecorCount); FridayDecorPogonLabel.Text = DecorPogon.ToString("N", nfi2); FridayDecorCostLabel.Text = DecorCost.ToString("N", nfi2); FridayDecorCountLabel.Text = DecorCount.ToString(); MondayDecorProductsDG_SelectionChanged(null, null); WednesdayDecorProductsDG_SelectionChanged(null, null); FridayDecorProductsDG_SelectionChanged(null, null); while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } NeedSplash = true; } else { } }
public SDWindow(SplashWindow.SplashShowing SplashShowing) { GlowBrush = Application.Current.TryFindResource("MainBrush") as SolidColorBrush; Style st=new Style(){ TargetType=typeof(MahApps.Metro.Controls.MetroTabItem)}; st.Setters.Add(new Setter(MahApps.Metro.Controls.ControlsHelper.HeaderFontSizeProperty, (double)15)); this.Resources.Add(typeof(MahApps.Metro.Controls.MetroTabItem), st); #region starting the application Onion.SystemR.SystemRequirements.confirmDotNet45Installed(); SmartDesk.SplashWindow splash = new SmartDesk.SplashWindow(); splash.splashShowing += SplashShowing; splash.Run(); splash.ShowDialog(); string[] cmd_args = Environment.GetCommandLineArgs(); string username = cmd_args.FirstOrDefault(x => x.StartsWith("username="******"password=")); if (username != null) username = username.Substring(9); if (password != null) password = password.Substring(9); if (!current_user.logIn(username, password)) { SmartDesk.AuthenticationWindow authe_window = new SmartDesk.AuthenticationWindow(); authe_window.ShowDialog(); current_user = authe_window.user; } #endregion #region initialize command bindings NewCommandBinding = new CommandBinding(NewCommand, NewCommand_Executed, NewCommand_CanExecute); this.CommandBindings.Add(NewCommandBinding); RefreshCommandBinding = new CommandBinding(RefreshCommand, RefreshCommand_Executed, RefreshCommand_CanExecute); this.CommandBindings.Add(RefreshCommandBinding); SaveCommandBinding = new CommandBinding(SaveCommand, SaveCommand_Executed, SaveCommand_CanExecute); this.CommandBindings.Add(SaveCommandBinding); PrintCommandBinding = new CommandBinding(PrintCommand, PrintCommand_Executed,PrintCommand_CanExecute); this.CommandBindings.Add(PrintCommandBinding); OptionsCommandBinding = new CommandBinding(OptionsCommand, OptionsCommand_Executed); this.CommandBindings.Add(OptionsCommandBinding); ManageUserCommandBinding = new CommandBinding(ManageUserCommand, ManageUserCommand_Executed); this.CommandBindings.Add(ManageUserCommandBinding); ManageDatabaseCommandBinding = new CommandBinding(ManageDatabaseCommand, ManageDatabaseCommand_Executed); this.CommandBindings.Add(ManageDatabaseCommandBinding); ManualCommandBinding = new CommandBinding(ManualCommand, ManualCommand_Executed); this.CommandBindings.Add(ManualCommandBinding); QuestionCommandBinding = new CommandBinding(QuestionCommand, QuestionCommand_Executed); this.CommandBindings.Add(QuestionCommandBinding); ForumsCommandBinding = new CommandBinding(ForumsCommand, ForumsCommand_Executed); this.CommandBindings.Add(ForumsCommandBinding); SendSmileCommandBinding = new CommandBinding(SendSmileCommand, SendSmileCommand_Executed); this.CommandBindings.Add(SendSmileCommandBinding); SendFrownCommandBinding = new CommandBinding(SendFrownCommand, SendFrownCommand_Executed); this.CommandBindings.Add(SendFrownCommandBinding); ReportBugCommandBinding = new CommandBinding(ReportBugCommand, ReportBugCommand_Executed); this.CommandBindings.Add(ReportBugCommandBinding); LicenseCommandBinding = new CommandBinding(LicenseCommand, LicenseCommand_Executed); this.CommandBindings.Add(LicenseCommandBinding); AboutCommandBinding = new CommandBinding(AboutCommand, AboutCommand_Executed); this.CommandBindings.Add(AboutCommandBinding); ExitCommandBinding = new CommandBinding(ExitCommand, ExitCommand_Executed); this.CommandBindings.Add(ExitCommandBinding); PrintManyCommandBinding = new CommandBinding(PrintManyCommand); this.CommandBindings.Add(PrintManyCommandBinding); #endregion }
private void Window_Loaded(object sender, RoutedEventArgs e) { SplashWindow.HideWindow(); }
private void cmiSaveDyeingAssignments_Click(object sender, EventArgs e) { Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Сохранение данных.\r\nПодождите..."); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } int TechCatalogOperationsGroupID = 0; if (dgvOperationsGroups.SelectedRows.Count != 0 && dgvOperationsGroups.SelectedRows[0].Cells["TechCatalogOperationsGroupID"].Value != DBNull.Value) { TechCatalogOperationsGroupID = Convert.ToInt32(dgvOperationsGroups.SelectedRows[0].Cells["TechCatalogOperationsGroupID"].Value); } ControlAssignmentsManager.TechCatalogOperationsGroupID = TechCatalogOperationsGroupID; if (ControlAssignmentsManager.NewAssignment) { switch (ControlAssignmentsManager.GroupType) { case 0: foreach (int item in ControlAssignmentsManager.MainOrders) { int MainOrderID = item; ControlAssignmentsManager.CreateDyeingAssignment(TechCatalogOperationsGroupID); ControlAssignmentsManager.SaveDyeingAssignments(); ControlAssignmentsManager.UpdateDyeingAssignments(From, To); FrontsOrdersManager.SaveZOV(ControlAssignmentsManager, MainOrderID); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.UpdateDyeingCarts(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.RemoveDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID); for (int i = 0; i < dgvOperationsDetail.Rows.Count; i++) { int TechCatalogOperationsDetailID = Convert.ToInt32(dgvOperationsDetail.Rows[i].Cells["TechCatalogOperationsDetailID"].Value); ControlAssignmentsManager.CreateDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID, TechCatalogOperationsDetailID); } ControlAssignmentsManager.SaveDyeingAssignmentBarcodes(); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); } break; case 1: ControlAssignmentsManager.CreateDyeingAssignment(TechCatalogOperationsGroupID); ControlAssignmentsManager.SaveDyeingAssignments(); ControlAssignmentsManager.UpdateDyeingAssignments(From, To); ControlAssignmentsManager.SaveDyeingBatch(); FrontsOrdersManager.SaveMarketingReatailFronts(ControlAssignmentsManager); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.UpdateDyeingCarts(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.RemoveDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID); for (int i = 0; i < dgvOperationsDetail.Rows.Count; i++) { int TechCatalogOperationsDetailID = Convert.ToInt32(dgvOperationsDetail.Rows[i].Cells["TechCatalogOperationsDetailID"].Value); ControlAssignmentsManager.CreateDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID, TechCatalogOperationsDetailID); } ControlAssignmentsManager.SaveDyeingAssignmentBarcodes(); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); break; case 2: ControlAssignmentsManager.CreateDyeingAssignment(TechCatalogOperationsGroupID); ControlAssignmentsManager.SaveDyeingAssignments(); ControlAssignmentsManager.UpdateDyeingAssignments(From, To); FrontsOrdersManager.SaveBatchFronts(ControlAssignmentsManager); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.UpdateDyeingCarts(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.RemoveDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID); for (int i = 0; i < dgvOperationsDetail.Rows.Count; i++) { int TechCatalogOperationsDetailID = Convert.ToInt32(dgvOperationsDetail.Rows[i].Cells["TechCatalogOperationsDetailID"].Value); ControlAssignmentsManager.CreateDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID, TechCatalogOperationsDetailID); } ControlAssignmentsManager.SaveDyeingAssignmentBarcodes(); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); break; case 3: break; case 4: ControlAssignmentsManager.CreateDyeingAssignment(TechCatalogOperationsGroupID); ControlAssignmentsManager.SaveDyeingAssignments(); ControlAssignmentsManager.UpdateDyeingAssignments(From, To); FrontsOrdersManager.SaveReOrders(ControlAssignmentsManager); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.UpdateDyeingCarts(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.RemoveDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID); for (int i = 0; i < dgvOperationsDetail.Rows.Count; i++) { int TechCatalogOperationsDetailID = Convert.ToInt32(dgvOperationsDetail.Rows[i].Cells["TechCatalogOperationsDetailID"].Value); ControlAssignmentsManager.CreateDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID, TechCatalogOperationsDetailID); } ControlAssignmentsManager.SaveDyeingAssignmentBarcodes(); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); break; default: break; } //ControlAssignmentsManager.NewAssignment = false; } else { if (ControlAssignmentsManager.GroupType == 1) { ControlAssignmentsManager.SaveDyeingBatch(); } FrontsOrdersManager.SaveDyeingFronts(ControlAssignmentsManager); ControlAssignmentsManager.ChangeOperationsGroup(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.UpdateDyeingCarts(ControlAssignmentsManager.DyeingAssignmentID); ControlAssignmentsManager.RemoveDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID); for (int i = 0; i < dgvOperationsDetail.Rows.Count; i++) { int TechCatalogOperationsDetailID = Convert.ToInt32(dgvOperationsDetail.Rows[i].Cells["TechCatalogOperationsDetailID"].Value); ControlAssignmentsManager.CreateDyeingAssignmentBarcode(ControlAssignmentsManager.DyeingAssignmentID, TechCatalogOperationsGroupID, TechCatalogOperationsDetailID); } ControlAssignmentsManager.SaveDyeingAssignmentBarcodes(); ControlAssignmentsManager.UpdateDyeingAssignmentBarcodes(ControlAssignmentsManager.DyeingAssignmentID); } while (SplashWindow.bSmallCreated) { SmallWaitForm.CloseS = true; } InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700); }
protected override void OnStartup(StartupEventArgs e) { RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly; // 通过群控升级挖矿端的时候升级器可能不存在所以需要下载,下载的时候需要用到下载器所以下载器需要提前注册 VirtualRoot.BuildCmdPath <ShowFileDownloaderCommand>(action: message => { UIThread.Execute(() => { FileDownloader.ShowWindow(message.DownloadFileUrl, message.FileTitle, message.DownloadComplete); }); }); VirtualRoot.BuildCmdPath <UpgradeCommand>(action: message => { AppStatic.Upgrade(message.FileName, message.Callback); }); if (!string.IsNullOrEmpty(CommandLineArgs.Upgrade)) { VirtualRoot.Execute(new UpgradeCommand(CommandLineArgs.Upgrade, () => { UIThread.Execute(() => { Environment.Exit(0); }); })); } else { try { appMutex = new Mutex(true, s_appPipName, out createdNew); } catch (Exception) { createdNew = false; } if (createdNew) { Logger.InfoDebugLine($"==================NTMiner.exe {MainAssemblyInfo.CurrentVersion.ToString()}=================="); NotiCenterWindowViewModel.IsHotKeyEnabled = true; SplashWindow splashWindow = null; // 在另一个UI线程运行欢迎界面以确保欢迎界面的响应不被耗时的主界面初始化过程阻塞 // 注意:必须确保SplashWindow没有用到任何其它界面用到的依赖对象 SplashWindow.ShowWindowAsync(window => { splashWindow = window; }); //ConsoleWindow.Instance.Show(); NotiCenterWindow.ShowWindow(); if (!NTMiner.Windows.WMI.IsWmiEnabled) { DialogWindow.ShowSoftDialog(new DialogWindowViewModel( message: "开源矿工无法运行所需的组件,因为本机未开启WMI服务,开源矿工需要使用WMI服务检测windows的内存、显卡等信息,请先手动开启WMI。", title: "提醒", icon: "Icon_Error")); Shutdown(); Environment.Exit(0); } if (!NTMiner.Windows.Role.IsAdministrator) { NotiCenterWindowViewModel.Instance.Manager .CreateMessage() .Warning("请以管理员身份运行。") .WithButton("点击以管理员身份运行", button => { WpfUtil.RunAsAdministrator(); }) .Dismiss().WithButton("忽略", button => { }).Queue(); } NTMinerRoot.Instance.Init(() => { _appViewFactory.Link(); if (VirtualRoot.IsLTWin10) { VirtualRoot.ThisLocalWarn(nameof(App), AppStatic.LowWinMessage, toConsole: true); } if (NTMinerRoot.Instance.GpuSet.Count == 0) { VirtualRoot.ThisLocalError(nameof(App), "没有矿卡或矿卡未驱动。", toConsole: true); } if (NTMinerRoot.Instance.ServerContext.CoinSet.Count == 0) { VirtualRoot.ThisLocalError(nameof(App), "访问阿里云失败,请尝试更换本机dns解决此问题。", toConsole: true); } UIThread.Execute(() => { if (NTMinerRoot.Instance.MinerProfile.IsNoUi && NTMinerRoot.Instance.MinerProfile.IsAutoStart) { ConsoleWindow.Instance.Hide(); VirtualRoot.Out.ShowSuccess("已切换为无界面模式运行,可在选项页调整设置", "开源矿工"); } else { // 预热视图模型 AppContext.Instance.VmsCtor(); _appViewFactory.ShowMainWindow(isToggle: false); } StartStopMineButtonViewModel.Instance.AutoStart(); AppContext.NotifyIcon = ExtendedNotifyIcon.Create("开源矿工", isMinerStudio: false); splashWindow?.Dispatcher.Invoke((Action) delegate() { splashWindow?.Close(); }); }); Task.Factory.StartNew(() => { if (NTMinerRoot.Instance.MinerProfile.IsAutoDisableWindowsFirewall) { Firewall.DisableFirewall(); } if (!Firewall.IsMinerClientRuleExists()) { Firewall.AddMinerClientRule(); } try { HttpServer.Start($"http://localhost:{NTKeyword.MinerClientPort.ToString()}"); Daemon.DaemonUtil.RunNTMinerDaemon(); } catch (Exception ex) { Logger.ErrorDebugLine(ex); } NTMinerRoot.Instance.CpuPackage.Start(); }); }); Link(); } else { try { _appViewFactory.ShowMainWindow(this, MinerServer.NTMinerAppType.MinerClient); } catch (Exception) { DialogWindow.ShowSoftDialog(new DialogWindowViewModel( message: "另一个NTMiner正在运行,请手动结束正在运行的NTMiner进程后再次尝试。", title: "提醒", icon: "Icon_Error")); Process currentProcess = Process.GetCurrentProcess(); NTMiner.Windows.TaskKill.KillOtherProcess(currentProcess); } } } base.OnStartup(e); }
private void InfiniumDocumentsMenu_ItemClicked(object sender, int FolderID, string Caption) { if (bNeedSplash) { Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(InfiniumFileList.Top + UpdatePanel.Top, InfiniumFileList.Left + UpdatePanel.Left, InfiniumFileList.Height, InfiniumFileList.Width); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } } if (FolderID == -3) { int iP = InfiniumFiles.CheckPersonalFolder(Security.CurrentUserID); if (iP == -1) { InfiniumFiles.CreatePersonalFolder(Security.CurrentUserID); iP = InfiniumFiles.CheckPersonalFolder(Security.CurrentUserID); } InfiniumFiles.EnterFolder(iP); InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable; InfiniumFileList.Entered = iP; } if (FolderID > 0) { InfiniumFiles.EnterFolder(FolderID); InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable; InfiniumFileList.Entered = FolderID; } if (FolderID == 4)//клиенты { if (InfiniumFiles.CheckInheritedPermission(Security.CurrentUserID, 4)) { SendMailButton.Visible = true; } } else { SendMailButton.Visible = false; } if (FolderID == -1)//на подпись { InfiniumFiles.FillSignsFiles(Security.CurrentUserID); InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable; InfiniumFileList.Entered = -1; } if (FolderID == -2)//на ознакомление { InfiniumFiles.FillReadFiles(Security.CurrentUserID); InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable; InfiniumFileList.Entered = -1; } if (bNeedSplash) { bC = true; } }