/// <summary> /// 去除HTML标签 /// </summary> /// <param name="content">内容</param> /// <returns></returns> public static string RemoveHTML(string content, FilterOptions options = FilterOptions.Html|FilterOptions.Head|FilterOptions.Meta|FilterOptions.Link|FilterOptions.Script) { try { content = content.Replace(" ", " ").Replace("<", "<").Replace(">", ">").Replace("&", "&").Replace(""", "\"").Replace("£", "£").Replace("¥", "¥").Replace("€", "€").Replace("©", "©").Replace("®", "®").Replace("™", "™").Replace("×", "×").Replace("÷", "÷").Replace("¦", "¦"); content = FilterNewLine(content); content = FilterSpace(content); content = Regex.Replace(content, "(<doctype|<!doctype)([^>])*(>)", "$1$3", RegexOptions.IgnoreCase); content = Regex.Replace(content, "(<)(html|head|title|meta|link|script|body|center|strong|form|textarea|input|table|span|font|img|div|h1|h2|h3|td|tr|ol|ul|li|br|tt|em|a|b|s|i|p)([^>])*(>)", "$1$2$4", RegexOptions.IgnoreCase); if ((options & FilterOptions.Head) > 0) content = FilterHead(content); if ((options & FilterOptions.Meta) > 0) content = FilterMeta(content); if ((options & FilterOptions.Link) > 0) content = FilterLink(content); if ((options & FilterOptions.Script) > 0) content = FilterScript(content); if ((options & FilterOptions.Html) > 0) content = FilterHtml(content); return content; } catch (Exception ex) { return string.Empty; } }
public void FilterShouldCorrectlyProcessPrice() { var query = TestEntityFactory.GetEntityList().AsQueryable<TestEntity>(); FilterOptions filter = new FilterOptions(); filter.Filter.Filters.Add(new FilterField(FilterFieldOperator.Equals, "Price", "7.70")); int expected = 1; query.Filter<TestEntity>(filter); Assert.AreEqual(expected, filter.Total); }
public IEnumerable<Object> GetFilteredParts(string regex = "", FilterOptions filterOptions = FilterOptions.None) { IList<Object> list = new List<Object>(); foreach (Car.Part p in storehouse.GetFilteredParts(regex)) { list.Add(p.GetFullName(filterOptions)); } return list.AsEnumerable().Distinct(); // No duplicates }
public void ExtractFieldShouldReturnTheFieldAndRemoveItFromTheFilter() { FilterOptions target = new FilterOptions(); target.Filter.Filters.Add(new FilterField { Field = "Date", Operator = FilterFieldOperator.Equals, Value = DateTime.Now.ToString() }); target.Filter.Filters.Add(new FilterField { Field = "Name", Operator = FilterFieldOperator.Contains, Value = "Test" }); var actual = target.ExtractField("name"); Assert.AreEqual("Test", actual.Value); Assert.AreEqual(1, target.Filter.Filters.Count); }
/// <summary> /// Constructor /// </summary> /// <param name="efsSystem">The EFSSystem for which this rule set selector is created</param> /// <param name="Options">The options used to filter the selection</param> public DictionarySelector(EFSSystem efsSystem, FilterOptions Options = FilterOptions.None, Dictionary UpdatedDictionary = null) { InitializeComponent(); options = Options; updatedDictionary = UpdatedDictionary; EFSSystem = efsSystem; }
public void FilterShouldCorrectlyProcessStringContains() { var query = TestEntityFactory.GetEntityList().AsQueryable<TestEntity>(); FilterOptions filter = new FilterOptions(); filter.Filter.Filters.Add(new FilterField(FilterFieldOperator.Contains, "Name", "G")); int expected = 3; query.Filter<TestEntity>(filter); Assert.AreEqual(expected, filter.Total); }
public void FilterShouldCorrectlyProcessDateTime() { var query = TestEntityFactory.GetEntityList().AsQueryable<TestEntity>(); FilterOptions filter = new FilterOptions(); filter.Filter.Filters.Add(new FilterField(FilterFieldOperator.Equals, "Date", DateTime.Now.AddDays(5).Date.ToString())); int expected = 1; query.Filter<TestEntity>(filter); Assert.AreEqual(expected, filter.Total); }
public TextureCreationParameters(int width, int height, int depth, int mipLevels, SurfaceFormat format, ResourceUsage resourceUsage, ResourceManagementMode resourceManagementMode, Color colorKey, FilterOptions filter, FilterOptions mipFilter) { m_Width = width; m_Height = height; m_Depth = depth; m_MipLevels = mipLevels; m_Format = format; m_ResourceUsage = resourceUsage; m_ResourceManagementMode = resourceManagementMode; m_ColorKey = colorKey; m_Filter = filter; m_MipFilter = mipFilter; }
private bool AndNot(Type type, FilterOptions filter, DataRow row) { var typeCode = Type.GetTypeCode(type); if (typeCode == TypeCode.Byte || typeCode == TypeCode.UInt16 || typeCode == TypeCode.UInt32 || typeCode == TypeCode.UInt64) { if (((ulong)Convert.ChangeType(row[filter.Column], typeof(ulong), CultureInfo.InvariantCulture) & Convert.ToUInt64(filter.Value, CultureInfo.InvariantCulture)) == 0) return true; return false; } else if (typeCode == TypeCode.SByte || typeCode == TypeCode.Int16 || typeCode == TypeCode.Int32 || typeCode == TypeCode.Int64) { if (((long)Convert.ChangeType(row[filter.Column], typeof(long), CultureInfo.InvariantCulture) & Convert.ToInt64(filter.Value, CultureInfo.InvariantCulture)) == 0) return true; return false; } else return false; }
/// <summary> /// Constructor /// </summary> /// <param name="options">The options used to filter the selection</param> /// <param name="updatedDictionary"></param> public DictionarySelector(FilterOptions options = FilterOptions.None, Dictionary updatedDictionary = null) { InitializeComponent(); Options = options; UpdatedDictionary = updatedDictionary; ArrayList entries = new ArrayList(); foreach (Dictionary dictionary in EfsSystem.Instance.Dictionaries) { if (AddToEntries(dictionary)) { entries.Add(new ListBoxEntry(dictionary)); } } dataDictionaryListBox.DataSource = entries; dataDictionaryListBox.DisplayMember = "Name"; if (entries.Count > 0) { dataDictionaryListBox.ValueMember = "Dictionary"; } }
/// <summary> /// Sets the filtering options for a given texture unit. /// </summary> /// <param name="unit">The texture unit to set the filtering options for.</param> /// <param name="minFilter">The filter used when a texture is reduced in size.</param> /// <param name="magFilter">The filter used when a texture is magnified.</param> /// <param name="mipFilter"> /// The filter used between mipmap levels, <see cref="FilterOptions.None"/> disables mipmapping. /// </param> public void SetTextureUnitFiltering(int unit, FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter) { SetTextureUnitFiltering(unit, FilterType.Min, minFilter); SetTextureUnitFiltering(unit, FilterType.Mag, magFilter); SetTextureUnitFiltering(unit, FilterType.Mip, mipFilter); }
/// <summary> /// Initializes a new instance of the <see cref="PostgreSqlDeleteSet"/> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The options.</param> public PostgreSqlDeleteSet(PostgreSqlDataSourceBase dataSource, PostgreSqlObjectName tableName, object filterValue, FilterOptions filterOptions) : base(dataSource, filterValue, filterOptions) { m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); }
public Task <LogObjectResult> GetLogs(FilterOptions filterOptions) { throw new NotImplementedException(); }
/// <summary> /// Adds (or replaces) the filter on this command builder. /// </summary> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The filter options.</param> public TableDbCommandBuilder <TCommand, TParameter, TLimit> WithFilter(object filterValue, FilterOptions filterOptions = FilterOptions.None) => OnWithFilter(filterValue, filterOptions);
/// <summary> /// Adds (or replaces) the filter on this command builder. /// </summary> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The filter options.</param> /// <returns>TableDbCommandBuilder<NpgsqlCommand, NpgsqlParameter, PostgreSqlLimitOption>.</returns> public override TableDbCommandBuilder <NpgsqlCommand, NpgsqlParameter, PostgreSqlLimitOption> WithFilter(object filterValue, FilterOptions filterOptions = FilterOptions.None) { m_FilterValue = filterValue; m_WhereClause = null; m_ArgumentValue = null; m_FilterOptions = filterOptions; return(this); }
private bool StartWith(FilterOptions filter, DataRow row) { if (row.Field<string>(filter.Column).StartsWith(filter.Value, checkBox2.Checked ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal)) return true; return false; }
public GLES2RenderSystem() { this.depthWrite = true; this.stencilMask = 0xFFFFFFFF; this.gpuProgramManager = null; this.glslESProgramFactory = null; this.hardwareBufferManager = null; this.rttManager = null; int i; LogManager.Instance.Write( this.Name + " created." ); this.renderAttribsBound = new List<int>( 100 ); #if RTSHADER_SYSTEM_BUILD_CORE_SHADERS enableFixedPipeline = false; #endif this.CreateGlSupport(); this.worldMatrix = Matrix4.Identity; this.viewMatrix = Matrix4.Identity; this.glSupport.AddConfig(); this.colorWrite[ 0 ] = this.colorWrite[ 1 ] = this.colorWrite[ 2 ] = this.colorWrite[ 3 ] = true; for ( i = 0; i < Config.MaxTextureLayers; i++ ) { //Dummy value this.textureCoordIndex[ i ] = 99; this.textureTypes[ i ] = 0; } activeRenderTarget = null; this.currentContext = null; this.mainContext = null; this.glInitialized = false; this.minFilter = FilterOptions.Linear; this.mipFilter = FilterOptions.Point; this.currentVertexProgram = null; this.currentFragmentProgram = null; //todo //polygonMode = GL_FILL; }
/// <summary> /// Deletes multiple records using a filter object. /// </summary> /// <param name="tableName">Name of the table.</param> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The options.</param> public MultipleRowDbCommandBuilder <OleDbCommand, OleDbParameter> DeleteWithFilter(AccessObjectName tableName, object filterValue, FilterOptions filterOptions = FilterOptions.None) { var table = DatabaseMetadata.GetTableOrView(tableName); if (!AuditRules.UseSoftDelete(table)) { return(new AccessDeleteMany(this, tableName, filterValue, filterOptions)); } return(new AccessUpdateMany(this, tableName, null, UpdateOptions.SoftDelete | UpdateOptions.IgnoreRowsAffected).WithFilter(filterValue, filterOptions)); }
public override void SetTextureUnitFiltering( int unit, FilterType ftype, FilterOptions fo ) { if (!ActivateGLTextureUnit(unit)) return; switch (ftype) { case FilterType.Min: minFilter = fo; // Combine with existing mip filter Gl.glTexParameteri( textureTypes[unit], Gl.GL_TEXTURE_MIN_FILTER, GetCombinedMinMipFilter()); break; case FilterType.Mag: switch (fo) { case FilterOptions.Anisotropic: // GL treats linear and aniso the same case FilterOptions.Linear: Gl.glTexParameteri( textureTypes[unit], Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_LINEAR); break; case FilterOptions.Point: case FilterOptions.None: Gl.glTexParameteri( textureTypes[unit], Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_NEAREST); break; } break; case FilterType.Mip: mipFilter = fo; // Combine with existing min filter Gl.glTexParameteri( textureTypes[unit], Gl.GL_TEXTURE_MIN_FILTER, GetCombinedMinMipFilter()); break; } ActivateGLTextureUnit(0); }
/// <summary> /// Adds (or replaces) the filter on this command builder. /// </summary> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The filter options.</param> TableDbCommandBuilder <TCommand, TParameter, TLimit, TObject> OnWithFilterTyped(object filterValue, FilterOptions filterOptions = FilterOptions.None) => (TableDbCommandBuilder <TCommand, TParameter, TLimit, TObject>)OnWithFilter(filterValue, filterOptions);
/// <summary> /// Creates a <see cref="AccessTableOrView" /> used to directly query a table or view /// </summary> /// <param name="tableOrViewName">Name of the table or view.</param> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The filter options.</param> /// <returns>TableDbCommandBuilder<OleDbCommand, OleDbParameter, AccessLimitOption>.</returns> public TableDbCommandBuilder <OleDbCommand, OleDbParameter, AccessLimitOption> From(AccessObjectName tableOrViewName, object filterValue, FilterOptions filterOptions = FilterOptions.None) { return(new AccessTableOrView(this, tableOrViewName, filterValue, filterOptions)); }
ITableDbCommandBuilder <TObject> ITableDbCommandBuilder <TObject> .WithFilter(object filterValue, FilterOptions filterOptions) => WithFilter(filterValue, filterOptions);
TableDbCommandBuilder <SqlCommand, SqlParameter, SqlServerLimitOption, TObject> OnFromTableOrView <TObject>(SqlServerObjectName tableOrViewName, object filterValue, FilterOptions filterOptions) where TObject : class { return(new SqlServerTableOrView <TObject>(this, tableOrViewName, filterValue, filterOptions)); }
MultipleRowDbCommandBuilder <SqlCommand, SqlParameter> OnDeleteMany(SqlServerObjectName tableName, object filterValue, FilterOptions filterOptions) { return(new SqlServerDeleteMany(this, tableName, filterValue, filterOptions)); }
public override void SetTextureUnitFiltering( int unit, FilterType ftype, FilterOptions fo ) { if ( !this.ActivateGLTextureUnit( unit ) ) return; switch ( ftype ) { case FilterType.Min: if ( this._textureMipmapCount == 0 ) { _minFilter = FilterOptions.None; } else { _minFilter = fo; } // Combine with existing mip filter GL.TexParameter( All.Texture2D, All.TextureMinFilter, CombinedMinMipFilter ); GLESConfig.GlCheckError( this ); break; case FilterType.Mag: switch ( fo ) { case FilterOptions.Anisotropic: // GL treats linear and aniso the same case FilterOptions.Linear: GL.TexParameter( All.Texture2D, All.TextureMagFilter, (int)All.Linear ); GLESConfig.GlCheckError( this ); break; case FilterOptions.Point: case FilterOptions.None: GL.TexParameter( All.Texture2D, All.TextureMagFilter, (int)All.Nearest ); GLESConfig.GlCheckError( this ); break; } break; case FilterType.Mip: if ( _textureMipmapCount == 0 ) { _mipFilter = FilterOptions.None; } else { _mipFilter = fo; } // Combine with existing min filter GL.TexParameter( All.Texture2D, All.TextureMinFilter, CombinedMinMipFilter ); GLESConfig.GlCheckError( this ); break; } ActivateGLTextureUnit( 0 ); }
public GLRenderSystem() { depthWrite = true; stencilMask = unchecked((int)0xffffffff); LogManager.Instance.Write( "{0} created.", Name ); // create _glSupport = new GLSupport(); worldMatrix = Matrix4.Identity; viewMatrix = Matrix4.Identity; InitConfigOptions(); ColorWrite[ 0 ] = ColorWrite[ 1 ] = ColorWrite[ 2 ] = ColorWrite[ 3 ] = 1; for ( var i = 0; i < Config.MaxTextureCoordSets; i++ ) { texCoordIndex[ i ] = 99; textureTypes[ i ] = 0; } // init the stored stencil buffer params stencilFail = stencilZFail = stencilPass = Gl.GL_KEEP; stencilFunc = Gl.GL_ALWAYS; stencilRef = 0; minFilter = FilterOptions.Linear; mipFilter = FilterOptions.Point; }
private bool Contains(FilterOptions filter, DataRow row) { if (checkBox2.Checked) { if (row.Field<string>(filter.Column).ToUpperInvariant().Contains(filter.Value.ToUpperInvariant())) return true; return false; } else { if (row.Field<string>(filter.Column).Contains(filter.Value)) return true; return false; } }
public SearchResult Search(FilterOptions options) { if (options == null) { options = new FilterOptions(); } var culture = StrixPlatform.CurrentCultureCode; var result = new SearchResult(); result.Locators = PageRegistration.ContentLocators; var typesTosearch = EntityHelper.EntityTypes.Where(e => e.Name != typeof(MailContentTemplate).FullName && e.Name != typeof(MailContent).FullName).ToList(); var itemsToSkip = options.PageSize == 1 ? 0 : options.PageSize * (options.Page - 1); // Todo: make configurable. var itemsToGet = options.PageSize == 0 ? 100 : options.PageSize; foreach (var entityType in typesTosearch) { var entryType = EntityHelper.GetEntityType(entityType.Id); var query = this._source.Query(entryType).Where("Culture.Equals(@0) AND IsCurrentVersion", culture); var queryEvent = new PrepareQueryEvent(query, options, false); StrixPlatform.RaiseEvent(queryEvent); query = queryEvent.Query; if (itemsToGet > 0) { if (entryType.Equals(typeof(Html))) { var htmlTypeName = typeof(Html).FullName; var htmlLocators = PageRegistration.ContentLocators.Where(l => l.ContentTypeName == htmlTypeName); var htmlQuery = query.Cast <Html>().Select(h => new { Name = h.Name, Url = h.Entity.Url }).ToList().Select(h => new { Name = h.Name, Url = htmlLocators.Where(l => l.ContentUrl.ToLower() == h.Url.ToLower()).Select(l => l.PageUrl).FirstOrDefault() }); query = htmlQuery.GroupBy(h => h.Url).Select(h => new Html { Name = h.Select(i => i.Url.ToTitleCase()).First(), Entity = new PlatformEntity { Id = Guid.Empty, Url = h.Select(i => i.Url).First() } }).AsQueryable(); } int addedItems = 0; var entries = query.Skip(itemsToSkip).Take(itemsToGet).Select <SearchItem>("new (Entity.Id, Name, Entity.Url)").ToList(); foreach (var entry in entries) { entry.TypeName = entryType.FullName; result.Data.Add(entry); addedItems++; } options.Total = 0; itemsToGet -= addedItems; } var queryCount = query.Count(); itemsToSkip -= queryCount; if (itemsToSkip < 0) { itemsToSkip = 0; } result.Total += queryCount; } return(result); }
public void SetAvailableFilters(AvailableFilters filters) { mnuFilter.DropDownItems.Clear(); m_filterSettings = new FilterOptions(); foreach (string key in filters.AllFilters) { System.Windows.Forms.ToolStripMenuItem newMenu = new System.Windows.Forms.ToolStripMenuItem(); newMenu.Text = filters.Get(key); newMenu.Tag = key; newMenu.Click += FilterClicked; mnuFilter.DropDownItems.Add(newMenu); } }
//public object MetadataCache { get; private set; } /// <summary> /// Initializes a new instance of the <see cref="SQLiteTableOrView{TObject}" /> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableOrViewName">Name of the table or view.</param> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The filter options.</param> public SQLiteTableOrView(SQLiteDataSourceBase dataSource, SQLiteObjectName tableOrViewName, object filterValue, FilterOptions filterOptions = FilterOptions.None) : base(dataSource) { m_FilterValue = filterValue; m_FilterOptions = filterOptions; m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableOrViewName); }
private void button2_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(textBox2.Text)) { MessageBox.Show("Enter something first!"); textBox2.Focus(); return; } var fi = new FilterOptions((string)listBox2.SelectedItem, (ComparisonType)comboBox3.SelectedItem, textBox2.Text); var dt = (Owner as MainForm).DataTable; var col = dt.Columns[fi.Column]; try { if (col.DataType.IsPrimitive && col.DataType != typeof(float) && col.DataType != typeof(double)) if (fi.Value.StartsWith("0x", true, CultureInfo.InvariantCulture)) fi.Value = Convert.ToUInt64(fi.Value, 16).ToString(CultureInfo.InvariantCulture); Convert.ChangeType(fi.Value, col.DataType, CultureInfo.InvariantCulture); } catch { MessageBox.Show("Invalid filter!"); return; } listBox1.Items.Add(fi); }
MultipleRowDbCommandBuilder <NpgsqlCommand, NpgsqlParameter> OnDeleteMany(PostgreSqlObjectName tableName, object filterValue, FilterOptions filterOptions) { return(new PostgreSqlDeleteMany(this, tableName, filterValue, filterOptions)); }
public IEnumerable List(FilterOptions filter) { return(this._roleManager.Query().Where(r => r.Name.ToLower() != Resources.DefaultValues.PermissionSetName.ToLower()).Filter(filter).Select(r => new RoleViewModel { Id = r.Id, Name = r.Name }).ToList()); }
TableDbCommandBuilder <NpgsqlCommand, NpgsqlParameter, PostgreSqlLimitOption> OnFromTableOrView(PostgreSqlObjectName tableOrViewName, object filterValue, FilterOptions filterOptions) { return(new PostgreSqlTableOrView(this, tableOrViewName, filterValue, filterOptions)); }
/// <summary> /// Initializes a new instance of the <see cref="PostgreSqlTableOrView" /> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableOrViewName">Name of the table or view.</param> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The filter options.</param> /// <exception cref="System.ArgumentException"></exception> /// <exception cref="ArgumentException"></exception> public PostgreSqlTableOrView(PostgreSqlDataSourceBase dataSource, PostgreSqlObjectName tableOrViewName, object filterValue, FilterOptions filterOptions = FilterOptions.None) : base(dataSource) { if (tableOrViewName == PostgreSqlObjectName.Empty) { throw new ArgumentException($"{nameof(tableOrViewName)} is empty", nameof(tableOrViewName)); } m_FilterValue = filterValue; m_FilterOptions = filterOptions; m_Table = DataSource.DatabaseMetadata.GetTableOrView(tableOrViewName); }
public virtual Task <LogObjectResult> GetLogs(FilterOptions filterOptions) { return(_proxyClient.GetLogs(filterOptions)); }
/// <summary> /// Runs the comparison report against the supplied filter /// </summary> /// <param name="_fitler">The filter we want to run against this KPA</param> /// <param name="_option">The filter option where this fitler was obtained</param> public override void RunComparison(string _filter, FilterOptions.Options _filterOption) { double totalDays = 0; try { // Remove any apostrophe's from the filter or an exception will be thrown CleanFilter(ref _filter); // Get the filtered data rows from the datatable DataRow[] filteredResult = DatabaseManager.prsOnPOsDt.Select(FilterOptions.GetSelectStatement(_filterOption, _filter)); foreach (DataRow dr in filteredResult) { //Check if the datarow meets the conditions of any applied filters. if (!FilterUtils.EvaluateAgainstFilters(dr)) { // This datarow dos not meet the conditions of the filters applied. continue; } string[] strFirstConfDate = (dr["1st Conf Date"].ToString()).Split('/'); int firstConfYear = int.Parse(strFirstConfDate[2]); int firstConfMonth = int.Parse(strFirstConfDate[0]); int firstConfDay = int.Parse(strFirstConfDate[1]); if (firstConfYear == 0 && firstConfMonth == 0 && firstConfDay == 0) { UnconfirmedTotal++; template.TotalRecords++; continue; } else { firstConfYear = int.Parse(strFirstConfDate[2]); firstConfMonth = int.Parse(strFirstConfDate[0].TrimStart('0')); firstConfDay = int.Parse(strFirstConfDate[1].TrimStart('0')); } DateTime firstConfDate = new DateTime(firstConfYear, firstConfMonth, firstConfDay); string[] strPRPlanDate = (dr["PR Delivery Date"].ToString()).Split('/'); int prDelYear = int.Parse(strPRPlanDate[2]); int prDelMonth = int.Parse(strPRPlanDate[0].TrimStart('0')); int prDelDay = int.Parse(strPRPlanDate[1].TrimStart('0')); DateTime prPlanDate = new DateTime(prDelYear, prDelMonth, prDelDay); double elapsedDays = (firstConfDate - prPlanDate).TotalDays; totalDays += elapsedDays; elapsedDays = (int)elapsedDays; // Add the elpased days against the time span conditions template.TimeSpanDump(elapsedDays); } // Calculate the average for this KPI template.CalculateAverage(totalDays); // Calculate the percent unconfirmed for this KPI CalculatePercentUnconfirmed(UnconfirmedTotal); // Calculate the percent favorable CalculatePercentFavorable(); } catch (Exception) { MessageBox.Show("An argument out of range exception was thrown", "KPI - Purch -> Initial Confirmation vs PR Plan Date - Comparison Run Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } }
public virtual Task <ulong> NewFilter(FilterOptions filterOptions) { return(_proxyClient.NewFilter(filterOptions)); }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <param name="options"></param> /// <param name="caps"></param> /// <param name="texType"></param> /// <returns></returns> public static D3D.TextureFilter ConvertEnum( FilterType type, FilterOptions options, D3D.Capabilities devCaps, D3DTextureType texType ) { // setting a default val here to keep compiler from complaining about using unassigned value types D3D.FilterCaps filterCaps = devCaps.TextureFilterCaps; switch ( texType ) { case D3DTextureType.Normal: filterCaps = devCaps.TextureFilterCaps; break; case D3DTextureType.Cube: filterCaps = devCaps.CubeTextureFilterCaps; break; case D3DTextureType.Volume: filterCaps = devCaps.VolumeTextureFilterCaps; break; } switch ( type ) { case FilterType.Min: { switch ( options ) { case FilterOptions.Anisotropic: if ( ( filterCaps & D3D.FilterCaps.MinAnisotropic ) == D3D.FilterCaps.MinAnisotropic ) { return D3D.TextureFilter.Anisotropic; } else { return D3D.TextureFilter.Linear; } case FilterOptions.Linear: if ( ( filterCaps & D3D.FilterCaps.MinLinear ) == D3D.FilterCaps.MinLinear ) { return D3D.TextureFilter.Linear; } else { return D3D.TextureFilter.Point; } case FilterOptions.Point: case FilterOptions.None: return D3D.TextureFilter.Point; } break; } case FilterType.Mag: { switch ( options ) { case FilterOptions.Anisotropic: if ( ( filterCaps & D3D.FilterCaps.MagAnisotropic ) == D3D.FilterCaps.MagAnisotropic ) { return D3D.TextureFilter.Anisotropic; } else { return D3D.TextureFilter.Linear; } case FilterOptions.Linear: if ( ( filterCaps & D3D.FilterCaps.MagLinear ) == D3D.FilterCaps.MagLinear ) { return D3D.TextureFilter.Linear; } else { return D3D.TextureFilter.Point; } case FilterOptions.Point: case FilterOptions.None: return D3D.TextureFilter.Point; } break; } case FilterType.Mip: { switch ( options ) { case FilterOptions.Anisotropic: case FilterOptions.Linear: if ( ( filterCaps & D3D.FilterCaps.MipLinear ) == D3D.FilterCaps.MipLinear ) { return D3D.TextureFilter.Linear; } else { return D3D.TextureFilter.Point; } case FilterOptions.Point: if ( ( filterCaps & D3D.FilterCaps.MipPoint ) == D3D.FilterCaps.MipPoint ) { return D3D.TextureFilter.Point; } else { return D3D.TextureFilter.None; } case FilterOptions.None: return D3D.TextureFilter.None; } break; } } // should never get here return 0; }
/// <summary> /// Adds (or replaces) the filter on this command builder. /// </summary> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The filter options.</param> /// <returns>TableDbCommandBuilder<SqlCommand, SqlParameter, SqlServerLimitOption>.</returns> protected override TableDbCommandBuilder <SqlCommand, SqlParameter, SqlServerLimitOption> OnWithFilter(object filterValue, FilterOptions filterOptions = FilterOptions.None) { m_FilterValue = filterValue; m_WhereClause = null; m_ArgumentValue = null; m_FilterOptions = filterOptions; return(this); }
/// <summary> /// Sets a single filter for a given texture unit. /// </summary> /// <param name="stage">The texture unit to set the filtering options for.</param> /// <param name="type">The filter type.</param> /// <param name="filter">The filter to be used.</param> public abstract void SetTextureUnitFiltering(int stage, FilterType type, FilterOptions filter);
public Task <ulong> NewFilter(FilterOptions filterOptions) { throw new System.NotImplementedException(); }
/// <summary> /// Default ctor. /// </summary> public GLESRenderSystem() { depthWrite = true; _stencilMask = 0xFFFFFFFF; int i; LogManager.Instance.Write( string.Format( "{0} created.", Name ) ); _glSupport = GLESUtil.GLESSupport; for ( i = 0; i < MaxLights; i++ ) _lights[ i ] = null; _worldMatrix = Matrix4.Identity; _ViewMatrix = Matrix4.Identity; _glSupport.AddConfig(); _colorWrite[ 0 ] = _colorWrite[ 1 ] = _colorWrite[ 2 ] = _colorWrite[ 3 ] = true; for ( int layer = 0; layer < Axiom.Configuration.Config.MaxTextureLayers; layer++ ) { // Dummy value _textureCoodIndex[ layer ] = 99; } _textureCount = 0; activeRenderTarget = null; _currentContext = null; _mainContext = null; _glInitialized = false; numCurrentLights = 0; _textureMipmapCount = 0; _minFilter = FilterOptions.Linear; _mipFilter = FilterOptions.Point; // _polygonMode = OpenTK.Graphics.ES11. }
/// <summary> /// Called when the dialog is closing. /// </summary> protected override void OnClosing() { _Context.RemoveContext("AddManageFilterStateInfo"); FilterOptions options = new FilterOptions(); SetFilterOptions(options); options.Save(); base.OnClosing(); Refresh(); }
private bool NotEqual(Type type, FilterOptions filter, DataRow row) { var value1 = (IComparable)row[filter.Column]; var value2 = (IComparable)Convert.ChangeType(filter.Value, type, CultureInfo.InvariantCulture); if (value1.CompareTo(value2) != 0) return true; return false; }
/// <summary> /// Sets the filter options. /// </summary> /// <param name="options">The options.</param> private void SetFilterOptions(FilterOptions options) { options.CompanyEnabled = chkCompany.Checked; options.CompanyOperator = (FilterOperator)lbxCompany.SelectedIndex; options.CompanyValue = txtCompany.Text; options.TitleEnabled = chkTitle.Checked; options.TitleOperator = (FilterOperator)lbxTitle.SelectedIndex; options.TitleValue = pklTitle.PickListValue; options.IndustryEnabled = chkIndustry.Checked; options.IndustryOperator = (FilterOperator)lbxIndustry.SelectedIndex; options.IndustryValue = pklIndustry.PickListValue; options.SICEnabled = chkSIC.Checked; options.SICOperator = (FilterOperator)lbxSIC.SelectedIndex; options.SICValue = txtSIC.Text; options.ProdOwnedEnabled = chkProducts.Checked; options.ProdOwnedOperator = (FilterOperator)lbxProducts.SelectedIndex; string prodOwnerID = lueProducts.ClientID + "_LookupText"; string prodOwner = Request.Form[prodOwnerID.Replace("_", "$")]; options.ProdOwnedValue = prodOwner; options.LeadSourceEnabled = chkLeadSource.Checked; options.LeadSourceOperator = (FilterOperator)lbxLeadSource.SelectedIndex; string leadSourceID = lueLeadSource.ClientID + "_LookupText"; string leadSource = Request.Form[leadSourceID.Replace("_", "$")]; options.LeadSourceValue = leadSource; options.StatusEnabled = chkStatus.Checked; options.StatusOperator = (FilterOperator)lbxStatus.SelectedIndex; options.StatusValue = pklStatus.PickListValue; options.StateEnabled = chkState.Checked; options.StateOperator = (FilterOperator)lbxState.SelectedIndex; options.StateValue = txtState.Text; options.PostalCodeEnabled = chkZip.Checked; options.PostalCodeOperator = (FilterOperator)lbxZip.SelectedIndex; options.PostalCodeValue = txtZip.Text; options.CityEnabled = chkCity.Checked; options.CityOperator = (FilterOperator)lbxCity.SelectedIndex; options.CityValue = txtCity.Text; options.ImportSourceEnabled = chkImportSource.Checked; options.ImportSourceOperator = (FilterOperator)lbxImportSource.SelectedIndex; options.ImportSourceValue = pklImportSource.PickListValue; options.IncludeDoNotMail = chkMail.Checked; options.IncludeDoNotEmail = chkEmail.Checked; options.IncludeDoNotPhone = chkCall.Checked; options.IncludeDoNotFax = chkFax.Checked; options.IncludeDoNotSolicit = chkSolicit.Checked; options.IncludeType = (FilterIncludeType)rdgIncludeType.SelectedIndex; options.CreateDateEnabled = chkCreateDate.Checked; options.CreateDateFromValue = dtpCreateFromDate.DateTimeValue; options.CreateDateToValue = dtpCreateToDate.DateTimeValue; }
/// <summary> /// Runs the comparison report against the supplied filter /// </summary> /// <param name="_fitler">The filter we want to run against this KPA</param> /// <param name="_option">The filter option where this fitler was obtained</param> public override void RunComparison(string _filter, FilterOptions.Options _filterOption) { try { DataTable dt = KpaUtils.PurchTotalQueries.GetPrReleaseToConfirmationEntry(); double totalDays = 0; // remove any apostraphe's from the filter as an exception will be thrown. CleanFilter(ref _filter); // Get the fitlered data rows from the datatable DataRow[] filteredResult = dt.Select(FilterOptions.GetSelectStatement(_filterOption, _filter)); foreach (DataRow dr in filteredResult) { //Check if the datarow meets the conditions of any applied filters. if (!FilterUtils.EvaluateAgainstFilters(dr)) { // This datarow dos not meet the conditions of the filters applied. continue; } #region EVASO_BUT_NOT_FULLY_RELEASED_CHECK string[] strPrFullyRelDate = (dr["PR Fully Rel Date"].ToString()).Split('/'); int prFullyRelYear = int.Parse(strPrFullyRelDate[2]); int prFullyRelMonth = int.Parse(strPrFullyRelDate[0]); int prFullyRelDay = int.Parse(strPrFullyRelDate[1]); if (prFullyRelYear == 0 && prFullyRelMonth == 0 && prFullyRelDay == 0) { // This PR line or PR in general might have been delted continue; } #endregion DateTime prFullyRelDt = new DateTime(prFullyRelYear, prFullyRelMonth, prFullyRelDay); DateTime today = DateTime.Now.Date; double elapsedDays = (today - prFullyRelDt).TotalDays; totalDays += elapsedDays; elapsedDays = (int)elapsedDays; // Apply the elapsed days against the time spand conditions template.TimeSpanDump(elapsedDays); } // Calculate the average for this KPA template.CalculateAverage(totalDays); dt.Rows.Clear(); dt = null; GC.Collect(); } catch (Exception) { MessageBox.Show("An argument out of range exception was thrown", "Purch Total -> PR Release To Confirmation Entry - Comparison Run Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } }
public override void ParseCommandLine(ArgumentSyntax syntax) { base.ParseCommandLine(syntax); FilterOptions.ParseCommandLine(syntax); string gitBranch = "master"; syntax.DefineOption( "git-branch", ref gitBranch, "GitHub branch to write version info to (defaults to master)"); GitBranch = gitBranch; string gitOwner = "dotnet"; syntax.DefineOption( "git-owner", ref gitOwner, "Owner of the GitHub repo to write version info to (defaults to dotnet)"); GitOwner = gitOwner; string gitPath = "build-info/docker"; syntax.DefineOption( "git-path", ref gitPath, "Path within the GitHub repo to write version info to (defaults to build-info/docker)"); GitPath = gitPath; string gitRepo = "versions"; syntax.DefineOption( "git-repo", ref gitRepo, "GitHub repo to write version info to (defaults to versions)"); GitRepo = gitRepo; string gitUsername = null; syntax.DefineParameter( "git-username", ref gitUsername, "GitHub username"); GitUsername = gitUsername; string gitEmail = null; syntax.DefineParameter( "git-email", ref gitEmail, "GitHub email"); GitEmail = gitEmail; string gitAuthToken = null; syntax.DefineParameter( "git-auth-token", ref gitAuthToken, "GitHub authentication token"); GitAuthToken = gitAuthToken; }
public override void SetTextureUnitFiltering( int unit, FilterType type, FilterOptions filter ) { if ( !this.ActivateGLTextureUnit( unit ) ) { return; } // This is a bit of a hack that will need to fleshed out later. // On iOS cube maps are especially sensitive to texture parameter changes. // So, for performance (and it's a large difference) we will skip updating them. if ( this.textureTypes[ unit ] == GLenum.TextureCubeMap ) { this.ActivateGLTextureUnit( 0 ); return; } switch ( type ) { case FilterType.Min: this.minFilter = filter; //Combine with exisiting mip filter GL.TexParameter( this.textureTypes[ unit ], GLenum.TextureMinFilter, (int) this.CombinedMinMipFilter ); GLES2Config.GlCheckError( this ); break; case FilterType.Mag: { switch ( filter ) { case FilterOptions.Anisotropic: case FilterOptions.Linear: GL.TexParameter( this.textureTypes[ unit ], GLenum.TextureMagFilter, (int) GLenum.Linear ); GLES2Config.GlCheckError( this ); break; case FilterOptions.None: case FilterOptions.Point: GL.TexParameter( this.textureTypes[ unit ], GLenum.TextureMagFilter, (int) GLenum.Nearest ); GLES2Config.GlCheckError( this ); break; } } break; case FilterType.Mip: this.mipFilter = filter; //Combine with exsiting min filter GL.TexParameter( this.textureTypes[ unit ], GLenum.TextureMinFilter, (int) this.CombinedMinMipFilter ); GLES2Config.GlCheckError( this ); break; } this.ActivateGLTextureUnit( 0 ); }
/// <summary> /// Initializes a new instance of the <see cref="DeleteSetDbCommandBuilder{TCommand, TParameter}"/> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The options.</param> public DeleteSetDbCommandBuilder(ICommandDataSource <TCommand, TParameter> dataSource, object filterValue, FilterOptions filterOptions) : base(dataSource) { FilterValue = filterValue; FilterOptions = filterOptions; }
public override void SetTextureUnitFiltering( int stage, FilterType type, FilterOptions filter ) { var texType = _texStageDesc[ stage ].texType; var texFilter = D3DHelper.ConvertEnum( type, filter, _deviceManager.ActiveDevice.D3D9DeviceCaps, texType ); SetSamplerState(GetSamplerId(stage), D3DHelper.ConvertEnum(type), (int)texFilter); }
public FilterBuilder(FilterOptions <T> filterOptions) { this.FilterOptions = filterOptions; }
/// <summary> /// Initializes a new instance of the <see cref="SqlServerDeleteSet"/> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The options.</param> public SqlServerDeleteSet(SqlServerDataSourceBase dataSource, SqlServerObjectName tableName, object filterValue, FilterOptions filterOptions) : base(dataSource, filterValue, filterOptions) { m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); }
/// <summary> /// Adds (or replaces) the filter on this command builder. /// </summary> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The filter options.</param> protected abstract TableDbCommandBuilder <TCommand, TParameter, TLimit> OnWithFilter(object filterValue, FilterOptions filterOptions = FilterOptions.None);
/// <summary> /// Called when [activating]. /// </summary> protected override void OnActivating() { lblHowMany.Text = String.Empty; FilterOptions options = new FilterOptions(); SetFilterControls(options); AddDistinctGroupItemsToList(lbxContactGroups, "Contact"); AddDistinctGroupItemsToList(lbxLeadGroups, "Lead"); }
public async Task <PagedResults <UserDto> > GetListAsync(int offset, int limit, string keyword, SortOptions <UserDto, UserEntity> sortOptions, FilterOptions <UserDto, UserEntity> filterOptions, IQueryable <UserEntity> querySearch ) { IQueryable <UserEntity> query = _entity; query = sortOptions.Apply(query); query = filterOptions.Apply(query); if (keyword != null) { query = querySearch; } var size = await query.CountAsync(); var items = await query .Skip(offset *limit) .Take(limit) .ToArrayAsync(); List <UserDto> returnUserList = new List <UserDto>(); foreach (UserEntity user in items) { var roleNames = await _userManager.GetRolesAsync(user); var userDto = new UserDto { FirstName = user.FirstName, LastName = user.LastName, Email = user.Email, PhoneNumber = user.PhoneNumber, Id = user.Id, UserName = user.UserName, IsActive = user.IsActive, RoleNames = roleNames }; returnUserList.Add(userDto); } return(new PagedResults <UserDto> { Items = returnUserList, TotalSize = size }); }
/// <summary> /// Sets the filter controls. /// </summary> /// <param name="options">The options.</param> private void SetFilterControls(FilterOptions options) { chkCompany.Checked = options.CompanyEnabled; SetListBox(lbxCompany, options.CompanyOperator); txtCompany.Text = options.CompanyValue; chkTitle.Checked = options.TitleEnabled; SetListBox(lbxTitle, options.TitleOperator); pklTitle.PickListValue = options.TitleValue; chkIndustry.Checked = options.IndustryEnabled; SetListBox(lbxIndustry, options.IndustryOperator); pklIndustry.PickListValue = options.IndustryValue; chkSIC.Checked = options.SICEnabled; SetListBox(lbxSIC, options.SICOperator); txtSIC.Text = options.SICValue; chkProducts.Checked = options.ProdOwnedEnabled; SetListBox(lbxProducts, options.ProdOwnedOperator); lueProducts.Text = options.ProdOwnedValue; chkLeadSource.Checked = options.LeadSourceEnabled; SetListBox(lbxLeadSource, options.LeadSourceOperator); lueLeadSource.Text = options.LeadSourceValue; chkStatus.Checked = options.StatusEnabled; SetListBox(lbxStatus, options.StatusOperator); pklStatus.PickListValue = options.StatusValue; chkState.Checked = options.StateEnabled; SetListBox(lbxState, options.StateOperator); txtState.Text = options.StateValue; chkZip.Checked = options.PostalCodeEnabled; SetListBox(lbxZip, options.PostalCodeOperator); txtZip.Text = options.PostalCodeValue; chkCity.Checked = options.CityEnabled; SetListBox(lbxCity, options.CityOperator); txtCity.Text = options.CityValue; chkImportSource.Checked = options.ImportSourceEnabled; SetListBox(lbxImportSource, options.ImportSourceOperator); pklImportSource.PickListValue = options.ImportSourceValue; chkMail.Checked = options.IncludeDoNotMail; chkEmail.Checked = options.IncludeDoNotEmail; chkCall.Checked = options.IncludeDoNotPhone; chkFax.Checked = options.IncludeDoNotFax; chkSolicit.Checked = options.IncludeDoNotSolicit; rdgIncludeType.SelectedIndex = (int)options.IncludeType; chkCreateDate.Checked = options.CreateDateEnabled = chkCreateDate.Checked; dtpCreateFromDate.DateTimeValue = options.CreateDateFromValue; dtpCreateToDate.DateTimeValue = options.CreateDateToValue; }
IMultipleRowDbCommandBuilder IClass1DataSource.DeleteWithFilter(string tableName, object filterValue, FilterOptions filterOptions) { return(DeleteWithFilter(tableName, filterValue, filterOptions)); }
public List<TradeInfo> GetProfitableTrades(string location, decimal volume, decimal funds, decimal taxRate, FilterOptions filterOption) { List<TradeInfo> result = new List<TradeInfo>(); using(var connection = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=eve;Integrated Security=SSPI;")) { string whereFilter; switch (filterOption) { case FilterOptions.CurrentRegion: whereFilter = "and sellStation.regionID in (select regionID from EveToolkit..mapSolarSystems where solarSystemName = @location)"; break; default: whereFilter = string.Empty; break; } connection.Open(); using(var command = connection.CreateCommand()) { command.CommandText = string.Format(commandText, whereFilter); command.CommandTimeout = 300; command.Parameters.AddWithValue("volume", volume); command.Parameters.AddWithValue("funds", funds); command.Parameters.AddWithValue("jumppenlty", 2); command.Parameters.AddWithValue("location", location); command.Parameters.AddWithValue("tax", taxRate); using(var reader = command.ExecuteReader()) { while (reader.Read()) { TradeInfo tradeInfo = new TradeInfo(); tradeInfo.TypeName = (string) reader["typeName"]; tradeInfo.DistanceToStart = (int) reader["distanceToStart"]; tradeInfo.DistBetweenBuyAndSell = (int) reader["distBetweenBuyAndSell"]; tradeInfo.SellPrice = (decimal) reader["sellPrice"]; tradeInfo.SellVolume = (int) reader["sellVolume"]; tradeInfo.SellMinVolume = (int) reader["sellMinVolume"]; tradeInfo.SellStationName = (string) reader["sellStationName"]; tradeInfo.SellStationId = (int)reader["sellStationId"]; tradeInfo.BuyPrice = (decimal) reader["buyPrice"]; tradeInfo.BuyVolume = (int) reader["buyVolume"]; tradeInfo.BuyMinVolume = (int) reader["buyMinVolume"]; tradeInfo.BuyStationName = (string) reader["buyStationName"]; tradeInfo.BuyStationId = (int)reader["buyStationId"]; tradeInfo.HaulQuantity = (int)(decimal)reader["haulQty"]; tradeInfo.HaulVolume = (decimal)(double) reader["haulVolume"]; tradeInfo.Profitperjump = (decimal) reader["profitperjump"]; tradeInfo.EstProfit = (decimal) reader["estProfit"]; tradeInfo.TypeId = (int)reader["typeID"]; result.Add(tradeInfo); } } } return result; } }
ITableDbCommandBuilder IClass1DataSource.From(string tableOrViewName, object filterValue, FilterOptions filterOptions) { return(From(tableOrViewName, filterValue, filterOptions)); }