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()); } } }
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(); } } } }
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(); } } }
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(); } } }
public static void ShowWarning(string message) { var popup = new WarningWindow(message); popup.Show(); }
public override void Open(ToolControl control) { PopupWatcher.Release(window); window = WarningWindow.Show(control.activatorScreenPosition); PopupWatcher.Watch(window); }