public Person CreateNewPerson() { StringInputDialog addPersonDialog = new StringInputDialog { Title = "Creazione nuova Persona", Message = "Nome:" }; if (addPersonDialog.ShowDialog() != true) { return(null); } Person newPerson = new Person { Name = addPersonDialog.InputString }; foreach (PersonRole prr in _lInstData.RunQuery(new PersonRolesQuery())) { PersonRoleMapping tempPRM = new PersonRoleMapping(); tempPRM.RoleID = prr.ID; tempPRM.IsSelected = false; newPerson.RoleMappings.Add(tempPRM); } _lInstData.Execute(new InsertEntityCommand <LInstContext>(newPerson)); return(newPerson); }
private void SaveImageIfNeeded(System.Drawing.Bitmap bitmap) { try { if (MainWindow.UserPrefs.IsSaveOcrImage) { var saveFolder = MainWindow.UserPrefs.SaveOcrImageFolder; if (!String.IsNullOrWhiteSpace(saveFolder) && Directory.Exists(saveFolder)) { StringInputDialog dialog = new StringInputDialog(this, "Entry Name", searchPage.searchTextBox.Text); if (dialog.ShowDialog() == true) { string fileName = DateTime.UtcNow.Ticks.ToString() + ".bmp"; char seperator = System.IO.Path.DirectorySeparatorChar; bitmap.Save(saveFolder + seperator + fileName, System.Drawing.Imaging.ImageFormat.Bmp); using (var writer = new StreamWriter(saveFolder + seperator + OCR_IMAGE_SAVE_ENTRY_LIST, true)) { writer.WriteLine(OCR_ENTRY_SEPERATOR + fileName + OCR_ENTRY_SEPERATOR + dialog.InputText); } } } else { UIUtilities.ShowErrorDialog("Please choose a valid folder path first!"); } } } catch (Exception e) { UIUtilities.ShowErrorDialog(e.Message + "\n" + e.StackTrace); } }
public UserRole CreateNewUserRole() { StringInputDialog addPersonDialog = new StringInputDialog { Title = "Creazione nuovo Ruolo Utente", Message = "Nome:" }; if (addPersonDialog.ShowDialog() != true) { return(null); } UserRole newRole = new UserRole { Name = addPersonDialog.InputString, Description = "" }; _lInstData.Execute(new InsertEntityCommand <LInstContext>(newRole)); foreach (User usr in _lInstData.RunQuery(new UsersQuery())) { UserRoleMapping newMap = new UserRoleMapping { IsSelected = false, UserRoleID = newRole.ID, UserID = usr.ID }; _lInstData.Execute(new InsertEntityCommand <LInstContext>(newMap)); } return(newRole); }
public TLSTEntryNode NewEntry() { if (Resource.Children.Count >= 255) { return(null); } StringInputDialog d = new StringInputDialog("New TLST Entry", ""); if (d.ShowDialog() == DialogResult.OK) { // Get an unused expanded song id uint songID = 0x0000F000; while (Resource.Children.Count(n => ((TLSTEntryNode)n)._songID == songID) > 0) { songID++; } TLSTEntryNode node = new TLSTEntryNode { _name = d.resultString, _songID = songID, Volume = 80, Frequency = 40 }; _resource.AddChild(node); BaseWrapper w = FindResource(node, false); w.EnsureVisible(); w.TreeView.SelectedNode = w; return(node); } return(null); }
private void BtnAddSub_Click(object sender, EventArgs e) { using (StringInputDialog d = new StringInputDialog("Github link to a repository:", "")) { if (d.ShowDialog(this) == DialogResult.OK) { Regex rgx = new Regex(".*[Gg][Ii][Tt][Hh][Uu][Bb][.][Cc][Oo][Mm]/([^/\n]+)/([^/\n]+)[^\n]*"); Match m = rgx.Match(d.resultString); if (m.Success && m.Groups.Count == 3) { string repoOwner = m.Groups[1].Value; string repoName = m.Groups[2].Value; if (repoOwner.Equals("soopercool101", StringComparison.OrdinalIgnoreCase) || MessageBox.Show( $"Warning: The {repoOwner}/{repoName} repository is not affiliated with the BrawlCrate Developement Team.\n" + "You should only install scripts from sources you trust. Would you like to proceed?", "API Subscription Updater", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { UpdaterHelper.BrawlAPIInstallUpdate(true, repoOwner, repoName, true); GetNewFiles(); RefreshList(); } } else { MessageBox.Show($"{d.resultString} is not a valid GitHub repository.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private static void ExecuteSuffix(BoneViewModel target) { var dialog = new StringInputDialog("Suffix Names in Hierarchy..."); bool result = dialog.ShowDialog() ?? false; if (result) { SuffixRecursive(target, dialog.Value); } }
private void btnEditSetting_Click(object sender, RoutedEventArgs e) { SelectableItem si = selSheetSettings.GetSelectedItemsOfType <SelectableItem>().First(); if (si.Tag is KeyValuePair <string, string?> kvp) { StringInputDialog sid = new StringInputDialog(App.ColorScheme, "Set Setting Value", "Set the value for the setting \"" + kvp.Key + "\":", kvp.Value ?? ""); sid.SelectTextOnFocus = true; sid.ShowDialog(); if (sid.DialogResult) { si.Tag = new KeyValuePair <string, string?>(kvp.Key, sid.Value); si.Text = "Name: \"" + kvp.Key + "\", Value: \"" + sid.Value + "\""; } } }
public Property CreateNewProperty() { StringInputDialog creationDialog = new StringInputDialog(); creationDialog.Title = "Crea nuova Proprietà"; if (creationDialog.ShowDialog() == true) { Property output = new Property(); output.Name = creationDialog.InputString; _labDbData.Execute(new InsertEntityCommand(output)); return(output); } return(null); }
public OrganizationRole CreateNewOrganizationRole() { StringInputDialog creationDialog = new StringInputDialog(); creationDialog.Title = "Crea nuovo Ruolo Organizzazione"; if (creationDialog.ShowDialog() == true) { OrganizationRole output = new OrganizationRole(); output.Description = ""; output.Name = creationDialog.InputString; _lInstData.Execute(new InsertEntityCommand <LInstContext>(output)); CreateMappingsForNewRole(output); return(output); } return(null); }
public OrganizationRole CreateNewOrganizationRole() { StringInputDialog creationDialog = new StringInputDialog(); creationDialog.Title = "Crea nuovo Ruolo Organizzazione"; if (creationDialog.ShowDialog() == true) { OrganizationRole output = new OrganizationRole(); output.Description = ""; output.Name = creationDialog.InputString; output.Create(); CreateMappingsForNewRole(output); return(output); } return(null); }
public ASLSEntryNode NewEntry() { StringInputDialog d = new StringInputDialog("New ASLS Entry", Resource.HasChildren ? Resource.Children[0].Name : ""); if (d.ShowDialog() == DialogResult.OK) { ASLSEntryNode node = new ASLSEntryNode { _name = d.resultString }; _resource.AddChild(node); BaseWrapper w = FindResource(node, false); w.EnsureVisible(); w.TreeView.SelectedNode = w; return(node); } return(null); }
public InstrumentType CreateNewInstrumentType() { StringInputDialog creationDialog = new StringInputDialog { Title = "Crea nuovo Tipo strumenti" }; if (creationDialog.ShowDialog() == true) { InstrumentType output = new InstrumentType() { Name = creationDialog.InputString }; _lInstData.Execute(new InsertEntityCommand <LInstContext>(output)); return(output); } return(null); }
public MeasurableQuantity CreateNewMeasurableQuantity() { StringInputDialog creationDialog = new StringInputDialog { Title = "Crea nuova quantità misurabile" }; if (creationDialog.ShowDialog() == true) { MeasurableQuantity output = new MeasurableQuantity() { Name = creationDialog.InputString }; _labDbData.Execute(new InsertEntityCommand(output)); return(output); } return(null); }
public InstrumentType CreateNewInstrumentType() { StringInputDialog creationDialog = new StringInputDialog { Title = "Crea nuovo Tipo strumenti" }; if (creationDialog.ShowDialog() == true) { InstrumentType output = new InstrumentType() { Name = creationDialog.InputString }; output.Create(); return(output); } return(null); }
public Organization CreateNewOrganization() { StringInputDialog creationDialog = new StringInputDialog { Title = "Crea nuovo Ente" }; if (creationDialog.ShowDialog() == true) { Organization output = new Organization { Category = "", Name = creationDialog.InputString }; foreach (OrganizationRole orr in _labDbData.RunQuery(new OrganizationRolesQuery())) { OrganizationRoleMapping tempORM = new OrganizationRoleMapping { IsSelected = false, RoleID = orr.ID }; output.RoleMapping.Add(tempORM); } output.Create(); EntityChangedToken token = new EntityChangedToken(output, EntityChangedToken.EntityChangedAction.Created); _eventAggregator.GetEvent <OrganizationChanged>() .Publish(token); return(output); } else { return(null); } }
public Organization CreateNewOrganization() { StringInputDialog creationDialog = new StringInputDialog { Title = "Crea nuovo Ente" }; if (creationDialog.ShowDialog() == true) { Organization output = new Organization { Name = creationDialog.InputString }; foreach (OrganizationRole orr in _lInstData.RunQuery(new OrganizationRolesQuery())) { OrganizationRoleMapping tempORM = new OrganizationRoleMapping { IsSelected = false, OrganizationRoleID = orr.ID }; output.RoleMappings.Add(tempORM); } _lInstData.Execute(new InsertEntityCommand <LInstContext>(output)); EntityChangedToken token = new EntityChangedToken(output, EntityChangedToken.EntityChangedAction.Created); _eventAggregator.GetEvent <EntityChanged>() .Publish(token); return(output); } else { return(null); } }
public PersonRole CreateNewPersonRole() { StringInputDialog addPersonRoleDialog = new StringInputDialog(); addPersonRoleDialog.Title = "Creazione nuovo Ruolo Persona"; addPersonRoleDialog.Message = "Nome:"; if (addPersonRoleDialog.ShowDialog() != true) { return(null); } PersonRole newRole = new PersonRole { Name = addPersonRoleDialog.InputString, Description = "" }; using (LInstContext entities = _dbContextFactory.CreateDbContext(new string[] { })) { entities.PersonRoles.Add(newRole); foreach (Person per in entities.People) { PersonRoleMapping newMapping = new PersonRoleMapping { Person = per, IsSelected = false }; newRole.RoleMappings.Add(newMapping); } entities.SaveChanges(); } return(newRole); }