当前位置: 首页>>代码示例>>C#>>正文


C# Filter类代码示例

本文整理汇总了C#中Filter的典型用法代码示例。如果您正苦于以下问题:C# Filter类的具体用法?C# Filter怎么用?C# Filter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Filter类属于命名空间,在下文中一共展示了Filter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ImageFigure

 public ImageFigure(Image Image, Rectangle Source, Rectangle Destination, Filter Filter)
 {
     this.Image = Image;
     this.Source = Source;
     this.Destination = Destination;
     this.Filter = Filter;
 }
开发者ID:dzamkov,项目名称:DUIP,代码行数:7,代码来源:Image.cs

示例2: ChannelParams

 public ChannelParams(AnalogInChannelsEnum channelName, Filter channelFilter, ProgrammableGainAmplifier channelPGA, AnalogInLatch channelLatch)
 {
     _channelName = channelName;
     ChannelFilter = channelFilter;
     ChannelPGA = channelPGA;
     CommonLatch = channelLatch;
 }
开发者ID:GandziukVI,项目名称:SDA_ExtensionBoxController,代码行数:7,代码来源:ChannelParams.cs

示例3: GetFiltersSortsFiltersByOrderFirstThenScope

        public void GetFiltersSortsFiltersByOrderFirstThenScope()
        {
            // Arrange
            var context = new ControllerContext();
            var descriptor = new Mock<ActionDescriptor>().Object;
            var actionFilter = new Filter(new Object(), FilterScope.Action, null);
            var controllerFilter = new Filter(new Object(), FilterScope.Controller, null);
            var globalFilter = new Filter(new Object(), FilterScope.Global, null);
            var earlyActionFilter = new Filter(new Object(), FilterScope.Action, -100);
            var lateGlobalFilter = new Filter(new Object(), FilterScope.Global, 100);
            var provider = new Mock<IFilterProvider>(MockBehavior.Strict);
            var collection = new FilterProviderCollection(new[] { provider.Object });
            provider.Setup(p => p.GetFilters(context, descriptor))
                .Returns(new[] { actionFilter, controllerFilter, globalFilter, earlyActionFilter, lateGlobalFilter });

            // Act
            Filter[] result = collection.GetFilters(context, descriptor).ToArray();

            // Assert
            Assert.Equal(5, result.Length);
            Assert.Same(earlyActionFilter, result[0]);
            Assert.Same(globalFilter, result[1]);
            Assert.Same(controllerFilter, result[2]);
            Assert.Same(actionFilter, result[3]);
            Assert.Same(lateGlobalFilter, result[4]);
        }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:26,代码来源:FilterProviderCollectionTest.cs

示例4: FiltersModule

        public FiltersModule()
        {
            Get["/Filters"] = parameters =>
            {
                FiltersModel model = new FiltersModel();
                model.Filters.Add(new Filter(1, "test filter 1", true, 1, 1, 1, 0));
                model.Filters.Add(new Filter(2, "filter 2", true, 1, 5, 1, 1));
                model.Filters.Add(new Filter(2, "filter 3", false, 1, 5, 1, 1));
                model.Filters.Add(new Filter(2, "filter 4", true, 1, 5, 1, 1));
                model.Filters.Add(new Filter(2, "filter 5", false, 1, 5, 1, 1));

                return View["Index", model];
            };

            Get["/Filters/Edit"] = parameters =>
            {
                EditFilterModel model = new EditFilterModel();

                Filter filter = new Filter(1, "filter 1", true, 0, 0, 0, 0);
                filter.Codecs.Add("XViD");
                model.Filter = filter;

                return View["EditFilter", model];
            };

            Post["/Filters/Delete"] = parameters =>
            {
                return true;
            };
        }
开发者ID:mlapaglia,项目名称:BTNster,代码行数:30,代码来源:FiltersModule.cs

示例5: UpdateFilter

 public Filter UpdateFilter(Filter filter, string dataSourceId)
 {
     var flt = Mapper.Map<Filter, DynamoDb.Filter>(filter);
     flt.DataSourceId = dataSourceId;
     this.Context.Save(flt);
     return filter;
 }
开发者ID:Naviam,项目名称:Log-Analyzer,代码行数:7,代码来源:FilterRepository.cs

示例6: ShouldDeserializeComplexWorkflowConfiguration3

        public void ShouldDeserializeComplexWorkflowConfiguration3()
        {
            var workFlow = new Workflow();
            workFlow.Configuration = "{\"default_filter\":{\"queue\":\"WQccc\"},\"filters\":[{\"expression\":\"1==1\",\"friendly_name\":\"Prioritizing Filter\",\"targets\":[{\"priority\":\"1\",\"queue\":\"WQccc\",\"timeout\":\"300\"}]}]}";

            var workFlowConfiguration = new WorkflowConfiguration();
            var filter = new Filter
            {
                FriendlyName = "Prioritizing Filter",
                Expression = "1==1",
                Targets = new List<Target>() { 
                    new Target { 
                        Queue="WQccc",
                        Priority="1",
                        Timeout="300"
                    }
                }
            };

            workFlowConfiguration.Filters.Add(filter);
            workFlowConfiguration.DefaultFilter = new Target() { Queue = "WQccc" };

            var config = workFlow.WorkflowConfiguration;

            Assert.AreEqual(workFlowConfiguration.ToString(), config.ToString());
        }
开发者ID:SnapMD,项目名称:twilio-csharp,代码行数:26,代码来源:WorkflowTests.cs

示例7: getAdvanceFilterResult

 internal static void getAdvanceFilterResult(string SelectedValue, Filter filter, ref List<Listing> output)
 {
     switch (filter)
     {
         case Filter.Type:
             getbyFilterType(SelectedValue, ref output);
             break;
         case Filter.Status:
             getbyFilterStatus(SelectedValue, ref output);
             break;
         case Filter.SAP:
             getbyFilterSAPStatus(SelectedValue, ref output);
             break;
         case Filter.Title:
             int SelectedID = Convert.ToInt32(SelectedValue);
             getbyFilterTitle(SelectedID, ref output);
             break;
         case Filter.NotDefined:
             getbyFilterWorkflow(SelectedValue, ref output);
             break;
         case Filter.Supervisors:
             getByFilterSupervisor(SelectedValue, ref output);
             break;
     }
 }
开发者ID:nakirareizo,项目名称:Training,代码行数:25,代码来源:ListingFilter.cs

示例8: GetCompanies

        private JObject GetCompanies(int rows, int page, string sidx, string sord, Filter filters)
        {
            IQueryable<Company> items = Companies.SortBy(filters, sidx, sord);

            int totalItems = items.Count();
            //in a real app Count should probably be retrieved asynchronously
            //int totalItems = await items.CountAsync();
            int totalPages = totalItems / rows;
            if (totalItems % rows > 0)
            {
                totalPages++;
            }

            items = items.Skip((page - 1) * rows).Take(rows);

            List<Company> listOfItems = items.ToList();
            //List<Company> listOfItems = await items.ToListAsync();

            dynamic result = new JObject();
            result.total = totalPages;
            result.records = totalItems;
            result.page = page;
            result.rows = new JArray(listOfItems.Select(c =>
                {
                    dynamic o = new JObject();
                    o.id = c.CompanyID;
                    o.cell = new JArray(c.CompanyID, c.Name, c.Address);
                    return o;
                }).ToArray());

            return result;
        }
开发者ID:KodarLtd,项目名称:WebApiJQGridFilters,代码行数:32,代码来源:CompaniesController.cs

示例9: ManyToManyRelationship

 public ManyToManyRelationship(string name, bool isUserDefined, OneToManyRelationship primaryRelationship, ManyToOneRelationship foreignRelationship, Filter filter)
     : base(name, isUserDefined, primaryRelationship.Parent, primaryRelationship.Parent, primaryRelationship.PrimaryColumns, foreignRelationship.ForeignRelationship.Parent, foreignRelationship.ForeignRelationship.PrimaryColumns, filter)
 {
     _intermediatePrimaryRelationship = primaryRelationship;
     _intermediateForeignRelationship = foreignRelationship;
     ResetDefaults();
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:7,代码来源:ManyToManyRelationship.cs

示例10: GetWordByNameCategoryAndWordPackID

        public Word GetWordByNameCategoryAndWordPackID(string Name, int CategoryID, int WordPackID)
        {
            Filter[] Filters = new Filter[]
            {
                new Filter(FilterType.And, new Field[]
                    {
                        NameField, 
                        CategoryIDField,
                        WordPackIDField
                    },
                    new string[]
                    {
                        "Name",
                        "CategoryID",
                        "WordPackID"
                    },
                    new object[]
                    {
                        Name,
                        CategoryID,
                        WordPackID
                    })
            };

            var Words = GetObjectsByFilters(Filters);
            Word word = Words.Cast<Word>().ToList().FirstOrDefault();

            if (word == null)
            {
                word = new Word(0, Name, CategoryID, WordPackID);
            }

            return word;
        }
开发者ID:Speedydown,项目名称:Thirty_Seconds_WP,代码行数:34,代码来源:WordHandler.cs

示例11: LastModified

        public static Continuation LastModified(this ICacheSteps _,
            Filter<DateTime> lastModifiedFilter)
        {
            return step => ctx =>
              {
            DateTime lastModified, d;

            var ifModifiedHeader = ctx.Request.Headers["If-Modified-Since"];

            // if a valid date has been given as a validator
            if (!string.IsNullOrEmpty(ifModifiedHeader) &&
              DateTime.TryParseExact(ifModifiedHeader, "R", CultureInfo.CurrentCulture,
              DateTimeStyles.RoundtripKind, out d)) {

              // run the filter and check the modified date,
              lastModified = lastModifiedFilter(ctx, d);

              // automatically returning 304 Not Modified if date indicates not modified
              if (roughCompare(lastModified.ToUniversalTime(), d.ToUniversalTime()) <= 0)
            step = fu.Compose(
              fu.Http.Header("Last-Modified", lastModified.ToString("R")),
              fu.Http.NotModified())
              (fu.EndAct);
            }
            else {
              lastModified = lastModifiedFilter(ctx, DateTime.MinValue);
            }

            fu.Http.Header("Last-Modified", lastModified.ToString("R"))
              (step)(ctx);
              };
        }
开发者ID:chakrit,项目名称:fu-sharp,代码行数:32,代码来源:Cache.cs

示例12: get

        public static Task<Get> get(int owner_id, long offset = 0, byte count = 100, Filter filter = Filter.owner)
        {
            return Task.Run<Get>(() =>
            {
                try
                {
                    //Собираем параметры
                    StringBuilder data = new StringBuilder();
                    data.Append("&owner_id=" + owner_id);
                    data.Append("&offset=" + offset);
                    data.Append("&filter=" + filter.ToString());
                    data.Append("&extended=1");

                    if (count > 0 && count <= 100)
                        data.Append("&count=" + count);


                    //Получаем и возвращаем результаты
                    string json = Regex.Replace(result.get("wall.get", data.ToString(), true), "^{\"response\":{\"wall\":\\[([0-9]+),{\"(.*)}$", "{\"count\":$1,\"wall\":[{\"$2");
                    return JsonConvert.DeserializeObject<Get>(json);
                }
                catch (Newtonsoft.Json.JsonReaderException) { }
                catch { }

                //Ошибка
                return new Get();
            });
        }
开发者ID:korner-brazers,项目名称:VK-HashTag,代码行数:28,代码来源:wall.cs

示例13: fill

 /// <summary>
 /// Fills the list provided with the element matching the filter provided
 /// </summary>
 /// <param name="retVal">The list to be filled with the element matching the condition expressed in the filter</param>
 /// <param name="filter">The filter to apply</param>
 public override void fill(List<Utils.INamable> retVal, Filter.AcceptableChoice filter)
 {
     if (filter(Value))
     {
         retVal.Add(Value);
     }
 }
开发者ID:Assmann-Siemens,项目名称:ERTMSFormalSpecs,代码行数:12,代码来源:StringExpression.cs

示例14: cmbCardFilter_SelectedIndexChanged

 private void cmbCardFilter_SelectedIndexChanged(object sender, EventArgs e)
 {
     switch (cmbCardFilter.SelectedIndex)
     {
         case 0:
             //"全部"
             CardFilter = (x) => { return true; };
             break;
         case 1:
             //"随从"
             CardFilter = (x) => { return x.卡牌种类 == CardBasicInfo.资源类型枚举.随从; };
             break;
         case 2:
             //"法术"
             CardFilter = (x) => { return x.卡牌种类 == CardBasicInfo.资源类型枚举.法术; };
             break;
         case 3:
             // "武器"
             CardFilter = (x) => { return x.卡牌种类 == CardBasicInfo.资源类型枚举.武器; };
             break;
         default:
             break;
     }
     SetCardListView();
 }
开发者ID:JulioCL,项目名称:HearthStone,代码行数:25,代码来源:CardManager.cs

示例15: Filtered

        static List<int> Filtered(int[] array1, Filter filter1, Filter filter2)
        {
            List<int> filtered1 = new List<int>();
                foreach (var item in array1)
                {
                    if (filter1(item))
                    {
                        filtered1.Add(item);
                    }
                }

                List<int> filtered2 = new List<int>();
                foreach (var item in array1)
                {
                    if (filter2(item))
                    {
                        filtered2.Add(item);
                    }
                }
                List<int> filtered = new List<int>();
                var array3 = filtered1.ToArray();
                var array2 = filtered2.ToArray();
                for (int i = 0; i < array3.Length; i++)
                {
                    filtered.Add(array3[i] * array2[i]);
                }

                return filtered;
        }
开发者ID:Gor92,项目名称:C-,代码行数:29,代码来源:Program.cs


注:本文中的Filter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。