本文整理汇总了C#中SPField类的典型用法代码示例。如果您正苦于以下问题:C# SPField类的具体用法?C# SPField怎么用?C# SPField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SPField类属于命名空间,在下文中一共展示了SPField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessFieldProperties
protected override void ProcessFieldProperties(SPField field, FieldDefinition fieldModel)
{
// let base setting be setup
base.ProcessFieldProperties(field, fieldModel);
var typedField = field as SPFieldUser;
var typedFieldModel = fieldModel.WithAssertAndCast<UserFieldDefinition>("model", value => value.RequireNotNull());
typedField.AllowDisplay = typedFieldModel.AllowDisplay;
typedField.Presence = typedFieldModel.Presence;
typedField.AllowMultipleValues = typedFieldModel.AllowMultipleValues;
if (!string.IsNullOrEmpty(typedFieldModel.SelectionMode))
typedField.SelectionMode = (SPFieldUserSelectionMode)Enum.Parse(typeof(SPFieldUserSelectionMode), typedFieldModel.SelectionMode);
if (typedFieldModel.SelectionGroup.HasValue)
{
typedField.SelectionGroup = typedFieldModel.SelectionGroup.Value;
}
else if (!string.IsNullOrEmpty(typedFieldModel.SelectionGroupName))
{
var group = GetCurrentWeb().SiteGroups.OfType<SPGroup>().FirstOrDefault(g => g.Name.ToUpper() == typedFieldModel.SelectionGroupName.ToUpper());
typedField.SelectionGroup = group.ID;
}
}
示例2: InitializeWithField
//protected Label LabelRegularExpression;
public void InitializeWithField(SPField field)
{
this.fldCustomFieldTypeRegEx = field as CustomFieldTypeRegEx;
if (this.Page.IsPostBack)
{
return;
}
txtRegularExpression.Text = "";
txtErrorMessage.Text = "";
if (field != null)
{
txtRegularExpression.Text = fldCustomFieldTypeRegEx.propRegularExpression;
txtErrorMessage.Text = fldCustomFieldTypeRegEx.propErrorMessage;
//this.txtRegularExpression.Visible = true;
}
else
{
txtRegularExpression.Text = "";
txtRegularExpression.Text = "";
//this.txtRegularExpression.Visible = true;
}
}
开发者ID:photon-infotech,项目名称:sharepoint-resource-management,代码行数:26,代码来源:CustomFieldTypeRegExFieldEditor.cs
示例3: IsDisplayField
public static bool IsDisplayField(SPField field)
{
using (new EnterExitLogger("Utilities:IsDisplayField function"))
{
bool display = false;
if (field != null && !field.Hidden && (Array.IndexOf<string>(EXCLUDED_FIELDS, field.InternalName) < 0))
{
switch (field.Type)
{
case SPFieldType.Computed:
if (((SPFieldComputed)field).EnableLookup) { display = true; }
break;
case SPFieldType.Calculated:
if (((SPFieldCalculated)field).OutputType == SPFieldType.Text) { display = true; }
break;
default:
display = true;
break;
}
}
return display;
}
}
示例4: ProcessFieldProperties
protected override void ProcessFieldProperties(SPField field, FieldDefinition fieldModel)
{
// let base setting be setup
base.ProcessFieldProperties(field, fieldModel);
if (!string.IsNullOrEmpty(fieldModel.ValidationMessage))
field.ValidationMessage = fieldModel.ValidationMessage;
if (!string.IsNullOrEmpty(fieldModel.ValidationFormula))
field.ValidationFormula = fieldModel.ValidationFormula;
var typedFieldModel = fieldModel.WithAssertAndCast<DateTimeFieldDefinition>("model", value => value.RequireNotNull());
var typedField = field as SPFieldDateTime;
if (!string.IsNullOrEmpty(typedFieldModel.CalendarType))
typedField.CalendarType = (SPCalendarType)Enum.Parse(typeof(SPCalendarType), typedFieldModel.CalendarType);
if (!string.IsNullOrEmpty(typedFieldModel.DisplayFormat))
typedField.DisplayFormat = (SPDateTimeFieldFormatType)Enum.Parse(typeof(SPDateTimeFieldFormatType), typedFieldModel.DisplayFormat);
#if !NET35
if (!string.IsNullOrEmpty(typedFieldModel.FriendlyDisplayFormat))
typedField.FriendlyDisplayFormat = (SPDateTimeFieldFriendlyFormatType)Enum.Parse(typeof(SPDateTimeFieldFriendlyFormatType), typedFieldModel.FriendlyDisplayFormat);
#endif
}
示例5: CustomFieldTypeValidation
protected override void CustomFieldTypeValidation(AssertPair<FieldDefinition, SPField> assert, SPField spObject, FieldDefinition definition)
{
var typedObject = spObject as SPFieldLookup;
var typedDefinition = definition.WithAssertAndCast<LookupFieldDefinition>("model", value => value.RequireNotNull());
// https://github.com/SubPointSolutions/spmeta2/issues/310
// AllowMultipleValues - TRUE - LookupMulti
// AllowMultipleValues - FALSE - Lookup
assert.ShouldBeEqual((p, s, d) =>
{
var srcProp = s.GetExpressionValue(m => m.FieldType);
var dstProp = d.GetExpressionValue(m => d.TypeAsString);
var isValid = typedDefinition.AllowMultipleValues
? typedObject.TypeAsString == "LookupMulti"
: typedObject.TypeAsString == "Lookup";
return new PropertyValidationResult
{
Tag = p.Tag,
Src = srcProp,
Dst = dstProp,
IsValid = isValid
};
});
}
示例6: ProcessCommonProperties
private static void ProcessCommonProperties(SPField siteField, FieldDefinition fieldModel)
{
siteField.Title = fieldModel.Title;
siteField.Group = fieldModel.Group;
// SPBug, description cannot be null
siteField.Description = fieldModel.Description ?? string.Empty;
}
示例7: ProcessFieldProperties
protected override void ProcessFieldProperties(SPField field, FieldDefinition fieldModel)
{
// let base setting be setup
base.ProcessFieldProperties(field, fieldModel);
var typedFieldModel = fieldModel.WithAssertAndCast<SummaryLinkFieldDefinition>("model", value => value.RequireNotNull());
var typedField = field as SummaryLinkField;
}
示例8: OnSaveChange
public void OnSaveChange(SPField field, bool isNewField)
{
if (field is RegExpField)
{
var Validfield = field as RegExpField;
Validfield.ValidRegExp = RegExp.Text;
Validfield.ErrorMessage = ErrorMessage.Text;
}
}
示例9: AddTemplateContainer
protected virtual void AddTemplateContainer(Control container, SPField field, string className = null) {
TemplateContainer templateContainer = CreateTemplateContainer(field);
container.Controls.Add(templateContainer);
ControlTemplate.InstantiateIn(templateContainer);
var gridCol = templateContainer.FindControl("GridCol") as HtmlGenericControl;
if (gridCol == null)
throw new ArgumentException("Could not find 'GridCol' in FabricListFieldIterator control template.");
gridCol.Attributes.Add("class", className ?? "col-md-12");
}
示例10: InitializeWithField
public void InitializeWithField(SPField field)
{
this.fldCGMADimensionFieldType = field as CGMADimensionFieldType;
if (this.Page.IsPostBack)
{
return;
}
}
示例11: SPGENEntityEvalLinqExprArgs
public SPGENEntityEvalLinqExprArgs(string operand, object value, Expression expr, XmlNode CamlQuery, PropertyInfo sourceProperty, PropertyInfo ownerProperty, SPField field)
{
this.Operand = operand;
this.Value = value;
this.Expression = expr;
this.CamlQuery = CamlQuery;
this.SourceProperty = sourceProperty;
this.Field = field;
this.OwnerEntityProperty = ownerProperty;
}
示例12: Initialize
public void Initialize(SPField field, Type propertyType)
{
Guard.ThrowIfArgumentNull(field, "field");
Guard.ThrowIfArgumentNull(propertyType, "propertyType");
Guard.ThrowIfArgumentNotIs<string>(field.FieldValueType, "field.FieldValueType");
Field = field;
PropertyType = propertyType;
}
示例13: FieldNode
public FieldNode(SPField field)
{
this.Tag = field;
this.SPParent = field.ParentList;
//this.ContextMenuStrip = SPMMenu.Strips.GetMenu(typeof(FieldMenuStrip));
Setup();
//this.Nodes.Add(new ExplorerNodeBase("Dummy"));
}
示例14: InstantiateConverter
private static IFieldConverter InstantiateConverter(MetaProperty info, SPField field)
{
var converter = info.CustomConverterType != null ?
FieldConverterResolver.Instance.Create(info.CustomConverterType) :
FieldConverterResolver.Instance.Create(field.TypeAsString);
converter.Initialize(field, info.MemberType);
return converter;
}
示例15: CreateTemplateContainer
protected virtual TemplateContainer CreateTemplateContainer(SPField field) {
TemplateContainer templateContainer = new TemplateContainer();
//templateContainer.ControlMode = base.ControlMode;
PropertyInfo ControlMode = typeof(TemplateContainer).GetProperty("ControlMode", BindingFlags.NonPublic | BindingFlags.Instance);
ControlMode.SetValue(templateContainer, base.ControlMode);
//templateContainer.FieldName = field.InternalName;
PropertyInfo FieldName = typeof(TemplateContainer).GetProperty("FieldName", BindingFlags.NonPublic | BindingFlags.Instance);
FieldName.SetValue(templateContainer, field.InternalName);
return templateContainer;
}