Class StringFragmentCollection
Container for string fragments
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Core.Html.StringParsing
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public class StringFragmentCollection : Collection<IStringFragment>, IList<IStringFragment>, ICollection<IStringFragment>, IList, ICollection, IReadOnlyList<IStringFragment>, IReadOnlyCollection<IStringFragment>, IEnumerable<IStringFragment>, IEnumerable
Constructors
StringFragmentCollection()
Initializes a new instance of the StringFragmentCollection class.
Declaration
public StringFragmentCollection()
StringFragmentCollection(IEnumerable<IStringFragment>)
Initializes a new instance of the StringFragmentCollection class with the provided fragments.
Declaration
public StringFragmentCollection(IEnumerable<IStringFragment> stringFragments)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IStringFragment> | stringFragments | The string fragments. |
StringFragmentCollection(IList<IStringFragment>)
Initializes a new instance of the StringFragmentCollection class.
Declaration
public StringFragmentCollection(IList<IStringFragment> stringFragments)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<IStringFragment> | stringFragments | The string fragments. |
Properties
IsReadOnly
Gets a value indicating whether this instance is read only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
GetFilteredFragments()
Gets the string fragments for the current principal.
Declaration
public StringFragmentCollection GetFilteredFragments()
Returns
Type | Description |
---|---|
StringFragmentCollection | A StringFragmentCollection with the fragments that the current principal should see. |
Remarks
This applies filtering for visitor group settings but but not access rights or filtering on publishing status.
GetFilteredFragments(IPrincipal)
Gets the string fragments accessable for a given principal.
Declaration
public StringFragmentCollection GetFilteredFragments(IPrincipal principal)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Principal.IPrincipal | principal | The principal. |
Returns
Type | Description |
---|---|
StringFragmentCollection | A StringFragmentCollection with the fragments that the given principal should see. |
InsertItem(Int32, IStringFragment)
Inserts the item. Will call the event AddingFragment before the item gets added.
Declaration
protected override void InsertItem(int index, IStringFragment item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
IStringFragment | item | The item. |
Overrides
RemoveItem(Int32)
Declaration
protected override void RemoveItem(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Overrides
SetItem(Int32, IStringFragment)
Sets the item. Will call the event ChangingFragment before the item gets changed.
Declaration
protected override void SetItem(int index, IStringFragment item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
IStringFragment | item | The item. |
Overrides
ToReadOnly()
Gets a read only version of the current collection.
Declaration
public virtual StringFragmentCollection ToReadOnly()
Returns
Type | Description |
---|---|
StringFragmentCollection | A read-only version of this collection. |
Events
AddingFragment
Event which will be trigged before an fragment gets added.
Declaration
public event EventHandler<StringFragmentEventArgs> AddingFragment
Event Type
Type | Description |
---|---|
System.EventHandler<StringFragmentEventArgs> |
ChangingFragment
Event which will be trigged before an fragment gets changed.
Declaration
public event EventHandler<StringFragmentEventArgs> ChangingFragment
Event Type
Type | Description |
---|---|
System.EventHandler<StringFragmentEventArgs> |
RemovedFragment
Raised before a string fragment is removed from the collection
Declaration
public event EventHandler<StringFragmentEventArgs> RemovedFragment
Event Type
Type | Description |
---|---|
System.EventHandler<StringFragmentEventArgs> |