本文整理汇总了C#中FieldCollection类的典型用法代码示例。如果您正苦于以下问题:C# FieldCollection类的具体用法?C# FieldCollection怎么用?C# FieldCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldCollection类属于命名空间,在下文中一共展示了FieldCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBoolValue
public bool GetBoolValue(FieldCollection fc, string fieldName, bool defaultValue)
{
if (!IsEmptyStrField(fc, fieldName))
return fc[fieldName].GetValueAsBool();
return defaultValue;
}
示例2: GetTypedFields
protected virtual IEnumerable<Field> GetTypedFields(ClientContext context, FieldCollection items)
{
context.Load(items);
context.ExecuteQueryWithTrace();
return items.ToArray();
}
示例3: 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;
}
示例4: 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;
}
示例5: DataOperation_Complex
/// <summary>
/// 自动读数据库载入数据的构造函数
/// </summary>
/// <param name="tablename">表名</param>
/// <param name="db">操作数据类</param>
/// <param name="IsLoadDt">是否从数据库载入数据到类中</param>
/// <param name="fields">Field集合</param>
public DataOperation_Complex(string DefConnID, string DefTableID, FieldCollection fc)
{
_dbConn_fc_Dir = new Dictionary<string, Dictionary<string, FieldCollection>>();
_fields = fc.Clone();
defaultConnID = DefConnID;
defaultTableID = DefTableID;
decompose(_fields);
}
示例6: Validate
public bool Validate(FieldCollection sourceCollection, FieldCollection targetCollection, TokenParser tokenParser)
{
Dictionary<string, string[]> parserSettings = new Dictionary<string, string[]>();
parserSettings.Add("SchemaXml", new string[] { "~sitecollection", "~site", "{sitecollectiontermstoreid}", "{termsetid}" });
bool isFieldMatch = ValidateObjectsXML(sourceCollection, targetCollection, "SchemaXml", new List<string> { "ID" }, tokenParser, parserSettings);
Console.WriteLine("-- Field validation " + isFieldMatch);
return isFieldMatch;
}
示例7: RegisterWAPMessage
public static void RegisterWAPMessage(FieldCollection fc)
{
if (fc == null)
return;
if(MessageDict.ContainsKey(GetWAPMessageID(fc)))
return;
MessageDict.Add(GetWAPMessageID(fc), fc);
}
示例8: GetDateTimeValue
public DateTime GetDateTimeValue(FieldCollection fc, string fieldName, DateTime defaultValue)
{
if (!IsEmptyStrField(fc, fieldName))
//if (fc[fieldName].AllowModify)
return fc[fieldName].GetValueAsDateTime();
return defaultValue;
}
示例9: GetDecimalValue
public decimal GetDecimalValue(FieldCollection fc, string fieldName, decimal defaultValue)
{
if (!IsEmptyStrField(fc, fieldName))
//if (fc[fieldName].AllowModify)
return fc[fieldName].GetValueAsDecimal();
return defaultValue;
}
示例10: Add
public void Add(FieldCollection fcp)
{
FieldCollection tmpfc = fcp.Clone();
decompose(tmpfc);
if (isLoadDT)
{
_fields = tmpfc;
}
}
示例11: 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));
}
}
示例12: GetWAPMessageID
public static UInt32 GetWAPMessageID(FieldCollection fc)
{
if(fc!=null)
{
var fcFormat = new FieldCollectionFormat();
if(!fcFormat.IsEmptyStrField(fc,"MessageID"))
return (UInt32)fc["MessageID"].GetValueAsInt();
}
return 0;
}
示例13: 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;
}
示例14: GetClassName
public static string GetClassName(FieldCollection fc)
{
if (fc != null)
{
var fcFormat = new FieldCollectionFormat();
if (!fcFormat.IsEmptyStrField(fc, "ClassName"))
return fc["ClassName"].GetValueAsString();
}
return "";
}
示例15: GetExceptionDescription
public static string GetExceptionDescription(FieldCollection fc)
{
if (fc != null)
{
var fcFormat = new FieldCollectionFormat();
if (!fcFormat.IsEmptyStrField(fc, "ExceptionDescription"))
return fc["ExceptionDescription"].GetValueAsString();
}
return "";
}