private void OnValidate() { if (gameObject.scene.name != null) { if (!Application.isPlaying) { WarningWindow.ShowWindow("A singleton can't start in a scene", gameObject); } } if (!Application.isPlaying && gameObject.scene.name == null) { UnityEngine.Object[] obj = Resources.LoadAll("ISingletons", thisType); if (obj.Length > 0 && obj[0] != this) { WarningWindow.ShowWindow("Can't have two copies of the singleton: " + thisType.ToString(), gameObject); string path = AssetDatabase.GetAssetPath(GetInstanceID()); if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } if (System.IO.File.Exists(path + ".meta")) { System.IO.File.Delete(path + ".meta"); } } } }
private void ConfirmExecute(object parameter) { if (string.IsNullOrWhiteSpace(Warehouse.WarehouseName)) { string message = "仓库名称不能为空"; string detailMessage = "仓库名称不允许为空"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { AddWarehouseWindow AddWarehouseWindow = parameter as AddWarehouseWindow; bool IsExist = CallBack(Warehouse); if (IsExist == true) { string message = "已存在相同名字的仓库"; string detailMessage = "仓库名字不允许重复"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { AddWarehouseWindow.Close(); } } }
private void Awake() { if (!Application.isPlaying) { UnityEngine.Object[] obj = Resources.LoadAll("ISingletons", thisType); if (obj.Length == 0) { Debug.Log(thisType + " have been created."); } if (obj.Length > 0 && obj[0] != this) { WarningWindow.ShowWindow("Can't have two copies of the singleton: " + thisType.ToString(), this); string path = UnityEditor.AssetDatabase.GetAssetPath(GetInstanceID()); if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } if (System.IO.File.Exists(path + ".meta")) { System.IO.File.Delete(path + ".meta"); } } } }
private const string ARGS = "locks"; // can also use --json and parse the output for better information display. private static void OnWillSaveAssets(string[] paths) { string processOutput = string.Empty; bool fileIsLocked = false; StringBuilder output = new StringBuilder("YOU ARE EDITING A LOCKED FILE!\n"); processOutput = RunProcess(FILE_NAME, ARGS); if (!string.IsNullOrEmpty(processOutput)) { UnityEngine.Debug.LogWarning(output); foreach (string path in paths) { if (processOutput.Contains(path)) { fileIsLocked = true; string file = "\n<color=cyan>" + path + "</color>"; UnityEngine.Debug.Log(file); output.Append(file); } } if (fileIsLocked && !WarningWindow.DontShowAgain) { WarningWindow.Show(output.ToString()); } } }
private void ConfirmExecute(object parameter) { if (string.IsNullOrWhiteSpace(Plane.PlaneName)) { string message = "层名称不能为空"; string detailMessage = "层名称不允许为空"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { AddPlaneWindow AddPlaneWindow = parameter as AddPlaneWindow; bool IsExist = CallBack(Plane); if (IsExist == true) { string message = "该仓库已存在相同名字的层"; string detailMessage = "同一仓库中的层名字不允许重复"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { AddPlaneWindow.Close(); } } }
private void CheckElementWarning(object sender, FailuresProcessingEventArgs args) { try { if (isElementChanged) { FailuresAccessor fa = args.GetFailuresAccessor(); WarningWindow warningWindow = new WarningWindow(reportingInfo); if ((bool)warningWindow.ShowDialog()) { args.SetProcessingResult(FailureProcessingResult.ProceedWithRollBack); FailureHandlingOptions option = fa.GetFailureHandlingOptions(); option.SetClearAfterRollback(true); fa.SetFailureHandlingOptions(option); } } } catch (Exception ex) { string message = ex.Message; MessageBox.Show("Failed to promt users for a warning message.\n" + ex.Message, "Check Element Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } finally { isElementChanged = false; } }
private void ConfirmExecute(object parameter) { if (string.IsNullOrWhiteSpace(Block.BlockName)) { string message = "区域名称不能为空"; string detailMessage = "区域名称不允许为空"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { AddBlockWindow AddBlockWindow = parameter as AddBlockWindow; bool IsExist = CallBack(Block); if (IsExist == true) { string message = "该层已存在相同名字的区域"; string detailMessage = "同一层中的区域名字不允许重复"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { AddBlockWindow.Close(); } } }
/// <summary> /// Сбрасывание таймера /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Stop_MouseDown(object sender, MouseButtonEventArgs e) { #region Uri resourceStopUri = new Uri("/Resources/Images/stop_active.png", UriKind.Relative); Stop.Source = new BitmapImage(resourceStopUri); Uri resourcePauseUri = new Uri("/Resources/Images/pause.png", UriKind.Relative); Pause.Source = new BitmapImage(resourcePauseUri); Uri resourceStartUri = new Uri("/Resources/Images/start.png", UriKind.Relative); Start.Source = new BitmapImage(resourceStartUri); #endregion if (timer == null) { WarningWindow warWindow = new WarningWindow(); warWindow.TextExit.Text = this._textWarningWindow; warWindow.ShowDialog(); Uri resourceStop = new Uri("/Resources/Images/stop.png", UriKind.Relative); Stop.Source = new BitmapImage(resourceStop); e.Handled = true; } else { timer.Stop(); this._startValue = 0; TimerOutput.Content = ToStringTimeFormat(_startValue); } }
public static void Show(string message) { EditorStyles.boldLabel.richText = true; EditorStyles.label.richText = true; WarningWindow.message = message; window = (WarningWindow)EditorWindow.GetWindow(typeof(WarningWindow), true, "Warning", true); window.Show(); }
internal void SaveChanges() { if (ActionState == Enums.ActionState.Edit) { var dialogWindow = new DialogWindows("Shranim spremembe?"); dialogWindow.ShowDialog(); if (dialogWindow.DialogResult.HasValue && dialogWindow.DialogResult.Value) { try { ManageProstorDB.UrediProstor(IzbraniProstor); } catch (Exception ex) { var errorWindow = new WarningWindow(ex.Message); errorWindow.ShowDialog(); } } } if (ActionState == Enums.ActionState.Delete) { var dialogWindow = new DialogWindows("Izbrisem prostor?"); dialogWindow.ShowDialog(); if (dialogWindow.DialogResult.HasValue && dialogWindow.DialogResult.Value) { try { ManageProstorDB.IzbrisiProstor(IzbraniProstor); var prostorView = VsiProstori.First(prostor => prostor.Id == IzbraniProstor.Id); VsiProstoriComboBox.SelectedIndex = -1; VsiProstori.Remove(prostorView); //TODO:REMOVE FROM LIST UPDATE STUFF DO STUDFF in CE OBSTAJAJO NAJEMI S TEM PROSTOROM DIALOG WINDOW DELETE? } catch (Exception ex) { var errorWindow = new WarningWindow(ex.Message); errorWindow.Show(); } } } if (ActionState == Enums.ActionState.Create) { var dialogWindow = new DialogWindows("Ustvarim prostor"); dialogWindow.ShowDialog(); if (dialogWindow.DialogResult.HasValue && dialogWindow.DialogResult.Value) { try { ManageProstorDB.UstvariProstor(IzbraniProstor); } catch (Exception ex) { var errorWindow = new WarningWindow(ex.Message); errorWindow.Show(); } } } }
private void ConfirmExecute(object parameter) { bool IsValid = true; string message = "存在非法输入"; string detailMessage = ""; if (PurchaseOrderViewModel.PurchaseOrder.UnitPurchasePrize <= 0) { detailMessage += "单位进价不允许小于等于零\n"; IsValid = false; } if (PurchaseOrderViewModel.PurchaseOrder.Amount <= 0) { detailMessage += "数量不允许小于等于零\n"; IsValid = false; } if (SelectedWarehouseViewModel == null) { detailMessage += "未选择仓库\n"; IsValid = false; } if (SelectedPlaneViewModel == null) { detailMessage += "未选择层数\n"; IsValid = false; } if (SelectedBlockViewModel == null) { detailMessage += "未选择区域\n"; IsValid = false; } if (IsValid) { PurchaseOrderViewModel.BlockViewModel = SelectedBlockViewModel; PurchaseOrderViewModel.PurchaseOrder.WarehouseName = SelectedWarehouseViewModel.Warehouse.WarehouseName; PurchaseOrderViewModel.PurchaseOrder.PlaneName = SelectedPlaneViewModel.Plane.PlaneName; PurchaseOrderViewModel.PurchaseOrder.BlockName = SelectedBlockViewModel.Block.BlockName; AddPurchaseOrderWindow AddPurchaseOrderWindow = parameter as AddPurchaseOrderWindow; bool IsExist = CallBack(PurchaseOrderViewModel); if (IsExist) { string message2 = "订单中已存在同名条目"; string detailMessage2 = string.Format("同一订单中的不同条目之间,以下五个项目应至少有一个不重复:仓库名称,楼层名称,区域名称,货品名称,单位进价"); WarningWindow warn = new WarningWindow(message2, detailMessage2); warn.ShowDialog(); } else { AddPurchaseOrderWindow.Close(); } } else { WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } }
internal void SaveChanges() { if (WindowAction == ActionState.Create) { try { var dialogWindow = new DialogWindows("Ustvarim osebo?"); dialogWindow.ShowDialog(); if (dialogWindow.DialogResult.HasValue && dialogWindow.DialogResult.Value) { ManageOsebaDB.UstvariOsebo(Oseba); } } catch (Exception ex) { var errorWindow = new WarningWindow(ex.Message); errorWindow.Show(); } } if (WindowAction == ActionState.Edit) { try { var acceptWindow = new DialogWindows("Ali zelite shraniti spremembe?"); acceptWindow.ShowDialog(); if (acceptWindow.DialogResult.HasValue && acceptWindow.DialogResult.Value) { ManageOsebaDB.UrediOsebo(Oseba); } } catch (Exception ex) { var errorWindow = new WarningWindow(ex.Message); errorWindow.Show(); } } if (WindowAction == ActionState.Delete) { try { var acceptWindow = new DialogWindows("Ali zelite shraniti spremembe?"); acceptWindow.ShowDialog(); if (acceptWindow.DialogResult.HasValue && acceptWindow.DialogResult.Value) { ManageOsebaDB.IzbrisiOsebo(Oseba); } } catch (Exception ex) { var errorWindow = new WarningWindow(ex.Message); errorWindow.Show(); } } }
public static WarningWindow showWarningWindow() { var warningWindowPrefab = RESOURCES.getPrefab("WarningBuyWindow"); GameObject warningWindowCanvasGO = GameObject.Instantiate(warningWindowPrefab) as GameObject; warningWindowCanvasGO.name = "WarningWindow"; SoundsSystem.play(Sound.S_ERROR); warningWindow = warningWindowCanvasGO.transform.FindChild("WarningWindow").GetComponent <WarningWindow>(); ScenesController.updateGetActualInputLayer(); return(warningWindow); }
internal void UstvariProstor() { var ustvariProstor = new ProstorManage(new ProstorView(), Enums.ActionState.Create); ustvariProstor.ShowDialog(); if (ustvariProstor.DialogResult.HasValue && ustvariProstor.DialogResult.Value) { var messageWindow = new WarningWindow("Prostor uspesno ustvarjen."); messageWindow.ShowDialog(); } }
private void Awake() { if (Instance != null) { throw new System.Exception("Only supporting one warning window right now. Already one in existance"); } Instance = this; warningQueue = new Queue <Warning>(); StartCoroutine(WorkQueue()); }
internal void UrediKontaktnaOsebo() { var urediOsebo = new OsebaManage(TrenutnaKontaktna, Enums.ActionState.Edit); urediOsebo.ShowDialog(); if (urediOsebo.DialogResult.HasValue && urediOsebo.DialogResult.Value) { var successMessage = new WarningWindow("Oseba je bila uspesno shranjena."); successMessage.ShowDialog(); } }
protected virtual void Reset() { if (!Application.isPlaying) { if (transform != transform.root) { Debug.LogError("The component with IInitializeMain needs to be on the top gameobject in hierarchy"); Debug.LogError(GetType().ToString() + " will be removed from " + gameObject.name); WarningWindow.ShowWindow("The component with IInitializeMain needs to be on the top gameobject in hierarchy", this); } } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { WarningWindow warningWindow = new WarningWindow(); if (warningWindow.ShowDialog() == true) { e.Cancel = false; } else { e.Cancel = true; } }
private void AddPurchaseOrderCollectionExecute(object parameter) { if (OutPurchaseOrderButtonIsEnabled) { string message = "已存在一个订单,无法添加订单"; string detailMessage = "同一时间只允许存在一个订单,不允许同一时间编辑两个订单"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { OutPurchaseOrderButtonIsEnabled = true; PurchaseOrderCollectionViewModel = new PurchaseOrderCollectionViewModel(CMContext); } }
private void SearchExecute(object parameter) { if (StartTime > EndTime) { string message = "起始时间应早于结束时间"; string detailMessage = "选择时间区间时,起始时间应早于结束时间"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { DataGrid grid = parameter as DataGrid; IEnumerable <SellOrderCollectionViewModel> show = SellOrderCollectionViewModels.Where(item => (item.SellOrderCollection.SellTime >= StartTime && item.SellOrderCollection.SellTime <= EndTime)); grid.ItemsSource = new ObservableCollection <SellOrderCollectionViewModel>(show.OrderBy(item => item.SellOrderCollection.SellTime)); } }
private void AddSellOrderCollectionExecute(object parameter) { if (OutSellOrderButtonIsEnabled) { string message = "已存在一个订单,无法添加订单"; string detailMessage = "同一时间只允许存在一个订单,不允许同一时间编辑两个订单"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { AddSellOrderCollectionWindow AddSellOrderCollectionWindow = new AddSellOrderCollectionWindow(); AddSellOrderCollectionWindowViewModel vm = AddSellOrderCollectionWindow.DataContext as AddSellOrderCollectionWindowViewModel; vm.CallBack = new Action <SellOrderCollection>(AddSellOrderCollectionCallBackAction); AddSellOrderCollectionWindow.Show(); } }
internal static void UstvariProstor(ProstorView prostor) { using (var db = new PBDB()) { try { var prostorDb = new PoslovniProstor() { ImeProstora = prostor.ImeProstora, DnevnaCena = prostor.DnevnaCena }; db.VsiPoslovniProstori.Add(prostorDb); db.SaveChanges(); } catch (Exception ex) { var warningWindow = new WarningWindow("Napaka v povezavi z bazo"); warningWindow.Show(); } } }
protected virtual void Reset() { if (!Application.isPlaying) { if (transform.root.GetComponent <IInitializeMain>() == null) { Debug.LogError("There needs to be an IInitializeMain component on the top parent for an IInitializeSub component"); Debug.LogError(GetType().ToString() + " will be removed from " + gameObject.name); WarningWindow.ShowWindow("There needs to be an IInitializeMain component on the top parent for an IInitializeSub component", this); } List <IInitializeSub> list = new List <IInitializeSub>(); list.AddRange(transform.root.GetComponentsInChildren <IInitializeSub>()); priority = list.Count; if (transform.root.GetComponent <IInitializeMain>() != null) { transform.root.GetComponent <IInitializeMain>().AddInitializeSub((IInitializeSub)this, priority, true); } } }
private void ConfirmExecute(object parameter) { bool IsValid = true; string message = "存在非法输入"; string detailMessage = ""; if (SellOrder.UnitSellPrize <= 0) { detailMessage += "单位售价不允许小于等于零\n"; IsValid = false; } if (SellOrder.Amount <= 0) { detailMessage += "数量不允许小于等于零\n"; IsValid = false; } if (IsValid) { if (CargoCollection.Amount < SellOrder.Amount) { string message2 = "货物数量不足"; string detailMessage2 = string.Format("仓库:{0},楼层:{1},区域:{2}中的商品:{3},库存数量:{4},订单要求卖出数量:{5}。数量不足!", CargoCollection.WarehouseName, CargoCollection.PlaneName, CargoCollection.BlockName, CargoCollection.Cargo.CargoName, CargoCollection.Amount, SellOrder.Amount); WarningWindow warn = new WarningWindow(message2, detailMessage2); warn.ShowDialog(); } else { CallBack(SellOrder); AddSellOrderWindow AddSellOrderWindow = parameter as AddSellOrderWindow; AddSellOrderWindow.Close(); } } else { WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } }
public void AddSellOrderExecute(object parameter) { SellCargoUserControl sellCargoUserControl = parameter as SellCargoUserControl; SellCargoUserControlViewModel sellCargoUserControlvm = sellCargoUserControl.DataContext as SellCargoUserControlViewModel; SellOrderCollectionViewModel = sellCargoUserControlvm.SellOrderCollectionViewModel; if (sellCargoUserControlvm.OutSellOrderButtonIsEnabled == false) { string message = "尚未创建订单"; string detailMessage = "卖出货品前,需要首先创建一个订单,每次卖出物品会在订单中添加一个条目"; WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { bool IsExist = SellOrderCollectionViewModel.SellOrderViewModels.Any <SellOrderViewModel> (item => item.SellOrder.WarehouseName == CargoCollection.WarehouseName && item.SellOrder.PlaneName == CargoCollection.PlaneName && item.SellOrder.BlockName == CargoCollection.BlockName && item.SellOrder.PreciseCargoName == CargoCollection.PreciseCargoName); if (IsExist) { string message = "订单中已存在同名条目"; string detailMessage = string.Format("同一订单中的不同条目之间,以下四个项目应至少有一个不重复:仓库名称,楼层名称,区域名称,货品名称"); WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } else { AddSellOrderWindow addSellOrderWindow = new AddSellOrderWindow(CargoCollection); AddSellOrderWindowViewModel addSellOrderWindowvm = addSellOrderWindow.DataContext as AddSellOrderWindowViewModel; addSellOrderWindowvm.CallBack = new Action <SellOrder>(CallBack); addSellOrderWindow.Show(); } } }
private void ConfirmExecute(object parameter) { WarningWindow warningWindow = parameter as WarningWindow; warningWindow.DialogResult = true; }
public void CreateDisk(object obj) { bool cnt = true; StatusInformation = "Configuration of a USB key is in progress..."; ChooseDiskEnable = false; SelectConfigurationEnabled = false; if (currentWorkerIdx == -1) { WarningWindow ww = new WarningWindow(SelectedDiskDrive.ToString()); ww.Owner = mainWindow; ww.ShowDialog(); if (!ww.UserConfirmed) { StatusInformation = "Configuration of a USB key was cancelled!"; ChooseDiskEnable = true; SelectConfigurationEnabled = true; return; } else { SelectedConfiguration.ResetStepStatuses(); currentWorkerIdx = 0; } } else { currentWorkerIdx++; if (currentWorkerIdx >= SelectedConfiguration.Workers.Count) { cnt = false; } } if (cnt) { SelectedConfiguration.Workers[currentWorkerIdx].ProgressChanged += Bw_ProgressChanged; SelectedConfiguration.Workers[currentWorkerIdx].RunWorkerCompleted += Bw_RunWorkerCompleted; SelectedConfigurationStepModel = SelectedConfiguration.Steps[currentWorkerIdx]; SelectedConfiguration.Steps[currentWorkerIdx].SetStatus("IN WORK"); SelectedConfiguration.Workers[currentWorkerIdx].RunWorkerAsync(); Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; } else { foreach (BackgroundWorker bw in SelectedConfiguration.Workers) { bw.ProgressChanged -= Bw_ProgressChanged; bw.RunWorkerCompleted -= Bw_RunWorkerCompleted; } currentWorkerIdx = -1; SelectedConfigurationStepModel = null; if (SelectedConfiguration.Steps.Last().Type == "eject") { StatusInformation = "USB disk was sucessfully created and can be removed now."; } else { StatusInformation = "USB disk was sucessfully created. Please remove it safely."; } CommandManager.InvalidateRequerySuggested(); ChooseDiskEnable = true; SelectConfigurationEnabled = true; if (SelectedConfiguration.Steps.Last().Type == "eject") { RefreshDiskDrives(null); } Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow; } }
public override void Open(ToolControl control) { PopupWatcher.Release(window); window = WarningWindow.Show(control.activatorScreenPosition); PopupWatcher.Watch(window); }
private void ConfirmExecute(object parameter) { bool IsValid = true; string message = "存在非法输入"; string detailMessage = ""; if (string.IsNullOrWhiteSpace(Cargo.CargoName)) { detailMessage += "商品名称不允许为空\n"; IsValid = false; } if (string.IsNullOrWhiteSpace(Cargo.Material)) { detailMessage += "商品材料不允许为空\n"; IsValid = false; } if (string.IsNullOrWhiteSpace(Cargo.Size)) { detailMessage += "商品尺寸不允许为空, 若该商品无尺寸, 则输入:无\n"; IsValid = false; } if (string.IsNullOrWhiteSpace(Cargo.SizeUnit)) { detailMessage += "商品尺寸单位不允许为空, 若该商品无尺寸单位, 则输入:无\n"; IsValid = false; } if (string.IsNullOrWhiteSpace(Cargo.Category)) { detailMessage += "商品类别不允许为空\n"; IsValid = false; } if (string.IsNullOrWhiteSpace(Cargo.StdCategory)) { detailMessage += "商品标准类别不允许为空\n"; IsValid = false; } if (string.IsNullOrWhiteSpace(Cargo.StdName)) { detailMessage += "商品标准名称不允许为空\n"; IsValid = false; } if (IsValid) { AddCargoWindow AddCargoWindow = parameter as AddCargoWindow; Cargo.SetPreciseCargoName(); bool IsExist = CallBack(Cargo); if (IsExist == true) { string message2 = "已存在同名商品"; string detailMessage2 = string.Format("不同商品之间,以下六个项目应至少有一个不重复:商品类别,商品标准类别,商品标准名称,商品尺寸,商品尺寸单位,商品材料"); WarningWindow warn = new WarningWindow(message2, detailMessage2); warn.ShowDialog(); } else { AddCargoWindow.Close(); } } else { WarningWindow warn = new WarningWindow(message, detailMessage); warn.ShowDialog(); } }
public static void ShowWarning(string message) { var popup = new WarningWindow(message); popup.Show(); }