public GoodsViewModel() { inputCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { var w = new InputWindow(); w.ShowDialog(); }); outputCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { OutputWindow w = new OutputWindow(); w.ShowDialog(); }); productCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { ProductWindow w = new ProductWindow(); w.ShowDialog(); }); categoryCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { CategoryWindow w = new CategoryWindow(); w.ShowDialog(); }); statisticCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { StatisticWindow w = new StatisticWindow(); w.ShowDialog(); }); }
public string ShowWorkspaceNameWindow(string currentName, Func <string, bool> validationRule) { if (string.IsNullOrEmpty(currentName)) { currentName = "Default workspace"; } var input = new ValueInput { Title = "Barcodes - Workspace", ContentHeader = "Enter workspace's name", Label = "Name:", InputValue = currentName, ValidationRule = validationRule }; var dataContext = new InputViewModel(input); var window = new InputWindow(dataContext) { Owner = MainWindow }; window.ShowDialog(); return(dataContext.Result); }
public static InputWindow SelectInputWindow(AttrItem source, string name, string toEdit) { InputWindow iw = windowGenerator.GetOrDefault(name, nullWindow)(source, toEdit); iw.AppendTitle(source.AttrCap); return(iw); }
public static void SetValidateStorageLocation() { InputWindow.OpenWindow(GetStorageLocation(), (newLocation) => { SetStorageLocation(newLocation); }); }
/// <summary> /// create a new bucket in cloud /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btNewBucket_Click(object sender, RoutedEventArgs e) { //create the bucket InputWindow dlg = new InputWindow("New Bucket", "Enter the new bucket name."); var ret = dlg.ShowDialog(); if (!ret.HasValue || ret.Value == false) { return; } //check the return string name = dlg.Questions[0].Answer; if (name.IndexOf(' ') != -1) { MessageBox.Show("The new bucket name can not contain spaces."); return; } else if (Buckets.Any(b => b.Equals(name, StringComparison.InvariantCultureIgnoreCase))) { MessageBox.Show("There is already a bucket with the name: " + name); return; } //create new directory if (!CloudStorage.NewDirectory(name)) { MessageBox.Show("There was an error creating the bucket."); return; } //refresh the bucket list RefreshBuckets(); }
public void Add() { const string title = "Add new Loan Product"; const string message = "Please enter a description"; var inputWindow = new InputWindow(message, title); if (inputWindow.ShowDialog() == true) { var input = inputWindow.InputText; if (string.IsNullOrEmpty(input)) { MessageWindow.ShowAlertMessage("Please specify a Loan Product Name"); return; } var newLoanProduct = LoanProduct.WhereTitleIs(input); if (newLoanProduct != null) { MessageWindow.ShowAlertMessage(input + "already exists"); return; } var editView = new EditLoanProductView(input); if (editView.ShowDialog() == true) { newLoanProduct = new LoanProduct(); newLoanProduct.Find(editView.CurrentItem.ID); _lookup.Add(newLoanProduct); _viewModel.Collection.Add(newLoanProduct); } } }
private void SimpleProfileView_InputClickEvent(MacroManualItemViewModel obj) { var windows = new InputWindow(obj.Value, obj.MinValue, obj.MinValue, obj.Title); windows.InputWindowFinishEvent += (s) => obj.Value = s; windows.ShowDialog(); }
private void AutoCutterCleanVM_InputClickEvent(MacroManualItemViewModel obj) { var windows = new InputWindow(obj.Value, obj.MinValue, obj.MinValue, obj.Title); windows.InputWindowFinishEvent += (s) => obj.Value = s; windows.ShowDialog(); }
private IEnumerator CreateNextInputWindow(AudioClip audioClip, double intervalUntilScheduledTime) { yield return(new WaitForSecondsRealtime((float)intervalUntilScheduledTime)); int clipID = soundLibrary.GetIDFromClip(audioClip); KeyCode keyCode = AudioKeyCodeConstants.GetKeyCodeFromID(clipID); if (activeInputWindow != null) { activeInputWindow.OnWindowShutEvent -= OnWindowShut; activeInputWindow.OnButtonPressedEvent -= OnButtonPressed; activeInputWindow.Deactivate(); } if (clipID >= soundLibrary.IndexOfFirstCue) { beatVisualizer.WindowOpened(); Debug.Log("Creating Input Window"); activeInputWindow = new InputWindow(audioClip, keyCode, AudioSettings.dspTime + audioClip.length, inputSystem, updateCallback); activeInputWindow.OnWindowShutEvent += OnWindowShut; activeInputWindow.OnButtonPressedEvent += OnButtonPressed; } else { activeInputWindow = null; } }
/// <summary> /// Aliohjelma joka pistää pelaajan nimen muistiin ja vie pelaajan kenttiin /// </summary> /// <param name="pelaajanNimi">teksti mitä pelaaja antoi</param> public void ProcessInput(InputWindow pelaajanNimi) { string vastaus = pelaajanNimi.InputBox.Text; pelaajanNimijono.Append(vastaus); LisaaLaskurit(); KenttaValiStop(0); }
private void InitializeInputWindowCommand() { InputWindowCommand = new RelayCommand <object>( sender => { return(true); }, sender => { InputWindow inputWindow = new InputWindow(); inputWindow.ShowDialog(); }); }
public MainViewModel() { LoadedWindowCommand = new RelayCommand <Window>((p) => { return(true); }, (p) => { isLoaded = true; if (p == null) { return; } p.Hide(); LoginWindow loginWindow = new LoginWindow(); loginWindow.ShowDialog(); if (loginWindow.DataContext == null) { return; } var loginVM = loginWindow.DataContext as LoginViewModel; if (loginVM.IsLogin) { p.Show(); } else { p.Close(); } }); SuplierWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { SuplierWindow window = new SuplierWindow(); window.ShowDialog(); }); CustomerWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { CustomerWindow window = new CustomerWindow(); window.ShowDialog(); }); ObjectWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { ObjectWindow window = new ObjectWindow(); window.ShowDialog(); }); UserWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { UserWindow window = new UserWindow(); window.ShowDialog(); }); InputWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { InputWindow window = new InputWindow(); window.ShowDialog(); }); OutputWindowCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { OutputWindow window = new OutputWindow(); window.ShowDialog(); }); }
private void tbNewDay_Click(object sender, RoutedEventArgs e) { InputWindow wnd = new InputWindow(true); wnd.Value = string.Format(StrengthTrainingEntryStrings.TrainingPlanNewDayName, viewModel.Days.Count + 1); if (wnd.ShowDialog() == true) { viewModel.AddDays(wnd.Value); } }
public static void GUIDConvert() { var input = InputWindow.CreateWindow("Input GUID"); input.Callback += s => { var path = AssetDatabase.GUIDToAssetPath(s); Selection.activeObject = AssetDatabase.LoadAssetAtPath <UnityEngine.Object>(path); }; input.ShowModal(); }
private void Login(object sender, RoutedEventArgs e) { InputWindow input = new InputWindow(this); if (hasLogin == true) { input.Title = "切换账户"; } input.ShowDialog(); }
private void InputButton_Click(object sender, RoutedEventArgs e) { InputWindow window = new InputWindow(); window.Owner = this; if (window.ShowDialog() == true) { this.FillInData(); } }
public static InputWindow OpenWindow(string currentValue, Action <string> closeCallback) { InputWindow window = GetWindow <InputWindow>(); window.titleContent = new GUIContent("Input Field"); window.Show(); window.Focus(); window._currentValue = currentValue; window._closeCallback = closeCallback; return(window); }
public static bool OpenAsset(int instanceID, int line) { UnityEngine.Object obj = EditorUtility.InstanceIDToObject(instanceID); if (obj is VirtualController) { InputWindow window = EditorWindow.GetWindow <InputWindow>(); window.controller = (VirtualController)obj; return(true); } return(false); // we did not handle the open }
private void label4_Click(object sender, EventArgs e) { var a = InputWindow.Ask(this, "Config Editor", "Please, enter config property name (var config int <name>)", new InputWindow.NonEmptyValidator(), label4.Text); if (a != null) { label4.Text = a; Conf.PropertyName = a; CallUpdateEvent(); } }
private void label5_Click(object sender, EventArgs e) { var a = InputWindow.Ask(this, "Config Editor", "Please, enter config display name", new InputWindow.NonEmptyValidator(), label5.Text); if (a != null) { label5.Text = a; Conf.Name = a; CallUpdateEvent(); } }
private void label3_Click(object sender, EventArgs e) { var a = InputWindow.Ask(this, "Config Editor", "Please, enter the description", new InputWindow.NonEmptyValidator(), label3.Text, true); if (a != null) { label3.Text = a; Conf.Description = a.Replace(Environment.NewLine, "[br]"); CallUpdateEvent(); } }
// 这个方法没有放在InputWindow类型中是为了去除编译时对MahaApps.Metro的依赖供AppModels使用 public static void ShowInputDialog( string title, string text, Func <string, string> check, Action <string> onOk) { Window window = new InputWindow(title, text, check, onOk); window.MousePosition(); window.ShowSoftDialog(); }
/// <summary> /// Laitetaan syöttöikkunasta saatuun koordinaattiin uusi vihreä piste /// </summary> /// <param name="ikkuna"></param> private void KoordinaattiAnnettu(InputWindow ikkuna) { string vastaus = ikkuna.InputBox.Text; Vector p = new Vector(); double[] d = Taulukot.ErotaLuvut(vastaus + " 0 0"); p.X = d[0]; p.Y = d[1]; LuoPallo(this, p, 1.5 * pallonKoko, Color.Green); kysymassa = false; }
private void mButtonBorderless3_Click(object sender, EventArgs e) { var a = InputWindow.Ask(this, "Config Editor", "Please, enter a new value name", new InputWindow.NonEmptyValidator()); if (a != null) { listBox1.Items.Add(a); RepopulateOptionsDict(); CallUpdateEvent(); } }
private void CopiarDados() { string token = "CopiarDados"; var input = new InputWindow(); Messenger.Default.Register <InputResultMessage>(this, token, ContinuarCopiarDados); Messenger.Default.Send(new ShowInputMessage() { Pergunta = "Qual senha deseja utilizar para proteger o arquivo?", Titulo = "Senha de proteção do arquivo", Token = token }); input.ShowDialog(); }
public Csvviewer(Project p, List <csvItemViewModel> list, InputWindow window)//csv导入后弹出,加载页面=>datagrid列表显示,若有冲突:"一个以上冲突,请您确认",对应行标红,保留与否:按钮.保留原数据/新数据,下一步:更改的确认,导入成功,detail页面的显示 { InitializeComponent(); fatherWindow = window; vhelper = VolunteerHelper.GetInstance(); pphelper = ProjectProgressHelper.GetInstance(); project = p; chelper = CsvHelper.GetInstance(); csvList = list; ShowCddGrid(); Claims = identitypage.Claims; }
private void OnEnable() { m_statesProp = serializedObject.FindProperty("States"); m_statesList = new ReorderableList(serializedObject, m_statesProp) { onAddCallback = list => { var input = InputWindow.CreateWindow("Create new state"); input.Callback += stateName => { if (string.IsNullOrEmpty(stateName)) { return; } var switcher = target as StateSwitcher; if (Array.Find(switcher.States, state => state.StateName == stateName) != null) { EditorUtility.DisplayDialog("ERROR", $"Duplicate state name : {stateName}", "OK"); return; } var index = m_statesProp.arraySize; m_statesProp.InsertArrayElementAtIndex(index); var arrElement = m_statesProp.GetArrayElementAtIndex(index); var stateNameProp = arrElement.FindPropertyRelative("StateName"); stateNameProp.stringValue = stateName; var actionsProp = arrElement.FindPropertyRelative("SwitcherActions"); actionsProp.ClearArray(); m_statesProp.serializedObject.ApplyModifiedProperties(); }; input.ShowModal(); }, onSelectCallback = list => { if (list.index < 0) { m_switcherActionList = null; } else { var property = m_statesProp.GetArrayElementAtIndex(list.index); var switcherActionsProp = property.FindPropertyRelative("SwitcherActions"); m_switcherActionList = CreateNewListUI(switcherActionsProp); } }, drawHeaderCallback = rect => { EditorGUI.LabelField(rect, "State List"); }, onRemoveCallback = list => { m_statesProp.DeleteArrayElementAtIndex(list.index); m_switcherActionList = null; } }; }
/// <summary> /// Laitetaan syöttöikkunasta saatuun koordinaattiin uusi vihreä piste /// </summary> /// <param name="ikkuna"></param> private void KoordinaattiAnnettu(InputWindow ikkuna) { string vastaus = ikkuna.InputBox.Text; Vector p = new Vector(); // TODO: Tehtävä B1 tekemisen jälkeen //double[] d = Taulukot.ErotaLuvut(vastaus + " 0 0"); double[] d = { 5, 5 }; // poista tämä kun taulukkojen ErotaLuvut on valmis p.X = d[0]; p.Y = d[1]; LuoPallo(this, p, 1.5 * pallonKoko, Color.Green); kysymassa = false; }
// 这个方法没有放在InputWindow类型中是为了去除编译时对MahaApps.Metro的依赖供AppModels使用 public static void ShowInputDialog( string title, string text, string tail, Func <string, string> check, Action <string> onOk, bool isPassword = false) { Window window = new InputWindow(title, text, tail, check, onOk, isPassword); window.MousePosition(); window.ShowSoftDialog(); }
private void Awake() { canvas = GetComponentInChildren <Canvas>(); gameOverWindow = canvas.transform.Find(GAME_OVER_WINDOW_OBJECT_NAME).gameObject; gameWinWindow = canvas.transform.Find(GAME_WIN_WINDOW_OBJECT_NAME).gameObject; blocker = canvas.transform.Find(BLOCKER_OBJECT_NAME).gameObject; pauseWindow = canvas.transform.Find(PAUSE_WINDOW_OBJECT_NAME).gameObject; inputWindow = canvas.GetComponentInChildren <InputWindow>(); HideAll(); }
public void createWindows() { myInputWindow = new InputWindow(); myInputWindow.manager = this; myPenToText = new convertToText(myDynamicDisplay); myDataStuff = new dataStuff(this); blockingData = new BlockingCollection<mPoint>(); addingData = Task.Factory.StartNew(() => myPenToText.getData(blockingData)); myDisplayWindow = new DisplayWindow(myDynamicDisplay); myPenToText.setDisplayActive(true); myDisplayWindow.manager = this; myDisplayWindow.Visibility = Visibility.Visible; myDisplayWindow.Owner = myInputWindow; myDataDisplay = new DataDisplay(myDataStuff); myDataDisplay.Visibility = Visibility.Visible; myDataDisplay.Owner = myInputWindow; myInputWindow.Top = System.Windows.SystemParameters.WorkArea.Top; myInputWindow.Left = System.Windows.SystemParameters.WorkArea.Left; myDataDisplay.Top = myInputWindow.Top+ myInputWindow.Height; myDataDisplay.Left = myInputWindow.Left; myDataDisplay.Width = System.Windows.SystemParameters.WorkArea.Width - myDisplayWindow.Width; myDataDisplay.Height = System.Windows.SystemParameters.WorkArea.Height - myDataDisplay.Top; myDisplayWindow.Top = System.Windows.SystemParameters.WorkArea.Top; myDisplayWindow.Left = System.Windows.SystemParameters.WorkArea.Width - myDisplayWindow.Width; resized(); //toggleDataDisplayWindow(); }
/// <summary> /// create a new bucket in cloud /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btNewBucket_Click(object sender, RoutedEventArgs e) { //create the bucket InputWindow dlg = new InputWindow("New Bucket", "Enter the new bucket name."); var ret = dlg.ShowDialog(); if (!ret.HasValue || ret.Value == false) return; //check the return string name = dlg.Questions[0].Answer; if (name.IndexOf(' ') != -1) { MessageBox.Show("The new bucket name can not contain spaces."); return; } else if (Buckets.Any(b => b.Equals(name, StringComparison.InvariantCultureIgnoreCase))) { MessageBox.Show("There is already a bucket with the name: " + name); return; } //create new directory if (!CloudStorage.NewDirectory(name)) { MessageBox.Show("There was an error creating the bucket."); return; } //refresh the bucket list RefreshBuckets(); }
public submitPopup(InputWindow inputWindow) { myInput = inputWindow; InitializeComponent(); }
void LuoMaailma() { InputWindow kysymysIkkuna = new InputWindow("World name:"); kysymysIkkuna.TextEntered += LuoUusiMaailma; Add(kysymysIkkuna); }
void AskFileAndLoad() { InputWindow fileNameInput = new InputWindow("Pelikansiossa olevan kenttätiedoston nimi"); fileNameInput.TextEntered += (input) => LoadLevel(input.InputBox.Text); Add(fileNameInput); }
void NameContent() { if (currentTool.TemplateFile != "") { string templateFilePath = GetTemplateFilePath(); string newContentFilePath = ""; string namedContentFilePath = ""; GetContentFilePaths("uusi_" + currentTool.ContentSubfolder, "", ref newContentFilePath, ref namedContentFilePath); // Check that file has been changed (from the template) if (File.Exists(templateFilePath) && File.Exists(newContentFilePath) && !FileEquals(templateFilePath, newContentFilePath)) { InputWindow askFileNameWindow = new InputWindow("TÄRKEÄÄ: Anna luodulle " + currentTool.ContentDescription + "-tiedostolle kuvaava nimi"); askFileNameWindow.TextEntered += ContentNameGiven; Add(askFileNameWindow); } else if (File.Exists(newContentFilePath)) { File.Delete(newContentFilePath); } } else { // No template -> named in the tool } }
void ContentNameGiven(InputWindow inputWindow) { string namedName = inputWindow.InputBox.Text; string newContentFilePath = ""; string namedContentFilePath = ""; GetContentFilePaths("uusi_" + currentTool.ContentSubfolder, inputWindow.InputBox.Text, ref newContentFilePath, ref namedContentFilePath); if (inputWindow.InputBox.Text != "") { if (File.Exists(namedContentFilePath)) { MessageDisplay.Add("Tämä nimi on jo varattu. Paina nappia uudelleen ja keksi toinen nimi."); NameContent(); } else if (!File.Exists(newContentFilePath)) { MessageDisplay.Add("Fataali virhe, uutta luotua sisältötiedostoa ei löydy"); } else { System.IO.File.Move(newContentFilePath, namedContentFilePath); } } else { MultiSelectWindow valintaIkkuna = new MultiSelectWindow("Ilman nimeä tiedosto poistetaan. Oletko varma?", "Kyllä", "Ei"); valintaIkkuna.ItemSelected += new Action<int>(selection => NoNameConfirmation(selection, newContentFilePath)); Add(valintaIkkuna); } }
void LuoUusiMaailma(InputWindow ikkuna) { kentanNimi = ikkuna.InputBox.Text; Vedikartta = new List<PhysicsObject>(); Gravity = new Vector(0, -900); LataaKentta(new ColorTileMap( generate(200, 60,kentanNimi) ) ); LisaaNappaimet(); Inventory inventory = new Inventory(); Add(inventory); yu = new HorizontalLayout(); yu.Spacing = 5; qq = new VerticalLayout(); foreach (PhysicsObject esine in esineet()) { inventory.AddItem(esine, kivihakku); inventory.SelectItem(esine); } inventory.Y = Screen.Top - 20; int luku = RandomGen.NextInt(1, 200); luopuu(luku); //luopuu(new Vector kentanPiste = Level.GetRandomPosition()); Camera.Zoom(1.5); //Camera.ZoomToLevel(); Camera.Follow(pelaaja1); luojano(); esineet2 = new List<GameObject>(); esineslotit = new List<Widget>(); käsiselecteditem = 1; GameObject banaanit = new GameObject(35, 35); banaanit.Image = banaanikuva; esineet2.Add(banaanit); GameObject puuhakku = new GameObject(35, 35); puuhakku.Image = kivihakku; esineet2.Add(puuhakku); käsitaso = new List<Widget>(); luoesinevalikko(); }