Ejemplo n.º 1
0
        static FilterOption <FIELD_TYPE> SetFilter <FIELD_TYPE>(
            string filter,
            Func <string, FIELD_TYPE> filterParser
            )
            where FIELD_TYPE : struct, IComparable
        {
            if (filter == null)
            {
                return(null);
            }
            FilterOption <FIELD_TYPE> filterOption = new FilterOption <FIELD_TYPE>();

            if (filter.StartsWith('>'))
            {
                filterOption.Type  = FilterType.greater;
                filterOption.Value = filterParser(filter.Substring(1));
            }
            else if (filter.StartsWith('<'))
            {
                filterOption.Type  = FilterType.lesser;
                filterOption.Value = filterParser(filter.Substring(1));
            }
            else
            {
                filterOption.Type  = FilterType.equal;
                filterOption.Value = filterParser(filter);
            }
            return(filterOption);
        }
 public static void AddFilter(this List <Filter> list, string propertyName, FilterOption option, object value)
 {
     list.Add(new Filter()
     {
         PropertyName = propertyName, Operation = option, Value = value
     });
 }
        public async Task <Launch> MergeAsync(FilterOption filter)
        {
            filter.Sorting = new Sorting(new List <string> {
                "start_time"
            }, SortDirection.Descending);

            var container = await _service.GetLaunchesAsync(filter, _debug).ConfigureAwait(false);

            _logger?.LogDebug($"Successfully found ${container.Launches.Count} launch(es)");

            switch (container.Launches.Count)
            {
            case 0:
                throw new LaunchNotFoundException("Launches for merging not found.");

            case 1:
                return(await Task.FromResult(container.Launches[0]).ConfigureAwait(false));

            default:
            {
                var current  = container.Launches[0];
                var previous = container.Launches[1];

                return(await _merger.MergeAsync(previous, current).ConfigureAwait(false));
            }
            }
        }
Ejemplo n.º 4
0
        public override string GetUrl(DynamicQueryOmniboxResult result)
        {
            FindOptions findOptions = new FindOptions(result.QueryName);

            foreach (var item in result.Filters)
            {
                if (item.QueryToken != null && item.Operation != null &&
                    !(item.Value as string == DynamicQueryOmniboxResultGenerator.UnknownValue))
                {
                    if (findOptions.FilterOptions == null)
                    {
                        findOptions.FilterOptions = new List <FilterOption>();
                    }

                    var filter = new FilterOption(item.QueryToken.FullKey(), item.Value);
                    if (item.Operation != null)
                    {
                        filter.Operation = item.Operation.Value;
                    }

                    findOptions.FilterOptions.Add(filter);
                }
            }

            if (findOptions.FilterOptions.Any())
            {
                findOptions.SearchOnLoad = true;
            }

            return(findOptions.ToString());
        }
        public override void Execute()
        {
            #line 6 "..\..\Signum\Views\FilterRows.cshtml"

            var filterOptions = (List <FilterOption>)ViewData[ViewDataKeys.FilterOptions];


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n");


            #line 10 "..\..\Signum\Views\FilterRows.cshtml"
            for (int i = 0; i < filterOptions.Count; i++)
            {
                FilterOption filter = filterOptions[i];


            #line default
            #line hidden

            #line 13 "..\..\Signum\Views\FilterRows.cshtml"
                Write(Html.NewFilter(filter, Model, i));


            #line default
            #line hidden

            #line 13 "..\..\Signum\Views\FilterRows.cshtml"
            }

            #line default
            #line hidden
        }
Ejemplo n.º 6
0
        public static IEnumerable <T> GenericObjectFilter <T>(IEnumerable <T> items, string syntax,
                                                              FilterOption option = null)
        {
            if (items == null)
            {
                throw new ArgumentNullException(nameof(items));
            }

            if (string.IsNullOrWhiteSpace(syntax))
            {
                return(items);
            }

            var props = new List <PropertyInfo>(typeof(T).GetProperties());

            var filteredItems = new List <T>();

            var filter = FilterHelper.GetFilter(syntax);

            foreach (var item in items)
            {
                if (filter.Match(item, props, option))
                {
                    filteredItems.Add(item);
                }
            }

            return(filteredItems);
        }
Ejemplo n.º 7
0
 private void SelectFilter(FilterOption selectedFilterOption)
 {
     switch (selectedFilterOption)
     {
     case FilterOption.Cartoon: this.SelectedFilter = new CartoonFilter(true); break;
     }
 }
Ejemplo n.º 8
0
        public async Task <StorageFile> ApplyFilter(StorageFile file, FilterOption filterOption)
        {
            IImageProvider source = null;

            var properties = await file.Properties.GetImagePropertiesAsync();

            this.SelectFilter(filterOption);

            using (var stream = await file.OpenAsync(FileAccessMode.ReadWrite))
            {
                source = new StreamImageSource(stream.AsStream(), ImageFormat.Jpeg);

                using (var filterEffect = new FilterEffect(source))
                {
                    // Initialize the filter and add the filter to the FilterEffect collection
                    //var filter = new SketchFilter(SketchMode.Gray);

                    filterEffect.Filters = new IFilter[] { this.SelectedFilter };

                    // Create a target where the filtered image will be rendered to
                    var target = new WriteableBitmap((int)properties.Width, (int)properties.Height);

                    // Create a new renderer which outputs WriteableBitmaps
                    using (var renderer = new WriteableBitmapRenderer(filterEffect, target))
                    {
                        // Render the image with the filter(s)
                        await renderer.RenderAsync();

                        return(await this.WriteableBitmapToStorageFile(target, FileFormat.Jpeg));
                    }
                }
            }
        }
Ejemplo n.º 9
0
        private void processFilter_Click(object sender, EventArgs e)
        {
            FilterOption fo        = new FilterOption();
            bool         ignoreDir = ignoreDirectory.Checked;
            string       dir       = directoryFilter.Text;

            if (string.IsNullOrEmpty(dir))
            {
                MessageBox.Show("Unable to process request", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            Control c = Application.OpenForms["DirectoryTest"];

            if (c is DirectoryTest)
            {
                DirectoryTest d = c as DirectoryTest;
                if (null != d)
                {
                    fo.DirectoryFilter = dir;
                    fo.IgnoreParent    = ignoreDir;
                    d.FilterOptionData = fo;
                }
            }
            this.Close();
        }
Ejemplo n.º 10
0
        void Filter(FilterOption filter, string Conditoin)
        {
            switch (filter)
            {
            case FilterOption.Description:
                DescriptionFilter(Conditoin);
                break;

            case FilterOption.PrixAchat:
                Main_Filter(0, Conditoin);
                break;

            case FilterOption.PrixVent:
                Main_Filter(1, Conditoin);
                break;

            case FilterOption.Qte:
                Main_Filter(2, Conditoin);
                break;

            case FilterOption.REF:
                REFFilter(Conditoin);
                break;

            default:
                break;
            }
        }
        public static async Task <Launch> SmartMergeLaunchesAsync(
            this ICakeContext context,
            Service service,
            FilterOption filter,
            CleanOptions cleanOptions,
            MergeOptions mergeOptions = null,
            bool debug = true)
        {
            var cleaner = new ForciblyTerminatingLaunchCleaner(
                new LaunchCleaner(service, cleanOptions),
                service);

            var decoratedMerger = new CleanableLaunchMerger(new LaunchMerger(service, mergeOptions), cleaner);
            var merger          = new ForciblyTerminatingLaunchMerger(decoratedMerger, service);

            var launch = await new SmartLaunchMerger(merger, service, debug)
                         .MergeAsync(filter)
                         .ConfigureAwait(false);

            var message = $"Smart merging launches successfully completed.";

            context.Log.Write(Verbosity.Diagnostic, LogLevel.Debug, message);

            return(launch);
        }
Ejemplo n.º 12
0
    public static IApplicationBuilder UseRealIp(this IApplicationBuilder builder, Action <FilterOption> configureOption = null)
    {
        var option = new FilterOption();

        configureOption?.Invoke(option);
        return(builder.UseMiddleware <RealIpMiddleware>(option));
    }
Ejemplo n.º 13
0
 private void SelectFilter(FilterOption selectedFilterOption)
 {
     switch(selectedFilterOption)
     {
         case FilterOption.Cartoon: this.SelectedFilter = new CartoonFilter(true); break;
     }
 }
Ejemplo n.º 14
0
 public FilterGumpEntry(FilterOption option, bool isCategory, int col, int row)
     : this()
 {
     Option     = option;
     IsCategory = isCategory;
     Col        = col;
     Row        = row;
 }
Ejemplo n.º 15
0
            //

            public BindSettingsAttribute(TextureAddressingMode addressingMode, FilterOption filteringMin, FilterOption filteringMag, FilterOption filteringMip, int samplerIndex)
            {
                this.addressingMode = addressingMode;
                this.filteringMin   = filteringMin;
                this.filteringMag   = filteringMag;
                this.filteringMip   = filteringMip;
                this.samplerIndex   = samplerIndex;
            }
Ejemplo n.º 16
0
        public Parameter(string nName, object nValue, FilterOption nFilterOption, int nFilterGroup)
        {
            Name = nName;
            Value = nValue;

            FilterOption = nFilterOption;
            FilterGroup = nFilterGroup;
        }
Ejemplo n.º 17
0
 public ChannelAdjusterConfig(string name, float scale, float offset, int temporalOffset, FilterOption option)
 {
     Name           = name;
     Scale          = scale;
     Offset         = offset;
     Option         = option;
     TemporalOffset = temporalOffset;
 }
Ejemplo n.º 18
0
        public Parameter(string nName, object nValue, FilterOption nFilterOption, int nFilterGroup)
        {
            Name  = nName;
            Value = nValue;

            FilterOption = nFilterOption;
            FilterGroup  = nFilterGroup;
        }
Ejemplo n.º 19
0
 public void Reset()
 {
     childNodes  = new string[0];
     sortBy      = SortOption.None;
     sortValue   = "";
     filterBy    = FilterOption.None;
     filterValue = 0;
     LoadData();
 }
Ejemplo n.º 20
0
 public static string ToCssClass(FilterOption filterOption)
 {
     return(filterOption switch
     {
         FilterOption.None => "filter__cell--none",
         FilterOption.Primary => "filter__cell--primary",
         FilterOption.Secondary => "filter__cell--secondary",
         _ => throw new NotImplementedException(),
     });
Ejemplo n.º 21
0
        public async Task <ActionResult> DeleteFilterOption(int id)
        {
            FilterOption filterOption = await unitOfWork.FilterOptions.Get(id);

            unitOfWork.FilterOptions.Remove(filterOption);
            await unitOfWork.Save();

            return(Ok());
        }
Ejemplo n.º 22
0
        public bool FilerRecords(object o)
        {
            double res;
            bool   checkNumeric = double.TryParse(FilterText, out res);
            var    item         = o as Employee;

            if (item != null && FilterText.Equals(""))
            {
                return(true);
            }
            else
            {
                if (item != null)
                {
                    if (checkNumeric && FilterOption.Equals("ContactNumber"))
                    {
                        if (FilterCondition == null || FilterCondition.Equals("Equals") || FilterCondition.Equals("LessThan") || FilterCondition.Equals("GreaterThan") || FilterCondition.Equals("NotEquals"))
                        {
                            FilterCondition = "Contains";
                        }
                        bool result = MakeStringFilter(item, FilterOption, FilterCondition);
                        return(result);
                    }
                    else if (checkNumeric && !FilterOption.Equals("AllColumns"))
                    {
                        if (FilterCondition == null || FilterCondition.Equals("Contains") || FilterCondition.Equals("StartsWith") || FilterCondition.Equals("EndsWith"))
                        {
                            FilterCondition = "Equals";
                        }
                        bool result = MakeNumericFilter(item, FilterOption, FilterCondition);
                        return(result);
                    }
                    else if (FilterOption.Equals("AllColumns"))
                    {
                        if (item.FirstName.ToLower().Contains(FilterText.ToLower()) ||
                            item.LastName.ToLower().Contains(FilterText.ToLower()) || item.City.ToLower().Contains(FilterText.ToLower()) ||
                            item.Salary.ToString().ToLower().Contains(FilterText.ToLower()) || item.EmployeeID.ToString().ToLower().Contains(FilterText.ToLower()) ||
                            item.ContactNumber.ToLower().Contains(FilterText.ToLower()))
                        {
                            return(true);
                        }
                        return(false);
                    }
                    else
                    {
                        if (FilterCondition == null || FilterCondition.Equals("Equals") || FilterCondition.Equals("LessThan") || FilterCondition.Equals("GreaterThan") || FilterCondition.Equals("NotEquals"))
                        {
                            FilterCondition = "Contains";
                        }
                        bool result = MakeStringFilter(item, FilterOption, FilterCondition);
                        return(result);
                    }
                }
            }
            return(false);
        }
Ejemplo n.º 23
0
        private string ApplyLogical(FilterOption filterOption, string query)
        {
            if (filterOption.Operator.Logical != null)
            {
                var logicalOperatorType = _logicalOperators[filterOption.Operator.Logical];
                query += $" {LogicalOperatorOptions.QuerySyntaticValues[logicalOperatorType]}";
            }

            return(query);
        }
Ejemplo n.º 24
0
        private static string ApplyLeftGrouping(FilterOption filterOption, string query)
        {
            if (filterOption.Operator.Grouping != null &&
                filterOption.Operator.Grouping.StartsWith(SpecialCharacters.LeftParentheses))
            {
                query += $"{filterOption.Operator.Grouping}";
            }

            return(query);
        }
Ejemplo n.º 25
0
        private string ApplyComparison(FilterOption filterOption, string query)
        {
            if (filterOption.Operator.Comparison != null)
            {
                var comparisonOperatorType = _comparisonOperators[filterOption.Operator.Comparison];
                query += $" {ComparisonOperatorOptions.QuerySyntaticValues[comparisonOperatorType]}";
            }

            return(query);
        }
Ejemplo n.º 26
0
        public IActionResult GetOptionName(long id)
        {
            FilterOption option = filterOptionRepository.GetOption(id);

            if (option == null)
            {
                return(BadRequest());
            }
            return(Json(option.Name));
        }
Ejemplo n.º 27
0
        public async Task <Content <LaunchResponse> > GetAsync(FilterOption filterOption = null)
        {
            var uri = $"{ProjectName}/launch";

            if (filterOption != null)
            {
                uri += $"?{filterOption}";
            }

            return(await GetAsJsonAsync <Content <LaunchResponse> >(uri).ConfigureAwait(false));
        }
Ejemplo n.º 28
0
        public Task <Content <LaunchResponse> > GetDebugAsync(FilterOption filterOption = null)
        {
            var uri = $"{ProjectName}/launch/mode";

            if (filterOption != null)
            {
                uri += $"?{filterOption}";
            }

            return(GetAsJsonAsync <Content <LaunchResponse> >(uri));
        }
Ejemplo n.º 29
0
        public async Task <Content <UserFilterResponse> > GetAsync(FilterOption filterOption = null)
        {
            var uri = $"{ProjectName}/filter";

            if (filterOption != null)
            {
                uri += $"?{filterOption}";
            }

            return(await GetAsJsonAsync <Content <UserFilterResponse> >(uri));
        }
Ejemplo n.º 30
0
        private string ApplyNegation(FilterOption filterOption, string query)
        {
            if (filterOption.Operator.Negation != null)
            {
                var negation = filterOption.Operator.Negation;
                negation = negation.Replace(_notSymbol, LogicalOperatorOptions.QuerySyntaticValues[LogicalOperatorTypes.Not]);
                query   += $" {negation}";
            }

            return(query);
        }
Ejemplo n.º 31
0
        public Task <Content <TestItemResponse> > GetAsync(FilterOption filterOption = null)
        {
            var uri = $"{ProjectName}/item";

            if (filterOption != null)
            {
                uri += $"?{filterOption}";
            }

            return(GetAsJsonAsync <Content <TestItemResponse> >(uri));
        }
Ejemplo n.º 32
0
        public FilterOption GetFilters()
        {
            FilterOption filter = new FilterOption
            {
                Subjects = _mapper.Map <IEnumerable <SubjectFilter> >(_context.Subjects
                                                                      .Include(subject => subject.Domains)
                                                                      .ThenInclude(domain => domain.LearningObjectives))
            };

            return(filter);
        }
Ejemplo n.º 33
0
        public Parameter(string nName, DbType nType, string nSpecificType, object nValue, bool nIsNullable, int nMaxLength, byte nPrecision, byte nScale, System.Data.ParameterDirection nDirection, FilterOption nFilterOption, int nFilterGroup)
        {
            Name = nName;
            Type = nType;
            Value = nValue;
            IsNullable = nIsNullable;
            MaxLength = nMaxLength;
            Precision = nPrecision;
            Scale = nScale;
            Direction = nDirection;
            SpecificType = nSpecificType;

            FilterOption = nFilterOption;
            FilterGroup = nFilterGroup;

            //ComparitionType = ComparitionType.Equal;
        }
 private void prepareFilterOptions()
 {
     OutputFormat[] supportedImageFormats = (OutputFormat[])Enum.GetValues(typeof(OutputFormat));
     filterOptions = new FilterOption[supportedImageFormats.Length];
     for (int i = 0; i < filterOptions.Length; i++)
     {
         string ifo = supportedImageFormats[i].ToString();
         if (ifo.ToLower().Equals("jpeg")) ifo = "Jpg"; // we dont want no jpeg files, so let the dialog check for jpg
         FilterOption fo = new FilterOption();
         fo.Label = ifo.ToUpper();
         fo.Extension = ifo.ToLower();
         filterOptions.SetValue(fo, i);
     }
 }
Ejemplo n.º 35
0
        public Form1(string[] args)
        {
            //
            // Required for Windows Form Designer support
            //
            FormMain = this;
            InitializeComponent();
            Evaluate.FillOpsList();
            listSSAg = Graphics.FromHwnd(listSSA.Handle);
            lineColl = new List<Line>();
            layerColl = new System.Collections.Generic.List<Layer>();
            templateFilterColl = new System.Collections.Generic.List<Filter>();
            undoStack = new Stack();
            redoStack = new Stack();
            //CurFile = String.Empty;

            // Add the "raw code" filter as a default filter
            Filter raw = new Filter("Raw code", "$Code$");
            FilterOption rawfo = new FilterOption("Code", "");
            raw.AddOption(rawfo);
            templateFilterColl.Add(raw);

            string path = "effects.exml";
            if (File.Exists(path)) LoadEffectsFile(path);
            enc = new System.Text.UnicodeEncoding();
            Notebox.readNoteBoxes();

            string arglower;
            foreach (string arg in args) {
                if (File.Exists(arg)) {
                    arglower = arg.ToLower(Util.cfi);
                    if (arglower.EndsWith(".xml"))
                        LoadProject(arg);
                    else if (arglower.EndsWith(".ass") || arglower.EndsWith(".ssa") || arglower.EndsWith(".assa"))
                        LoadFile(args[0], null);
                }
            }
            listSSA.LabelEdit = false;
        }
Ejemplo n.º 36
0
 public static void AddFilter(this List<Filter> list, string propertyName, FilterOption option, object value)
 {
     list.Add(new Filter() { PropertyName = propertyName, Operation = option, Value = value });
 }
Ejemplo n.º 37
0
        public async Task<StorageFile> ApplyFilter(StorageFile file, FilterOption filterOption)
        {
            IImageProvider source = null;

            var properties = await file.Properties.GetImagePropertiesAsync();

            this.SelectFilter(filterOption);

            using (var stream = await file.OpenAsync(FileAccessMode.ReadWrite))
            {
                source = new StreamImageSource(stream.AsStream(), ImageFormat.Jpeg);

                using (var filterEffect = new FilterEffect(source))
                {
                    // Initialize the filter and add the filter to the FilterEffect collection
                    //var filter = new SketchFilter(SketchMode.Gray);

                    filterEffect.Filters = new IFilter[] { this.SelectedFilter };

                    // Create a target where the filtered image will be rendered to
                    var target = new WriteableBitmap((int)properties.Width, (int)properties.Height);
                    
                    // Create a new renderer which outputs WriteableBitmaps
                    using (var renderer = new WriteableBitmapRenderer(filterEffect, target))
                    {
                        // Render the image with the filter(s)
                        await renderer.RenderAsync();
                        
                        return await this.WriteableBitmapToStorageFile(target, FileFormat.Jpeg);
                    }
                }
            }
        }
        public ContentResult AddFilter(string webQueryName, string tokenName, int index)
        {
            ChartRequest request = this.ExtractChartRequestCtx(null).Value;

            QueryDescription qd = DynamicQueryManager.Current.QueryDescription(request.QueryName);

            FilterOption fo = new FilterOption(tokenName, null);
            fo.Token = QueryUtils.Parse(tokenName, qd, SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement | (request.GroupResults ? SubTokensOptions.CanAggregate : 0));
            fo.Operation = QueryUtils.GetFilterOperations(QueryUtils.GetFilterType(fo.Token.Type)).FirstEx();

            return Content(FilterBuilderHelper.NewFilter(
                    FinderController.CreateHtmlHelper(this), fo, new Context(null, this.Prefix()), index).ToHtmlString());
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        grid1.ID = "Grid1";
        grid1.DataSourceID = "sds1";
        grid1.AutoGenerateColumns = false;
        grid1.CallbackMode = true;
        grid1.AllowAddingRecords = false;
        grid1.Serialize = true;
        grid1.AllowFiltering = true;
        grid1.ShowLoadingMessage = false;
        grid1.AllowPageSizeSelection = false;

        grid1.FilteringSettings.InitialState = GridFilterState.Visible;
        grid1.FilteringSettings.FilterPosition = GridFilterPosition.Top;
		
		
		// creating the Templates				
		//------------------------------------------------------------------------
		GridRuntimeTemplate NameFilter = new GridRuntimeTemplate();
        NameFilter.ID = "NameFilter";
        NameFilter.Template = new Obout.Grid.RuntimeTemplate();
        NameFilter.Template.CreateTemplate += new Obout.Grid.GridRuntimeTemplateEventHandler(CreateNameFilter);
        NameFilter.ControlID = "Name";

		//------------------------------------------------------------------------
		//------------------------------------------------------------------------
		GridRuntimeTemplate CityFilter = new GridRuntimeTemplate();
		CityFilter.ID = "CityFilter";
		CityFilter.Template = new Obout.Grid.RuntimeTemplate();
		CityFilter.Template.CreateTemplate += new Obout.Grid.GridRuntimeTemplateEventHandler(CreateCityFilter);
        CityFilter.ControlID = "City";
		//------------------------------------------------------------------------
		//------------------------------------------------------------------------
		GridRuntimeTemplate ZipFilter = new GridRuntimeTemplate();
		ZipFilter.ID = "ZipFilter";
		ZipFilter.Template = new Obout.Grid.RuntimeTemplate();
		ZipFilter.Template.CreateTemplate += new Obout.Grid.GridRuntimeTemplateEventHandler(CreateZipFilter);
        ZipFilter.ControlID = "Zip";
		//------------------------------------------------------------------------
        //------------------------------------------------------------------------
        GridRuntimeTemplate CountryFilter = new GridRuntimeTemplate();
        CountryFilter.ID = "CountryFilter";
        CountryFilter.Template = new Obout.Grid.RuntimeTemplate();
        CountryFilter.Template.CreateTemplate += new Obout.Grid.GridRuntimeTemplateEventHandler(CreateCountryFilter);
        CountryFilter.ControlID = "Country";
        //------------------------------------------------------------------------

        		
		// adding the templates to the Templates collection
		grid1.Templates.Add(NameFilter);
		grid1.Templates.Add(CityFilter);
		grid1.Templates.Add(ZipFilter);
        grid1.Templates.Add(CountryFilter);
		
								
		// creating the columns
		Column oCol1 = new Column();
		oCol1.DataField = "OrderID";
		oCol1.Visible = false;
		oCol1.HeaderText = "ORDER ID";
        oCol1.Width = "100";

		Column oCol2 = new Column();
		oCol2.DataField = "ShipName";
		oCol2.HeaderText = "NAME";
		oCol2.Width = "200";
        oCol2.TemplateSettings.FilterTemplateId = "NameFilter";
        oCol2.ShowFilterCriterias = false;

        FilterOption NameFilterOption = new FilterOption();
        NameFilterOption.Type = FilterOptionType.StartsWith;
        NameFilterOption.IsDefault = true;

        oCol2.FilterOptions.Add(NameFilterOption);

		Column oCol3 = new Column();
		oCol3.DataField = "ShipCity";
		oCol3.HeaderText = "CITY";
		oCol3.Width = "150";
		oCol3.TemplateSettings.FilterTemplateId = "CityFilter";
        oCol3.ShowFilterCriterias = false;

        FilterOption CityFilterOption = new FilterOption();
        CityFilterOption.Type = FilterOptionType.StartsWith;
        CityFilterOption.IsDefault = true;

        oCol3.FilterOptions.Add(CityFilterOption);

		Column oCol4 = new Column();
		oCol4.DataField = "ShipPostalCode";
		oCol4.HeaderText = "POSTAL CODE";
		oCol4.Width = "150";
        oCol4.TemplateSettings.FilterTemplateId = "ZipFilter";
        oCol4.ShowFilterCriterias = false;

        FilterOption ZipFilterOption = new FilterOption();
        ZipFilterOption.Type = FilterOptionType.StartsWith;
        ZipFilterOption.IsDefault = true;

        oCol4.FilterOptions.Add(ZipFilterOption);

        Column oCol5 = new Column();
        oCol5.DataField = "ShipCountry";
        oCol5.HeaderText = "COUNTRY";
        oCol5.Width = "150";
        oCol5.TemplateSettings.FilterTemplateId = "CountryFilter";
        oCol5.ShowFilterCriterias = false;

        FilterOption CountryFilterOption = new FilterOption();
        CountryFilterOption.Type = FilterOptionType.StartsWith;
        CountryFilterOption.IsDefault = true;

        oCol5.FilterOptions.Add(CountryFilterOption);

		// add the columns to the Columns collection of the grid
		grid1.Columns.Add(oCol1);
		grid1.Columns.Add(oCol2);
		grid1.Columns.Add(oCol3);
		grid1.Columns.Add(oCol4);
        grid1.Columns.Add(oCol5);  
        
        // add the grid to the controls collection of the PlaceHolder        
        phGrid1.Controls.Add(grid1);
		
	}
Ejemplo n.º 40
0
 /// <summary>
 /// 根据指定条件,枚举系统中符合条件的窗口,可以枚举到按键自带的无法枚举到的窗口
 /// </summary>
 /// <param name="paren">父窗口</param>
 /// <param name="title">标题</param>
 /// <param name="className">窗口类名</param>
 /// <param name="option">过滤</param>
 /// <returns>所有窗口</returns>
 public static List<Window> EnumWindow(Window paren, string title = "", string className = "", FilterOption option = FilterOption.Default)
 {
     string allHwnds = Dm.Default.EnumWindow(paren.Hwnd, title, className, (int)option);
     return HwndString2Window(allHwnds);
 }
Ejemplo n.º 41
0
 /// <summary>
 /// 根据指定进程名以及其它条件,枚举系统中符合条件的窗口,可以枚举到按键自带的无法枚举到的窗口
 /// </summary>
 /// <param name="processName">进程名</param>
 /// <param name="title">标题</param>
 /// <param name="className">窗口类名</param>
 /// <param name="option">过滤</param>
 /// <returns></returns>
 public static List<Window> EnumWindowByProcessName(string processName, string title = "", string className = "", FilterOption option = FilterOption.Default)
 {
     string allHwnds = Dm.Default.EnumWindowByProcess(processName, title, className, (int)option);
     return HwndString2Window(allHwnds);
 }
Ejemplo n.º 42
0
 /// <summary>
 /// 查找子窗口
 /// </summary>
 /// <param name="title">标题</param>
 /// <param name="className">窗口类名</param>
 /// <param name="option">过滤</param>
 /// <returns>返回所有符合的子窗口</returns>
 public List<Window> FindChildren(string title, string className = "", FilterOption option = FilterOption.Default)
 {
     return EnumWindow(this, title, className, option);
 }
Ejemplo n.º 43
0
        public ContentResult AddFilter(string webQueryName, string tokenName, int index, string prefix, string value)
        {
            object queryName = Finder.ResolveQueryName(webQueryName);

            FilterOption fo = new FilterOption(tokenName, null);
            
            QueryDescription qd = DynamicQueryManager.Current.QueryDescription(queryName);
            fo.Token = QueryUtils.Parse(tokenName, qd, SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement);
           
            fo.Operation = QueryUtils.GetFilterOperations(QueryUtils.GetFilterType(fo.Token.Type)).FirstEx();

            try
            {
                fo.Value = FindOptionsModelBinder.Convert(value, fo.Token.Type);
            }
            catch (Exception)
            {
                //Cell Value must be custom and cannot be parsed automatically: Leave value to null
            }

            return Content(FilterBuilderHelper.NewFilter(CreateHtmlHelper(this), fo, new Context(null, prefix), index).ToHtmlString());
        }