本文整理汇总了C#中FieldCollection.Where方法的典型用法代码示例。如果您正苦于以下问题:C# FieldCollection.Where方法的具体用法?C# FieldCollection.Where怎么用?C# FieldCollection.Where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldCollection
的用法示例。
在下文中一共展示了FieldCollection.Where方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTypedFields
protected override IEnumerable<Field> GetTypedFields(ClientContext context, FieldCollection items)
{
var typedFields = context.LoadQuery(items.Where(i => i.TypeAsString == BuiltInFieldTypes.TaxonomyFieldType));
context.ExecuteQueryWithTrace();
var result = new List<Field>();
result.AddRange(typedFields);
typedFields = context.LoadQuery(items.Where(i => i.TypeAsString == BuiltInFieldTypes.TaxonomyFieldTypeMulti));
context.ExecuteQueryWithTrace();
result.AddRange(typedFields);
return result;
}
示例2: GetTypedFields
protected override IEnumerable<Field> GetTypedFields(ClientContext context, FieldCollection items)
{
var typedFields = context.LoadQuery(items.Where(i => i.FieldTypeKind == FieldType.User));
context.ExecuteQueryWithTrace();
return typedFields;
}
示例3: GetTypedFields
protected override IEnumerable<Field> GetTypedFields(ClientContext context, FieldCollection items)
{
var typedFields = context.LoadQuery(items.Where(i => i.TypeAsString == BuiltInPublishingFieldTypes.HTML));
context.ExecuteQueryWithTrace();
return typedFields;
}
示例4: AppendFieldInfo
private static void AppendFieldInfo(StringBuilder sb, FieldCollection fields, string header, Func<Field, bool> predicate)
{
sb.AppendLine(string.Empty);
sb.AppendLine(header);
foreach (var field in fields.Where(predicate))
{
sb.AppendLine(string.Format("\"{0}\":\"{1}\"", field.Name, field.Value));
}
}
示例5: GetTypedFields
protected override IEnumerable<Field> GetTypedFields(ClientContext context, FieldCollection items)
{
var typedFields = context.LoadQuery(
items.Where(i => i.FieldTypeKind == FieldType.Number)
.IncludeWithDefaultProperties());
context.ExecuteQueryWithTrace();
return typedFields;
}
示例6: AddFieldsIncludedBySection
protected virtual void AddFieldsIncludedBySection(FieldCollection fieldCol, List<Field> includedFields, GetRenderingPropertiesArgs args)
{
var sectionsParam = args.ClientParameters["sections"];
if (string.IsNullOrEmpty(sectionsParam))
{
return;
}
var sectionNames = sectionsParam.Split(new[] { '|' }).Where(name => !string.IsNullOrWhiteSpace(name)).ToList();
var fields = fieldCol.Where(f => sectionNames.Contains(f.Section));
includedFields.AddRange(fields);
}