本文整理汇总了C#中FieldList类的典型用法代码示例。如果您正苦于以下问题:C# FieldList类的具体用法?C# FieldList怎么用?C# FieldList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldList类属于命名空间,在下文中一共展示了FieldList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestItem
public TestItem(FieldList fieldList, string itemName = "dummy")
: base(new ID(new Guid()),
new ItemData(new ItemDefinition(new ID(new Guid()), itemName, new ID(new Guid()), new ID(new Guid())), Language.Invariant, new Sitecore.Data.Version(1), fieldList),
TestDatabaseFactory.Create())
{
}
示例2: ColumnInfo
public ColumnInfo( ObjectMap objectMap, string[] columnNames )
{
this.columnNames = columnNames;
columnComboHashCode = ObjectConstructor.GetFieldComboHashCode( columnNames );
fields = new FieldList();
for( int i = 0; i < columnNames.Length; i++ )
{
string columnName = columnNames[ i ];
FieldMap fm = objectMap.GetFieldMapFromColumn( columnName );
if( fm == null )
{
// check for column names with table name prefixes
int pos = columnName.IndexOf( '.' );
if( pos > 0 )
{
columnName = columnName.Substring( pos + 1, columnName.Length - pos - 1 );
fm = objectMap.GetFieldMapFromColumn( columnName );
if( fm != null )
{
columnNames[ i ] = columnName;
}
}
if( fm == null ) // no corresponding member could be found - assume column is calculated
{
columnCalculatedMask |= 1 << i;
}
}
fields.Add( fm ); // intentionally add null entries to preserve column order
}
}
示例3: CreateItemWithShowInMenuFalseShouldReturnEmptyString
public void CreateItemWithShowInMenuFalseShouldReturnEmptyString()
{
FieldList stubFieldList = new FieldList();
Item stub = new ContentItem(stubFieldList);
string navigationTitle = ResultFactory.Create(stub);
Assert.IsNotNull(navigationTitle);
}
示例4: CreateItemWithShowInMenuTrueShouldReturnItemNavigationTitle
public void CreateItemWithShowInMenuTrueShouldReturnItemNavigationTitle()
{
FieldList stubFieldList = new FieldList();
Item stub = new ContentItem(stubFieldList);
string navigationTitle = ResultFactory.Create(stub);
Assert.AreEqual("NavigationTitle", navigationTitle);
}
示例5: WhenReferencedProcessIsVersioningEnabled_VerionDateAndVersionNumberFieldsShouldBeAdded_CR
public void WhenReferencedProcessIsVersioningEnabled_VerionDateAndVersionNumberFieldsShouldBeAdded_CR()
{
// Arrange.
var done = false;
var fieldList = new FieldList { IsVersioningEnabled = true };
var vm = CreateReverseCrossRefDisplayFieldViewModel();
Mock.Arrange(() => FieldList.BeginGetCrossReferenceSubfields(ReferencedProcessName, FieldName, Arg.IsAny<EventHandler<DataPortalResult<FieldList>>>()))
.DoInstead<string, string, EventHandler<DataPortalResult<FieldList>>>((process, field, action) => action(null, new DataPortalResult<FieldList>(fieldList, null, null)));
// Act.
vm.LoadSubFields(() => { done = true; });
// Assert.
EnqueueConditional(() => done);
EnqueueCallback(
() =>
{
Assert.IsTrue(vm.Subfields.Any(f => f.SystemName == Constants.VersionNumber));
Assert.IsTrue(vm.Subfields.Any(f => f.SystemName == Constants.VersionDate));
});
EnqueueTestComplete();
}
示例6: FieldList
public FieldList(Position pos, Symbol name, Symbol type, FieldList tail)
{
Pos = pos;
Name = name;
Type = type;
Tail = tail;
}
示例7: BuildFromFieldList
public static BoolList BuildFromFieldList(FieldList param)
{
if (param == null)
return null;
else
return new BoolList(param.Escape, BuildFromFieldList(param.Tail));
}
示例8: ProcessShouldSetAreaControllerRendererIfDescendantOfAreaControllerTemplate
public void ProcessShouldSetAreaControllerRendererIfDescendantOfAreaControllerTemplate()
{
// Arrange
var builder = new Template.Builder("Area Controller Template", Constants.Templates.AreaController, new TemplateCollection());
var fieldList = new FieldList
{
{Constants.Fields.Controller.Action, "Index"},
{Constants.Fields.Controller.Name, "HelloWorld"},
{Constants.Fields.Controller.Area, "MyArea"},
{Constants.Fields.Controller.UseChildActionBehavior, "1"}
};
var innerItem = new TestItem(fieldList);
var rendering = new Rendering { RenderingItem = new RenderingItem(innerItem)};
_args.Rendering = rendering;
_args.RenderingTemplate = builder.Template;
_controller.ControllerRunner = new Mock<IControllerRunner>().Object;
// Act
_controller.Process(_args);
// Assert
Assert.That(_args.Result, Is.InstanceOf<AreaControllerRenderer>(), "Rendering should be an AreaControllerRenderer");
}
示例9: FakeItemAddFieldShouldReturnField
public void FakeItemAddFieldShouldReturnField(FieldList fieldList,string fieldValue)
{
var fieldId = ID.NewID;
fieldList.Add(fieldId,fieldValue);
var fake = new FakeItem(fieldList);
fake[fieldId].ShouldBeEquivalentTo(fieldValue);
}
示例10: Process
public virtual void Process(GetItemFieldsArgs args)
{
Assert.ArgumentNotNull(args, "args");
Assert.ArgumentNotNull(args.ItemDefinition, "args.ItemDefinition");
Assert.ArgumentNotNull(args.Context, "args.Context");
var itemId = args.ItemDefinition.ID;
var fields = new FieldList();
var owner = typeof(ContactFacetDataProvider).Name;
fields.Add(Sitecore.FieldIDs.CreatedBy, owner);
fields.Add(Sitecore.FieldIDs.Owner, owner);
if (IDTableHelper.IsFacetItem(itemId))
{
var facetName = IDTableHelper.GetFacetName(itemId);
fields.Add(Sitecore.FieldIDs.DisplayName, facetName);
fields.Add(Sitecore.Strategy.Contacts.DataProviders.FieldIDs.ContactFacetName, facetName);
var contractType = ContactFacetHelper.GetContractTypeForFacet(facetName);
if (contractType != null)
{
fields.Add(Sitecore.Strategy.Contacts.DataProviders.FieldIDs.ContactFacetContract, contractType.AssemblyQualifiedName);
if (ContactFacetHelper.ContactFacetImplementations.ContainsKey(contractType))
{
var implType = ContactFacetHelper.ContactFacetImplementations[contractType];
if (implType != null)
{
fields.Add(Sitecore.Strategy.Contacts.DataProviders.FieldIDs.ContactFacetImplementation, implType.AssemblyQualifiedName);
}
}
}
}
if (IDTableHelper.IsFacetMemberItem(itemId))
{
var memberName = IDTableHelper.GetFacetMemberName(itemId);
fields.Add(Sitecore.FieldIDs.DisplayName, memberName);
fields.Add(Sitecore.Strategy.Contacts.DataProviders.FieldIDs.ContactFacetMemberName, memberName);
var facetId = IDTableHelper.GetFacetMemberParentId(itemId);
var facetName = IDTableHelper.GetFacetName(facetId);
var memberType = ContactFacetHelper.GetFacetMemberType(facetName, memberName);
if (memberType != null)
{
fields.Add(Sitecore.Strategy.Contacts.DataProviders.FieldIDs.ContactFacetMemberType, memberType.AssemblyQualifiedName);
}
}
if (IDTableHelper.IsFacetMemberValueItem(itemId))
{
var value = IDTableHelper.GetFacetMemberValue(itemId);
if (!string.IsNullOrEmpty(value))
{
fields.Add(Sitecore.Strategy.Contacts.DataProviders.FieldIDs.ContactFacetMemberValueValue, value);
}
var description = IDTableHelper.GetFacetMemberValueDescription(itemId);
if (!string.IsNullOrEmpty(description))
{
fields.Add(Sitecore.FieldIDs.DisplayName, description);
fields.Add(Sitecore.Strategy.Contacts.DataProviders.FieldIDs.ContactFacetMemberValueDescription, description);
}
}
args.FieldList = fields;
}
示例11: FakeItem
public FakeItem(FieldList fieldList, ID itemid, ID templateId, string itemName = DefaultitemName, string databaseName = DefaultDatabaseName)
: base(itemid,
new ItemData(new ItemDefinition(ID.NewID, itemName, templateId, ID.NewID),
Globalization.Language.Invariant, new Data.Version(1), fieldList),
new Database(databaseName))
{
FakeChildren = new ItemList();
}
示例12: Resolve
public Resolve(string name, params string[] shows)
{
Name = name;
Show = new FieldList();
foreach (var show in shows) {
Show.Add(show);
}
}
示例13: FakeItemGetFieldFromIdShoudlReturnFieldValue
public void FakeItemGetFieldFromIdShoudlReturnFieldValue(string fieldValue, FieldList fieldList)
{
var fieldId = ID.NewID;
fieldList.Add(fieldId, fieldValue);
var fake = new FakeItem(fieldList);
fake[fieldId].ShouldAllBeEquivalentTo(fieldValue);
}
示例14: FunctionDeclaration
public FunctionDeclaration(Position pos, Symbol name, FieldList param, NameType result, Expression body, FunctionDeclaration next)
{
Pos = pos;
Name = name;
Param = param;
Result = result;
Body = body;
Next = next;
}
示例15: FakeItemAddMultipleFieldShouldReturnField
public void FakeItemAddMultipleFieldShouldReturnField(FieldList fieldList, string fieldValue)
{
var fieldIdOne = ID.NewID;
var fieldIdTwo = ID.NewID;
fieldList.Add(fieldIdOne, fieldValue);
fieldList.Add(fieldIdTwo, fieldValue);
var fake = new FakeItem(fieldList);
fake.Fields.Should().HaveCount(2);
}