public void DatabaseToSchema(DatabaseFilter filter, bool autoFillSchema) { _filter = filter; Task.Factory.StartNew(() => { DatabaseToSchema(autoFillSchema); }); }
private void LoadFilter() { DatabaseFilter filter = formMain.currentFilter; // RAM filterRam.Value = (filter.ram.HasValue) ? (int)filter.ram : filterRam.MaximumValue; // Weight filterWeight.RangeMin = (filter.weightLower.HasValue) ? (int)filter.weightLower : 0; filterWeight.RangeMax = (filter.weightUpper.HasValue) ? (int)filter.weightUpper : filterWeight.MaximumRange; // Width filterWidth.Value = (filter.width.HasValue) ? (int)filter.width : filterWidth.MaximumValue; // Height filterHeight.Value = (filter.height.HasValue) ? (int)filter.height : filterHeight.MaximumValue; // Depth filterDepth.Value = (filter.depth.HasValue) ? (int)filter.depth : filterDepth.MaximumValue; // Resolution width filterResolutionWidth.Value = (filter.resolutionWidth.HasValue) ? (int)filter.resolutionWidth : filterResolutionWidth.MaximumValue; // Resolution height filterResolutionHeight.Value = (filter.resolutionHeight.HasValue) ? (int)filter.resolutionHeight : filterResolutionHeight.MaximumValue; // CPU filterComboBoxCpu.SelectedIndex = (!String.IsNullOrEmpty(filter.cpu)) ? cpus.IndexOf(filter.cpu) : 0; // Inconsistent filterCheckBox.Checked = filter.inconsistent; LoadText(); }
public void Push(DatabaseFilter input, string file, uint line) { RakNetPINVOKE.RakNetListDatabaseFilter_Push(swigCPtr, DatabaseFilter.getCPtr(input), file, line); if (RakNetPINVOKE.SWIGPendingException.Pending) { throw RakNetPINVOKE.SWIGPendingException.Retrieve(); } }
public void Replace(DatabaseFilter input) { RakNetPINVOKE.RakNetListDatabaseFilter_Replace__SWIG_1(swigCPtr, DatabaseFilter.getCPtr(input)); if (RakNetPINVOKE.SWIGPendingException.Pending) { throw RakNetPINVOKE.SWIGPendingException.Retrieve(); } }
public void Replace(DatabaseFilter input, DatabaseFilter filler, uint position, string file, uint line) { RakNetPINVOKE.RakNetListDatabaseFilter_Replace__SWIG_0(swigCPtr, DatabaseFilter.getCPtr(input), DatabaseFilter.getCPtr(filler), position, file, line); if (RakNetPINVOKE.SWIGPendingException.Pending) { throw RakNetPINVOKE.SWIGPendingException.Retrieve(); } }
public DatabaseFactory UseDatabaseFilter(DatabaseFilter filter) { if (filter != null) { _databaseFilter = filter; } return(this); }
/// <summary> /// Called, when selected top filter changed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TopSearch_onItemSelected(object sender, EventArgs e) { if (!topSearch.selectedValue.Equals("no filter")) { currentFilter = new DatabaseFilter(topSearch.selectedValue); connector.insertPattern(currentFilter.ToString()); } else { currentFilter = null; } ApplyFilter(); }
public void QueryTable(string tableName, string queryPassword, string[] columnNamesSubset, byte numColumnSubset, DatabaseFilter [] filter, byte numFilters, uint[] rowIds, byte numRowIDs, SystemAddress systemAddress, bool broadcast) { RakNetListDatabaseFilter filtersList =null; if (filter!=null) { filtersList = new RakNetListDatabaseFilter(); int listLen = filter.Length; for (int i = 0; i < listLen; i++) { filtersList.Insert(filter[i], "", 1); } } QueryTableHelper(tableName, queryPassword, columnNamesSubset, numColumnSubset, filtersList, numFilters, rowIds, numRowIDs, systemAddress, broadcast); }
private void FilterDatabases() { IEnumerable <DmsDatabaseServerViewModel> databases = Databases.Where( x => x.DatabaseName.ToLower().Contains(DatabaseFilter.ToLower()) && x.Organism.ToLower().Contains(m_organismFilter.ToLower())) .OrderBy(x => x.DatabaseName.ToLower()); FilteredDatabases.Clear(); foreach (var server in databases) { FilteredDatabases.Add(server); } }
public DatabaseFilter Get(uint position) { DatabaseFilter ret = new DatabaseFilter(RakNetPINVOKE.RakNetListDatabaseFilter_Get(swigCPtr, position), false); return ret; }
/// <summary> /// Send filter to main form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FilterButton_Click(object sender, EventArgs e) { int?ram = null; if (filterRam.Value != filterRam.MaximumValue) { ram = filterRam.Value; } int?weightLower = null; if (filterWeight.RangeMin != 0) { weightLower = filterWeight.RangeMin; } int?weightUpper = null; if (filterWeight.RangeMax != filterWeight.MaximumRange) { weightUpper = filterWeight.RangeMax; } int?width = null; if (filterWidth.Value != filterWidth.MaximumValue) { width = filterWidth.Value; } int?height = null; if (filterHeight.Value != filterHeight.MaximumValue) { height = filterHeight.Value; } int?depth = null; if (filterDepth.Value != filterDepth.MaximumValue) { depth = filterDepth.Value; } int?resolutionWidth = null; if (filterResolutionWidth.Value != filterResolutionWidth.MaximumValue) { resolutionWidth = filterResolutionWidth.Value; } int?resolutionHeight = null; if (filterResolutionHeight.Value != filterResolutionHeight.MaximumValue) { resolutionHeight = filterResolutionHeight.Value; } String cpu = null; if (!filterComboBoxCpu.SelectedItem.ToString().Equals("any")) { cpu = filterComboBoxCpu.SelectedItem.ToString(); } bool inconsistent = filterCheckBox.Checked; DatabaseFilter df = new DatabaseFilter(ram, weightLower, weightUpper, width, height, depth, resolutionWidth, resolutionHeight, cpu, inconsistent); formMain.currentFilter = df; formMain.connector.insertPattern(df.ToString()); formMain.RefreshFilterList(); formMain.ApplyFilter(); this.Hide(); }
public void Replace(DatabaseFilter input, DatabaseFilter filler, uint position, string file, uint line) { RakNetPINVOKE.RakNetListDatabaseFilter_Replace__SWIG_0(swigCPtr, DatabaseFilter.getCPtr(input), DatabaseFilter.getCPtr(filler), position, file, line); if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve(); }
internal static HandleRef getCPtr(DatabaseFilter obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
public DatabaseFilter Pop() { DatabaseFilter ret = new DatabaseFilter(RakNetPINVOKE.RakNetListDatabaseFilter_Pop(swigCPtr), false); return(ret); }
public DatabaseFilter Get(uint position) { DatabaseFilter ret = new DatabaseFilter(RakNetPINVOKE.RakNetListDatabaseFilter_Get(swigCPtr, position), false); return(ret); }
public DatabaseFilter Pop() { DatabaseFilter ret = new DatabaseFilter(RakNetPINVOKE.RakNetListDatabaseFilter_Pop(swigCPtr), false); return ret; }
public void Push(DatabaseFilter input, string file, uint line) { RakNetPINVOKE.RakNetListDatabaseFilter_Push(swigCPtr, DatabaseFilter.getCPtr(input), file, line); if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve(); }
public async Task AddAsync(CommandContext ctx, [RemainingText, Description("Filter list. Filter is a regular expression (case insensitive).")] params string[] filters) { if (filters is null || !filters.Any()) { throw new InvalidCommandUsageException("Filter regexes missing."); } var eb = new StringBuilder(); using (DatabaseContext db = this.Database.CreateContext()) { foreach (string regexString in filters) { if (regexString.Contains('%')) { eb.AppendLine($"Error: Filter {Formatter.InlineCode(regexString)} cannot contain '%' character."); continue; } if (regexString.Length < 3 || regexString.Length > 120) { eb.AppendLine($"Error: Filter {Formatter.InlineCode(regexString)} doesn't fit the size requirement. Filters cannot be shorter than 3 and longer than 120 characters."); continue; } if (this.Shared.GuildHasTextReaction(ctx.Guild.Id, regexString)) { eb.AppendLine($"Error: Filter {Formatter.InlineCode(regexString)} cannot be added because of a conflict with an existing text reaction trigger."); continue; } if (!regexString.TryParseRegex(out Regex regex)) { eb.AppendLine($"Error: Filter {Formatter.InlineCode(regexString)} is not a valid regular expression."); continue; } if (ctx.CommandsNext.RegisteredCommands.Any(kvp => regex.IsMatch(kvp.Key))) { eb.AppendLine($"Error: Filter {Formatter.InlineCode(regexString)} collides with an existing bot command."); continue; } if (this.Shared.Filters.TryGetValue(ctx.Guild.Id, out ConcurrentHashSet <Filter> existingFilters)) { if (existingFilters.Any(f => f.BaseRegexString == regex.ToString())) { eb.AppendLine($"Error: Filter {Formatter.InlineCode(regexString)} already exists."); continue; } } else { if (!this.Shared.Filters.TryAdd(ctx.Guild.Id, new ConcurrentHashSet <Filter>())) { throw new ConcurrentOperationException("Failed to create filter data structure for this guild. This is bad!"); } } var filter = new DatabaseFilter { GuildId = ctx.Guild.Id, Trigger = regexString }; db.Filters.Add(filter); await db.SaveChangesAsync(); if (filter.Id == 0 || !this.Shared.Filters[ctx.Guild.Id].Add(new Filter(filter.Id, regexString))) { eb.AppendLine($"Error: Failed to add filter {Formatter.InlineCode(regexString)}."); } } } DiscordChannel logchn = this.Shared.GetLogChannelForGuild(ctx.Client, ctx.Guild); if (!(logchn is null)) { var emb = new DiscordEmbedBuilder { Title = "Filter addition occured", Color = this.ModuleColor }; emb.AddField("User responsible", ctx.User.Mention, inline: true); emb.AddField("Invoked in", ctx.Channel.Mention, inline: true); emb.AddField("Tried adding filters", string.Join("\n", filters.Select(rgx => Formatter.InlineCode(rgx)))); if (eb.Length > 0) { emb.AddField("Errors", eb.ToString()); } await logchn.SendMessageAsync(embed : emb.Build()); } if (eb.Length > 0) { await this.InformFailureAsync(ctx, $"Action finished with warnings/errors:\n\n{eb.ToString()}"); } else { await this.InformAsync(ctx, "Successfully added all given filters!", important : false); } }
public void Replace(DatabaseFilter input) { RakNetPINVOKE.RakNetListDatabaseFilter_Replace__SWIG_1(swigCPtr, DatabaseFilter.getCPtr(input)); if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve(); }
internal static HandleRef getCPtr(DatabaseFilter obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }